[issue40117] __round__ doesn't behave well with return NotImplemented

2020-03-30 Thread Hameer Abbasi
Change by Hameer Abbasi : -- type: -> behavior ___ Python tracker <https://bugs.python.org/issue40117> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue40117] __round__ doesn't behave well with return NotImplemented

2020-03-30 Thread Hameer Abbasi
New submission from Hameer Abbasi : Minimal reproducer: >>> class A: ... def __round__(self): ... return NotImplemented ... >>> round(A()) NotImplemented Should give a TypeError. This can be useful when deciding, for example, if a given a.dtype implements

[issue36359] contextvars documentation unclear on thread-locality

2019-03-19 Thread Hameer Abbasi
New submission from Hameer Abbasi : The documentation here: https://docs.python.org/3/library/contextvars.html does not mention anything about context-variables being thread-local or not. It should definitely make that more clear. I was told by Freenode user njs (I strongly suspect its

[issue36178] type.__init__ called instead of cls.__init__ when inheriting from type.

2019-03-04 Thread Hameer Abbasi
Hameer Abbasi added the comment: Ah, I wasn't aware I had to return... The bug was deliberate to show that not even a different signature makes a difference. ;) -- ___ Python tracker <https://bugs.python.org/is

[issue36178] type.__init__ called instead of cls.__init__ when inheriting from type.

2019-03-04 Thread Hameer Abbasi
New submission from Hameer Abbasi : I may be completely misunderstanding here, but: here's a reproducible example: class MyMeta(type): def __new__(cls, *args, **kwargs): print('__new__', *args, **kwargs) super().__new__(cls, *args, **kwargs) def _