Skip to content

Support for Ellipsis and ... #528

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

Merged
merged 7 commits into from
Dec 18, 2014
Merged

Support for Ellipsis and ... #528

merged 7 commits into from
Dec 18, 2014

Conversation

spkersten
Copy link
Contributor

Added Python 3 specific support for ellipsis. See test cases for examples.

I have some doubt about the way I introduced the ellipsis class, which is the type of ... and Ellipsis. I've added it as a class to builtins.py, however, that makes code like a = ellipsis() legal, which it is not. I don't know how to have ellipsis as a class, while at the same time hiding it.

Fixes #524.

@@ -146,6 +146,7 @@ def __init__(self, string: str, type: int) -> None:
INVALID_UTF8_SEQUENCE = 5
INVALID_BACKSLASH = 6
INVALID_DEDENT = 7
ELLIPSIS_ERROR = 8
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that this is needed (see below) since we'll get a parse error if ellipsis is used incorrectly.

@JukkaL
Copy link
Collaborator

JukkaL commented Dec 12, 2014

Did a quick pass (see my comments), but looks mostly good. It's a bit sad how many changes such as simple feature requires... but they are all straightforward, so it's not a big deal. The lexer and parser could be rewritten at some point to be rule-based, but it's a bit pointless do it now as there are way more urgent things to work on.

@spkersten
Copy link
Contributor Author

Good suggestions. I've taken them along.

@JukkaL
Copy link
Collaborator

JukkaL commented Dec 18, 2014

Looks good to me! Thanks for implementing this!

@JukkaL JukkaL merged commit 2fdc866 into python:master Dec 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support ... (ellipsis)
2 participants