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

Use different union syntax #456

Open
3 tasks
JSAbrahams opened this issue Jan 26, 2023 · 0 comments
Open
3 tasks

Use different union syntax #456

JSAbrahams opened this issue Jan 26, 2023 · 0 comments
Labels
enhancement: generate New feature in the core module enhancement: parse New feature in the parse module

Comments

@JSAbrahams
Copy link
Owner

JSAbrahams commented Jan 26, 2023

Current Issue

Typing syntax for union looks a bit like sets, might be a bit confusing.

High-level description of the feature

Use same union syntax as Python, Typescrpt (other?) instead of current, so:
def x: {A, B, C ...} := ... changes to def x: A | B | C := ....

This also has the added benefit of being more familiar to uses of those languages.
Plus, it just looks better, now we don't mistake it for a set accidentally.

Description of potential implementation

  • Update parser to deal with new syntax.
  • Update docs (BNF) to reflect change.
  • Also change Python output to use this syntax as per PEP 604.
@JSAbrahams JSAbrahams added enhancement: parse New feature in the parse module enhancement: generate New feature in the core module labels Jan 26, 2023
@JSAbrahams JSAbrahams added this to the v0.4 | Mutability milestone Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement: generate New feature in the core module enhancement: parse New feature in the parse module
Projects
None yet
Development

No branches or pull requests

1 participant