Crell/enum-comparison

Interaction with the object typehint

Closed this issue · 2 comments

stof commented

How do enum interact with the object typehint ? Being backed by objects, a naive implementation would probably allow enums to satisfy such a typehint. But that might be counter-intuitive for devs not knowing the internal implementation.

It's not explicitly written down but generally we would like to make enums as "unspecial" as possible. So IMO yes, is_object and the object typehint will accept enums.

Crell commented

I've updated the RFC to clarify that "what objects do" is the default behavior.