GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Overlapping type · Issue #2154 · python/typing Open Labels topic: featureDiscussions about new features for Python's type annotationsDiscussions about new features for Python's type annotations DescriptionThis is an rough idea from the recent discussion of whether to use class MyPoppable[KT, VT]: def pop(self, x: X) -> VT: ... What should poppable: MyPoppable[str] poppable.pop(123) But has a problem with overlapping types: def foo(x: int | str): poppable.pop(x) On the other hand, using The solution would be able to specify that any partially overlapping type would be accepted: class MyPoppable[KT, VT]: def pop(self, x: Overlapping[KT]) -> VT: ...
Activity
MetadataMetadataAssigneesLabelstopic: featureDiscussions about new features for Python's type annotationsDiscussions about new features for Python's type annotations ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |