You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected types to be promoted to sub-types within an issubclass block, the same as instances within an isinstance block, but type-checking the following code results in the error Type[Vehicle] has no attribute "wheels":
Yeah, this would be a reasonable thing to support, though you can currently work around the limitation pretty easily by using cast(Type[Subclass], x) after the issubclass check. Example:
I expected types to be promoted to sub-types within an
issubclass
block, the same as instances within anisinstance
block, but type-checking the following code results in the errorType[Vehicle] has no attribute "wheels"
:Is this be possible or am I missing something? I'm testing against the master branch.
The text was updated successfully, but these errors were encountered: