Re: [Python-Dev] constant folding of -0

2011-03-10 Thread Mark Dickinson
On Thu, Mar 10, 2011 at 2:17 AM, Eugene Toder elto...@gmail.com wrote: Indeed, see http://bugs.python.org/issue11244 Yes, I've noticed that too. However, if I'm not missing something, your patches do not address folding of -0. Hmm, it seems that way. Could you post a comment on the tracker

Re: [Python-Dev] constant folding of -0

2011-03-10 Thread Eugene Toder
I've posted a patch. Eugene On Thu, Mar 10, 2011 at 3:30 PM, Mark Dickinson dicki...@gmail.com wrote: On Thu, Mar 10, 2011 at 2:17 AM, Eugene Toder elto...@gmail.com wrote: Indeed, see http://bugs.python.org/issue11244 Yes, I've noticed that too. However, if I'm not missing something, your

Re: [Python-Dev] constant folding of -0

2011-03-10 Thread Antoine Pitrou
On Thu, 10 Mar 2011 02:17:34 + (UTC) Eugene Toder elto...@gmail.com wrote: Indeed, see http://bugs.python.org/issue11244 Yes, I've noticed that too. However, if I'm not missing something, your patches do not address folding of -0. Btw, there's an alternative approach to allow

Re: [Python-Dev] constant folding of -0

2011-03-10 Thread Eugene Toder
Well, that was just a though. You're right that long runs of constants can appear, and it's better to avoid pathological behaviour in such cases. Your second path looks good. Eugene On Thu, Mar 10, 2011 at 6:30 PM, Antoine Pitrou solip...@pitrou.net wrote: On Thu, 10 Mar 2011 02:17:34 +

[Python-Dev] constant folding of -0

2011-03-09 Thread Eugene Toder
Hello, I've noticed since version 3.2 python doesn't fold -0: Python 3.1.3 (r313:86834, Nov 28 2010, 10:01:07) def foo(): return -0 dis(foo) 1 0 LOAD_CONST 1 (0) 3 RETURN_VALUE Python 3.2 (r32:88445, Feb 20 2011, 21:30:00) def foo(): return -0

Re: [Python-Dev] constant folding of -0

2011-03-09 Thread Antoine Pitrou
Hello, I've noticed since version 3.2 python doesn't fold -0: Indeed, see http://bugs.python.org/issue11244 Regards Antoine. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

Re: [Python-Dev] constant folding of -0

2011-03-09 Thread Eugene Toder
Indeed, see http://bugs.python.org/issue11244 Yes, I've noticed that too. However, if I'm not missing something, your patches do not address folding of -0. Btw, there's an alternative approach to allow recursive constant folding. Instead of keeping a stack of last constants, you can keep a