Bruno Cauet added the comment:
Serhiy, that sounds good but I think that you have forgotten to attach the
mentioned patch.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18032
Bruno Cauet added the comment:
I'm not sure how you can have both, those two seem opposite to me:
- if 'from_bytes' returns the same type as the class it is called on then
the instantiation of the result object should go through its constructor
(patch proposed)
- if the subclass should override
Bruno Cauet added the comment:
Hi,
I feel like this behaviour does not only affect IntEnum related but anything
that inherits from int.
Example:
class foo(int):
... def __init__(self, value, base=10):
... if value == 2:
... raise ValueError
Bruno Cauet added the comment:
I took the liberty of putting together a small patch which makes from_bytes()
call return type(value_found) if type != long (Serhiy's my 2nd solution).
Ethan: in that case, type.from_bytes() would always return an int, and not
resort to build-a-pseudo-int
Bruno Cauet added the comment:
Here is a working test, testing yield by lambda function as well as lambda
and function yielding from those.
--
Added file:
http://bugs.python.org/file38440/0001-Add-tests-for-issue-23192.patch
___
Python tracker rep
Bruno Cauet added the comment:
Here are the operations being emitted (line, macro used and eventual argument):
f = lambda: (yield 5)
3487: ADDOP_O LOAD_CONST e-v.Num.n
3472: ADDOP YIELD_VALUE
1907: ADDOP_IN_SCOPE POP_TOP
4349: ADDOP_O LOAD_CONST Py_None
4350: ADDOP RETURN_VALUE
1457: ADDOP_O
Changes by Bruno Cauet brunoca...@gmail.com:
Added file:
http://bugs.python.org/file38299/0002-lambda-generator-fix-try-to-add-a-dis-test.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23192
Bruno Cauet added the comment:
There's a small typo in the comments:
+# make sure cmd.link_objects is turned into a list
+# is it's a string
Should be:
+# make sure cmd.link_objects is turned into a list
+# if it's a string
--
nosy: +bru
Bruno Cauet added the comment:
Here is a simple fix for the issue, plus a test.
It does not break any unit test but this raises a backwards-compatibility
problem. Therefore I wouldn't advise using it for Python 3.4 but only 3.5+.
--
keywords: +patch
nosy: +bru
versions: +Python 3.5
Bruno Cauet added the comment:
Here is an updated patch based on Dustin's work with Josh's comments. I also
added a test which takes forever on an unpatched python interpreter.
Since it's a performance issue, I've benchmarked the results. They don't change
for the most part (argument is a set
10 matches
Mail list logo