python-stdlib-sentinels icon indicating copy to clipboard operation
python-stdlib-sentinels copied to clipboard

May `Sentinel` be subclassed?

Open not-my-profile opened this issue 2 years ago • 0 comments

The specification currently does not specify whether or not the Sentinel class may be subclassed. The reference implementation does not use @typing.final, allowing subclasses, which I think does make sense because it allows e.g. the __str__ or __le__ methods of sentinel objects to be customized, which can be very useful.

I think it would make sense to clarify the specification to say that the Sentinel class may be subclassed.

not-my-profile avatar Dec 26 '22 09:12 not-my-profile