[issue11099] Bytes pickled with 3.1 not unpickled with 2.7 correctly

2011-02-02 Thread Jeffrey Harper
New submission from Jeffrey Harper jhar...@yapdc.com: When a bytes object is pickled with 3.1 and then unpickled with 2.7, the results are incorrect. The example below shows that pickling b'abcdefg' in 3.1 and then unpickling in 2.7 produces the string '[97L, 98L, 99L, 100L, 101L, 102L, 103L

[issue11244] Negative tuple elements produce inefficient code.

2011-02-18 Thread Jeffrey Harper
New submission from Jeffrey Harper jhar...@yapdc.com: In Python 3.2, a tuple like (1,-2,3) will not be optimized into a constants at compile time. The tuple is built at run-time. Earlier versions of Python optimized these tuples at compile time. Here's an example program. # test.py from

[issue11244] Negative tuple elements produce inefficient code.

2011-02-18 Thread Jeffrey Harper
Jeffrey Harper jhar...@yapdc.com added the comment: I have also determined that negative elements interfere with the frozenset optimization described in issue6690. http://bugs.python.org/issue6690. Here's an example program: # test.py from dis import dis def x(var): return var in {1,2,3

[issue11244] Negative tuple elements produce inefficient code.

2011-02-18 Thread Jeffrey Harper
Jeffrey Harper jhar...@yapdc.com added the comment: I think r82043 may also explain why 3.1.3 can fold the expression 2 * -3 into -6 while 3.2rc3 cannot. # test.py from dis import dis def y(): 2 * -3 print(dis y:) dis(y) C:\tmpc:\Python32\python.exe --version Python 3.2rc3 C:\tmpc

[issue11244] Negative tuple elements produce inefficient code.

2011-02-18 Thread Jeffrey Harper
Jeffrey Harper jhar...@yapdc.com added the comment: Here's a patch against the version of test_peepholer.py in 3.2rc3. It verifies that expressions like the following are optimized: 3*-4 (1,-2,3) a in {1,-2,3) -- keywords: +patch Added file: http://bugs.python.org/file20787

[issue15251] new.code and new.function crashes Python iterpretter

2012-07-04 Thread Jeffrey Harper
New submission from Jeffrey Harper jeff1.61...@gmail.com: I've attached a script that crashes the Python interpreter. I can get the crash to occur under Windows Vista with this version of Python: C:\tmp\remotec:\Python27\python.exe Python 2.7.1 Stackless 3.1b3 060516 (release27-maint, Jan 1

[issue15251] new.code and new.function crashes Python iterpretter

2012-07-04 Thread Jeffrey Harper
Jeffrey Harper jeff1.61...@gmail.com added the comment: The marshal loads and dumps don't seem to be necessary to reproduce the crash. On both the Windows Vista and Ubuntu Linux systems, the crash still occurred when I replaced: mcopy_code = loads(dumps(code)) with: mcopy_code = code

[issue15251] new.code and new.function crashes Python iterpretter

2012-07-04 Thread Jeffrey Harper
Jeffrey Harper jeff1.61...@gmail.com added the comment: Martin, Thanks for your response. I didn't know it was possible to pass freevars and cellvars to new.code. I think the documentation needs to be updated. The documentation for 2.7.3 located at http://docs.python.org/library/new.html