[issue18032] Optimization for set/frozenset.issubset()

2014-11-27 Thread Bruno Cauet
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 mos

[issue1703178] link_objects in setup.cfg crashes build

2014-12-09 Thread Bruno Cauet
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 --

[issue23017] string.printable.isprintable() returns False

2014-12-09 Thread Bruno Cauet
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: +Pytho

[issue18032] Optimization for set/frozenset.issubset()

2015-05-27 Thread Bruno Cauet
Bruno Cauet added the comment: Serhiy, that sounds good but I think that you have forgotten to attach the mentioned patch. -- ___ Python tracker <http://bugs.python.org/issue18

[issue23192] Generator return value ignored in lambda function

2015-03-02 Thread Bruno Cauet
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 RETUR

[issue23192] Generator return value ignored in lambda function

2015-03-02 Thread Bruno Cauet
Changes by Bruno Cauet : Added file: http://bugs.python.org/file38299/0002-lambda-generator-fix-try-to-add-a-dis-test.patch ___ Python tracker <http://bugs.python.org/issue23

[issue23192] Generator return value ignored in lambda function

2015-03-11 Thread Bruno Cauet
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 tra

[issue23640] Enum.from_bytes() is broken

2015-03-12 Thread Bruno Cauet
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 ValueEr

[issue23640] Enum.from_bytes() is broken

2015-03-12 Thread Bruno Cauet
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

[issue23640] Enum.from_bytes() is broken

2015-03-30 Thread Bruno Cauet
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