[issue46970] dataclass(slots=True) incompatible with __init_subclass__

2022-03-09 Thread Guido Imperiale
Change by Guido Imperiale : -- type: -> crash ___ Python tracker <https://bugs.python.org/issue46970> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue46970] dataclass(slots=True) incompatible with __init_subclass__

2022-03-09 Thread Guido Imperiale
Change by Guido Imperiale : -- nosy: +eric.smith ___ Python tracker <https://bugs.python.org/issue46970> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46970] dataclass(slots=True) incompatible with __init_subclass__

2022-03-09 Thread Guido Imperiale
New submission from Guido Imperiale : Related to #46382 A class decorated with dataclass(slots=True) can't pass any parameters to the __init_subclass__ method of its parent class. from dataclasses import dataclass class A: __slots__ = () def __init_subclass__(cls, msg

[issue39435] pickle: inconsistent arguments pickle.py vs _pickle.c vs docs

2020-01-23 Thread Guido Imperiale
New submission from Guido Imperiale : (1) In the documentation for loads(), the name for the first argument of loads is 'bytes_object'. The actual signature, both in pickle.py and _pickle.c, it is instead 'data'. (2) In the documentation and in pickle.py, the default value for the 'buffers

[issue38854] Decorator breaks inspect.getsource

2019-11-19 Thread Guido Imperiale
New submission from Guido Imperiale : Python 3.7.5 and 3.8.0 A decorator causes inspect.getsource() to return clipped output: from collections import defaultdict from functools import wraps import inspect def foo(*args): def decorator(func): @wraps(func) def wrapper

[issue38214] __reduce__ API specs for objects with __slots__

2019-09-18 Thread Guido Imperiale
New submission from Guido Imperiale : The documentation for the pickle module states, about the 3rd element of the tuple returned by __reduce__: Optionally, the object’s state, which will be passed to the object’s __setstate__() method as previously described. If the object has

[issue38105] hash collision when hash(x) == -2 causes many calls to __eq__

2019-09-11 Thread Guido Imperiale
Guido Imperiale added the comment: Of course, the chances that in real life a custom object will have hash == -2 are very small. Different story however is for the actual numbers -1 and -2: In [2]: %timeit {-1, -3

[issue38105] hash collision when hash(x) == -2 causes many calls to __eq__

2019-09-11 Thread Guido Imperiale
Guido Imperiale added the comment: Forgot a counter-example: {C(1, 0), C(2, 0)} C((1, 0)).__hash__ C((2, 0)).__hash__ C((1, 0)).__eq__(C((2, 0))) {C((1, 0)), C((2, 0))} -- ___ Python tracker <https://bugs.python.org/issue38

[issue38105] hash collision when hash(x) == -2 causes many calls to __eq__

2019-09-11 Thread Guido Imperiale
New submission from Guido Imperiale : Take two objects where hash(a) == hash(b) == -2 exactly, but a != b, When they are inserted in a dict or set, the __eq__ method is invoked a whopping 13 times. Does this have something to do with the special case of hash(-1) = -2? class C: def

[issue36456] task.cancel unbound recursion

2019-06-24 Thread Guido Imperiale
Change by Guido Imperiale : -- nosy: +crusaderky ___ Python tracker <https://bugs.python.org/issue36456> ___ ___ Python-bugs-list mailing list Unsubscribe: