Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several changes on RTTI metadata for Python target #192

Merged
merged 3 commits into from
Nov 6, 2017

Conversation

dahlia
Copy link
Member

@dahlia dahlia commented Nov 5, 2017

  • As I suggested from deserialize_meta won't union properly nirum-python#34 (comment), now generated Python classes have __nirum_type__ attribute which contains one of 'unboxed'/'enum'/'record'/'union'/'service'. The future versions of Python runtime library would be able to utilize this rather than diagnostics using isinstance()/hasattr() queries. See also examples on test_nirum_type().

  • Also as I suggested from the same comment above, now union classes have an immutable map named __nirum_tags__ that keys are tags and values are class objects. See also examples on test_nirum_tag_classes().

  • Since the bug Python enum doesn't allow “mro” for member name #185 was also applicable to union tag enums, also fixed it. See also test_union_reserved_keyword_for_tag() to reproduce the bug.

@dahlia dahlia added cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) cmp:runtime Component: Target runtimes target:python typ:bug Type: Bug/defect typ:enhance Type: Enhancement/new feature labels Nov 5, 2017
@dahlia dahlia self-assigned this Nov 5, 2017
@dahlia dahlia requested review from kanghyojun and Kroisse November 5, 2017 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) cmp:runtime Component: Target runtimes target:python typ:bug Type: Bug/defect typ:enhance Type: Enhancement/new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants