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 — Specialized sub-classes of Generic never call __init__ · Issue #192 · python/typing Closed Milestone DescriptionSee http://bugs.python.org/issue26391 . """ from typing import Generic, TypeVar T = TypeVar('T') class Foo(Generic[T]): def __init__(self, value: T): self.value = value Bar = Foo[str] foo = Foo('foo') bar = Bar('bar') print(type(foo), end=' ') print(foo.value) print(type(bar), end=' ') print(bar.value) # AttributeError I would expect Foo[str], Foo[int], etc to be equivalent to Foo at run-time. If this is not the case it might deserve an explicit mention in the docs. At the moment, behaviour is confusing because an instance of Foo is returned that does not have any of its attributes set. Activity
MetadataMetadataAssigneesLabelsNo labels 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. |