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

Allow calling TupleTypes if the fallback can be called #4367

Merged
merged 2 commits into from Dec 16, 2017

Conversation

Projects
None yet
3 participants
@msullivan
Collaborator

msullivan commented Dec 15, 2017

Fixes #4360

@msullivan msullivan requested review from JukkaL and gvanrossum Dec 15, 2017

@gvanrossum

This comment has been minimized.

Member

gvanrossum commented Dec 15, 2017

Would you consider adding a test where __call__ takes args and returns a relevant value? (Just being paranoid here.)

@ilevkivskyi

I think this is the right fix, but could you please add more tests:

  • With classes inheriting normal tuple instead of named tuple
  • With forward references (where classes are defined after the call)
  • With more complex __call__ methods and reveal_type.
@msullivan

This comment has been minimized.

Collaborator

msullivan commented Dec 15, 2017

Added more testing. Our documentation claims that Tuple can't be subclassed directly, which is why I was testing with NamedTuple.

@ilevkivskyi

This comment has been minimized.

Collaborator

ilevkivskyi commented Dec 16, 2017

Added more testing. Our documentation claims that Tuple can't be subclassed directly, which is why I was testing with NamedTuple.

The docs need to be updated, would you like to make a PR?

@ilevkivskyi ilevkivskyi merged commit 080e345 into master Dec 16, 2017

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@ilevkivskyi ilevkivskyi deleted the call-tuple branch Dec 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment