Douglas Raillard added the comment:
EDIT: empty_list() is a class method of List, not ContainerBase
--
___
Python tracker
<https://bugs.python.org/issue47
Douglas Raillard added the comment:
> Would bpo-47143 "Add functools.copy_class() which updates closures" solve
> your use case?
This looks like a similar issue indeed. If I'm able to copy a class "cleanly"
(as defined in this other thread), that may
New submission from Douglas Raillard :
The cell object __classcell__ currently cannot be set by code invoked by
metaclass.__new__. Attempts to do so will be caught by builtin___build_class__
in bltimodule.c:
} else {
const char *msg
New submission from Douglas Raillard :
The following script exhibits the memory leak. It only happens if
"dispatch_table" is set _before_ calling super().__init__, which is pretty
unexpected.
import pickle
import io
import gc
import tracemalloc
tracemallo
Douglas Raillard added the comment:
Drive by comment: I landed on this thread for the exact same reason:
> This situation is very frequent when e.g. a library is designed to be
> async-first, and also provides a blocking API which just wraps the async code
> by running it until
Douglas Raillard added the comment:
I ended up with a slightly different API that allows me to preemptively set
some global names before the code runs in the module, so my use case sort of
vanished. I don't think there is a real need of beating the dead horse here.
My only suggestion o
Douglas Raillard added the comment:
Looks like it is, for some reason I did not find these previous issues when
looking for existing ones.
--
___
Python tracker
<https://bugs.python.org/issue44
New submission from Douglas Raillard :
Re-raising the bug reported by Kevin Shweh:
thread: https://bugs.python.org/issue14385
message: https://bugs.python.org/msg337245
Here is a copy for easier reference:
The patch for this issue changed LOAD_GLOBAL to use PyObject_GetItem when
globals() is
Douglas Raillard added the comment:
The solution based on the signature is something along those lines:
class E(BaseException):
def __new__(cls, *args, **kwargs):
"""
Fix exception copying.
Turn all the keyword arguments
New submission from Douglas Raillard :
Instances of subclasses of BaseException created with keyword argument fail to
copy properly as demonstrated by:
import copy
class E(BaseException):
def __init__(self, x):
self.x=x
# works fine
e = E(None
Douglas Raillard added the comment:
Thanks for looking into this issue
--
___
Python tracker
<https://bugs.python.org/issue43102>
___
___
Python-bugs-list mailin
Douglas Raillard added the comment:
I did hit the issue while porting a tool to Python 3.9:
https://github.com/ARM-software/lisa/pull/1585/commits/a4cd3aa1ad339ebfe59cc9e2ae290bb3788c900d
It basically infers valid Python expressions from type annotations (some sort
of inverse type checker
New submission from Douglas Raillard :
When creating a namedtuple such as this one:
from collections import namedtuple
class C(namedtuple('C', ('hello', 'world'))):
pass
print(C.__new__.__globals__)
The globals' dict of __new__ contain
13 matches
Mail list logo