typing icon indicating copy to clipboard operation
typing copied to clipboard

Incorporate PEP 483 into the spec

Open carljm opened this issue 1 year ago • 4 comments
trafficstars

I don't know if this was already considered and rejected (I didn't find an existing issue about it), but I noticed today that some key concepts and terms used in the typing spec (e.g. the consistent-with relation) don't seem to be clearly defined anywhere in the spec.

I think the way to address this that would be most in the spirit of the current spec would be to incorporate PEP 483 (possibly with some edits) into the spec. As far as I can see, it wasn't included in the original PEP-concatenation that formed the initial spec; was that intentional?

carljm avatar Mar 21 '24 22:03 carljm

I think I didn't include it because PEP 483 is marked Informational, so it shouldn't be normative. I agree that it would be good to include concepts like "consistent-with" in the spec, but I don't know if PEP 483 is the right formalization to use at this point.

JelleZijlstra avatar Mar 21 '24 23:03 JelleZijlstra

PEP-484 omits quite a few details. For example, it only partially defines is-consistent-with. I would recommend adopting (or starting with) the definitions in http://bit.ly/python-subtyping by @kmillikin instead.

superbobry avatar Mar 22 '24 09:03 superbobry

PEP-484 omits quite a few details

I assume you mean 483 here?

I initially suggested 483 because I thought it might be less controversial, given it is already an accepted PEP. But personally, I like the clarity of the kmillikin spec quite a lot and would be happy to use it as a starting point.

carljm avatar Mar 22 '24 15:03 carljm

Yes, I did mean PEP-483, although the above is true for PEP-484 as well :)

superbobry avatar Mar 22 '24 22:03 superbobry

I think this can be considered a duplicate of #1534

carljm avatar May 21 '24 19:05 carljm