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

No error for bare asterisk after *args #13

Closed
JukkaL opened this issue Dec 11, 2012 · 3 comments · Fixed by #325
Closed

No error for bare asterisk after *args #13

JukkaL opened this issue Dec 11, 2012 · 3 comments · Fixed by #325
Labels
bug mypy got something wrong

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Dec 11, 2012

The following code is accepted by the parser, even though Python gives a syntax error:

def f(*x, *, y = 1): pass

The code should generate a parse error.

@doboy
Copy link

doboy commented Dec 13, 2012

I'll take this

@ghost ghost assigned doboy Dec 13, 2012
JukkaL added a commit that referenced this issue Jul 24, 2014
Add missing Function to __all__ in runtime typing modules.
@JukkaL JukkaL added the easy label Jul 24, 2014
@JukkaL
Copy link
Collaborator Author

JukkaL commented Jul 24, 2014

This is still up for grabs.

@JukkaL JukkaL removed the front end label Jul 25, 2014
@etrepum
Copy link
Contributor

etrepum commented Jul 25, 2014

This is an interesting one because there are cases that Python accepts that mypy doesn't as well, such as this:

def f(*x, y): pass

Also, notably, mypy's stub for print uses a syntax that is invalid in Python!

>>> def print_(*values, *, sep=u' ', end=u'\n', file=None): pass
  File "<stdin>", line 1
    def print_(*values, *, sep=u' ', end=u'\n', file=None): pass
                        ^
SyntaxError: invalid syntax

I'm looking into it. I'm mostly done with a patch, but want to figure out what else mypy gets wrong here :)

etrepum added a commit to etrepum/mypy that referenced this issue Jul 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants