[Python-Dev] Adding Type[C] to PEP 484 (original) (raw)
Stephen J. Turnbull stephen at xemacs.org
Sat May 21 03:49:11 EDT 2016
- Previous message (by thread): [Python-Dev] Adding Type[C] to PEP 484
- Next message (by thread): [Python-Dev] First 3.6.0 alpha release coming up: 2016-05-16 12:00 UTC
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Sven R. Kunze writes:
Type[A, B] reminds me of isinstance(obj, (A, B)).
Sure, but Guido already invoked EIBTI.
For one (obscure) alternative, Type[A, B] reminded me of Fun(A,B) (the functors from category A to category B), and in Python I would tend to map that to a function type (taking argument from A, returning value from B). Another (probably more plausible to Pythonistas) would be a type that mixes A and B, ie, one might be reminded of
class C(A, B):
pass
isinstance(obj, C)
or even (continuing the example)
class E(B, A, D): # Order of A, B irrelevant! Yikes!
pass
isinstance(obj, (C, E))
Regards,
- Previous message (by thread): [Python-Dev] Adding Type[C] to PEP 484
- Next message (by thread): [Python-Dev] First 3.6.0 alpha release coming up: 2016-05-16 12:00 UTC
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]