Skip to content

Support for Ellipsis and ... - #528

Merged
JukkaL merged 7 commits into
python:masterfrom
spkersten:ellipsis
Dec 18, 2014
Merged

JukkaL merged 7 commits into
python:masterfrom
spkersten:ellipsis

Conversation

@spkersten

Copy link
Copy Markdown
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.

Comment thread mypy/lex.py Outdated

Copy link
Copy Markdown
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

JukkaL commented Dec 12, 2014

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Contributor Author

Good suggestions. I've taken them along.

@JukkaL

JukkaL commented Dec 18, 2014

Copy link
Copy Markdown
Collaborator

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