Closed array93 closed 2 weeks ago
also the example itself does not implement __new__
which would make the value a tuple?
@array93 Thanks for reporting, you are right the documentation was not correct. The issue was recently fixed in https://github.com/python/cpython/pull/118311. That change will take some time though before it ends up in the official documentation.
Thanks both, let's mark this as a duplicate of https://github.com/python/cpython/issues/118310.
Documentation
Section describing
__new__(cls, *args, **kwds)
says:While
class int(x, base=10)
suggests the value would be26
since1A
hex is26
decimal.Also wouldn't the enum in the example need to inherit from
int
to get its__new__
implementation? I'm confused about the mixed-in.