Crell / enum-comparison

A comparison of enumerations and similar features in different languages
82 stars 7 forks source link

Interaction with the object typehint #40

Closed stof closed 3 years ago

stof commented 3 years ago

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.

iluuu1994 commented 3 years ago

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 3 years ago

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