Prohibit Callable[[...], X]#320
Conversation
|
Strange that was ever accepted. Was this aways there? I don't recall intending to support this. |
Sorry, something went wrong.
|
@gvanrossum It look like it was introduced in #308 when I split |
Sorry, something went wrong.
|
@gvanrossum Thanks for review! I pushed new commits taking into account your comments. Now this is much simpler (and probably right) way to fix this. |
Sorry, something went wrong.
gvanrossum
left a comment
There was a problem hiding this comment.
At some point in the future we should also add comments explaining the inner workings of all these functions. (Or docstrings, but make it clear they are NOT public or even protected APIs.)
Sorry, something went wrong.
|
I implemented your latest comments in a new commit.
This is a good idea, I will make a PR later this week. |
Sorry, something went wrong.
@gvanrossum
Now
Callable[[...], X]is accepted and treated as equivalent toCallable[..., X](alsoCallable[[()], X]is treated as equivalent toCallable[[], X]). PEP 484 does not specify the former forms, so that this PR makes them prohibited.I do not have any preference on this, so please feel free to either merge or close this.