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

Structural typing #10

Closed
gvanrossum opened this issue Oct 16, 2014 · 2 comments
Closed

Structural typing #10

gvanrossum opened this issue Oct 16, 2014 · 2 comments

Comments

@gvanrossum
Copy link
Member

I'm not entirely sure what this is (probably a different work for duck typing, where two classes are equivalent if they define the same methods, public attributes etc.). In Jeremy Siek's notes:

Retroactive Conformance

Jeremy wants to allow concrete types to be usable with
abstract types for which they did not inherit from.
Structural types allow this, and there is research on how to
do this with nominal types.
Jukka voiced the concern that some of those approaches give
up modular type checking. Jeremy agreed that modular type checking
is important, but that perhaps there's a way to have our cake
and eat it too.

This issue is related to the use of the register method on ABC's to
get the right behavior with isinstance.

Structural vs. Nominal Types

We briefly discussed the possibility of having structual
object types in addition to the nominal types currently in MyPy.
Reticulated currently suppose structural object types and
not nominal types.

@JukkaL
Copy link
Contributor

JukkaL commented Oct 16, 2014

See the comment I added to issue #11 for a possible approach for supporting structural subtyping.

@gvanrossum
Copy link
Member Author

This feels like a duplicate for #11.

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

No branches or pull requests

2 participants