[issue19049] itertools.tee isn't 64-bit compliant

2013-09-19 Thread Antoine Pitrou

New submission from Antoine Pitrou:

itertools.tee uses ints rather than Py_ssize_t for indices. Using Py_ssize_t 
would not make the object bigger, since other fields will already be 
pointer-aligned.

--
messages: 198049
nosy: pitrou, rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: itertools.tee isn't 64-bit compliant
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19049
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19049] itertools.tee isn't 64-bit compliant

2013-09-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Simple patch attached.

--
keywords: +patch
Added file: http://bugs.python.org/file31814/tee_64b.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19049
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19049] itertools.tee isn't 64-bit compliant

2013-09-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't think we need Py_ssize_t for integers from 0 to 57.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19049
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19049] itertools.tee isn't 64-bit compliant

2013-09-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 I don't think we need Py_ssize_t for integers from 0 to 57.

IMO it's better to use Py_ssize_t there, since it can get combined with
other Py_ssize_t values. Avoiding spurious conversions eliminates a
common source of errors. We don't gain anything by keeping it as an int.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19049
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19049] itertools.tee isn't 64-bit compliant

2013-09-19 Thread Antoine Pitrou

Antoine Pitrou added the comment:

 I doubt we should change this.

Currently itertools.tee() will break if more than 2**31 elements are
saved in the inner structures. I certainly think it should be fixed,
rather than bite someone by surprise one day.

 However in any case you forgot about tee_reduce().

Will take a look.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19049
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19049] itertools.tee isn't 64-bit compliant

2013-09-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

We gain stability.

I doubt we should change this. However in any case you forgot about 
tee_reduce().

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19049
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com