[issue2417] [py3k] Integer floor division (//): small int check omitted

2008-07-24 Thread Facundo Batista

Facundo Batista [EMAIL PROTECTED] added the comment:

Commited in r65220.

Thank you everybody!!

--
resolution:  - fixed
status: open - closed

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2417
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2417] [py3k] Integer floor division (//): small int check omitted

2008-07-23 Thread Antoine Pitrou

Changes by Antoine Pitrou [EMAIL PROTECTED]:


--
nosy: +pitrou
priority:  - normal

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2417
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2417] [py3k] Integer floor division (//): small int check omitted

2008-07-23 Thread Facundo Batista

Facundo Batista [EMAIL PROTECTED] added the comment:

Alexander, tried the issue2417a.diff patch against 65210, and does not
apply cleanly, could you please submit an updated one?

Thanks!

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2417
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2417] [py3k] Integer floor division (//): small int check omitted

2008-07-23 Thread Alexander Belopolsky

Alexander Belopolsky [EMAIL PROTECTED] added the comment:

It looks like e-mail submission did not work.  Uploading updated patch as 
issue2417b.diff .

Added file: http://bugs.python.org/file10962/issue2417b.diff

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2417
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2417] [py3k] Integer floor division (//): small int check omitted

2008-03-19 Thread Duncan Booth

Changes by Duncan Booth [EMAIL PROTECTED]:


--
nosy: +duncanb

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2417
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2417] [py3k] Integer floor division (//): small int check omitted

2008-03-19 Thread Alexander Belopolsky

Alexander Belopolsky [EMAIL PROTECTED] added the comment:

I agree this is a bug.  Here is a related problem:

 1 is divmod(1,1)[0]
False

--
nosy: +belopolsky

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2417
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2417] [py3k] Integer floor division (//): small int check omitted

2008-03-19 Thread Alexander Belopolsky

Alexander Belopolsky [EMAIL PROTECTED] added the comment:

 int('1') is 1
False
 1 is int('0b1', 2)
False
 1 is 0b1  4
False

there are probably more ...

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2417
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2417] [py3k] Integer floor division (//): small int check omitted

2008-03-19 Thread Facundo Batista

Facundo Batista [EMAIL PROTECTED] added the comment:

I really don't understand *why* it's a bug.

Is anywhere in the Language Reference that says that 1 should be the
same object that another 1?

Or do you mean that they *should* be the same object for speed and/or
memory reasons? In this case... is this a bug? Or a request for
improvement or something?

--
nosy: +facundobatista

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2417
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2417] [py3k] Integer floor division (//): small int check omitted

2008-03-19 Thread Adam Olsen

Adam Olsen [EMAIL PROTECTED] added the comment:

The original bug is not whether or not python reuses int objects, but
rather that an existing optimization disappears under certain
circumstances.  Something is breaking our optimization.

The later cases where the optimization is simply gone in 3.0a3 are more
difficult.  We don't *have* to keep them.. but we probably want them. 
The small int reuse happens for a reason.

--
nosy: +Rhamphoryncus

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2417
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2417] [py3k] Integer floor division (//): small int check omitted

2008-03-19 Thread Terry J. Reedy

Terry J. Reedy [EMAIL PROTECTED] added the comment:

I agree that this is not a bug in the strict sense.  I could have
selected Type: resource usage (for memory increase).  But the change of
behavior is also visible.  I suspect the change is not intentional both
because of the pattern and because of recent discussion on PyDev that
small int caching should be kept.

If the precise change is intentional, this should be documented (here)
to answer further questions on c.l.p.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2417
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2417] [py3k] Integer floor division (//): small int check omitted

2008-03-19 Thread Alexander Belopolsky

Alexander Belopolsky [EMAIL PROTECTED] added the comment:

Attached patch fixes the cases discovered so far.  It is possible that 
in some of these cases creation of the long object that is later 
discarded can be avoided by detecting small int return early, but such 
optimizations should probably be left for later.

Any advise on how to write a unit test?  Should the unit test detect 
python compiled with NSMALLNEGINTS + NSMALLPOSINTS == 0 and disable 
identity checks?

--
keywords: +patch
Added file: http://bugs.python.org/file9776/issue2417.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2417
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2417] [py3k] Integer floor division (//): small int check omitted

2008-03-19 Thread Adam Olsen

Adam Olsen [EMAIL PROTECTED] added the comment:

Unless someone has a legitimate use case for disabling small_int that
doesn't involve debugging (which I really doubt), I'd just assume it's
always in use.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2417
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2417] [py3k] Integer floor division (//): small int check omitted

2008-03-19 Thread Alexander Belopolsky

Alexander Belopolsky [EMAIL PROTECTED] added the comment:

Attached (issue2417a.diff) patch adds unit tests and fixes a few corner 
cases when a non-preallocated 0 was returned to python.

Added file: http://bugs.python.org/file9785/issue2417a.diff

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2417
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2417] [py3k] Integer floor division (//): small int check omitted

2008-03-18 Thread Terry J. Reedy

Changes by Terry J. Reedy [EMAIL PROTECTED]:


--
title: Integer floor division (//): small int check omitted - [py3k] Integer 
floor division (//): small int check omitted

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2417
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com