Change by Guido Imperiale :
--
type: -> crash
___
Python tracker
<https://bugs.python.org/issue46970>
___
___
Python-bugs-list mailing list
Unsubscrib
Change by Guido Imperiale :
--
nosy: +eric.smith
___
Python tracker
<https://bugs.python.org/issue46970>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
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
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
Change by Guido Imperiale :
--
nosy: +crusaderky
___
Python tracker
<https://bugs.python.org/issue36456>
___
___
Python-bugs-list mailing list
Unsubscribe:
10 matches
Mail list logo