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
Hello! Guess who's back! ... I'm not doing that joke again, you can't make me! 😤
Get ready for a deluge of replies, starting with this issue! ... At least I think it's an issue!
Is everything supposed to match a Union generic when using beartype.door.is_bearable and beartype.door.is_subhint? For example, with the following block:
No AssertionError occurs. I'd really like to switch to is_subhint, because then I wouldn't have to worry about issubclass erroring out on annotations like Union[...], etc., and using typing.get_origin all the time! 😅
Thank you kindly for the help!
P.S.: I passed the graphics course! 😻 I got a D, but still. A win is a win. 😹
The text was updated successfully, but these errors were encountered:
Yay!!! It's my favourite silver Borg, @sylvorg. He's right about everything, of course. @beartype should definitely be rejecting unsubscripted type hint factories that otherwise have no semantic meaning like:
typing.Literal. Think we nailed this one recently? I dimly recall nailing this. Stay down when I put you down, bugs!
typing.Optional. 😢
typing.Union. 😭
Probably others.
Who cares about those, though! We've got an unsubscripted Union to crush.
using typing.get_origin all the time!
P.S.: I passed the graphics course! 😻 I got a D, but still. A win is a win. 😹
leycec
changed the title
Everything matches a Union generic!? 😱
[Bug] beartype.door permissively accepts unsubscripted typing.Optional and typing.Union type hint factories as akin to typing Gods!? 😱
Apr 27, 2024
Hello! Guess who's back! ... I'm not doing that joke again, you can't make me! 😤
Get ready for a deluge of replies, starting with this issue! ... At least I think it's an issue!
Is everything supposed to match a
Union
generic when usingbeartype.door.is_bearable
andbeartype.door.is_subhint
? For example, with the following block:No
AssertionError
occurs. I'd really like to switch tois_subhint
, because then I wouldn't have to worry aboutissubclass
erroring out on annotations likeUnion[...]
, etc., and usingtyping.get_origin
all the time! 😅Thank you kindly for the help!
P.S.: I passed the graphics course! 😻 I got a
D
, but still. A win is a win. 😹The text was updated successfully, but these errors were encountered: