A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-August/068244.html below:

[Python-Dev] Type of range object members

[Python-Dev] Type of range object members [Python-Dev] Type of range object members"Martin v. Löwis" martin at v.loewis.de
Tue Aug 15 09:16:59 CEST 2006
Alexander Belopolsky wrote:
> The range object is currently defined in Objects/rangeobject.c as
> 
> typedef struct {
> 	PyObject_HEAD
> 	long	start;
> 	long	step;
> 	long	len;
> } rangeobject;
> 
> Is this consistent with PEP 353, or should Py_ssize_t be used instead of long?

As others have said: no. The range object produces ints. People have
asked to make it produce arbitrary longs instead, but none of these
patches ever got successfully reviewed.

> It looks like some of the code in rangeobject.c is already Py_ssize_t
> aware (see range_item and range_length), but it assumes that it is
> safe to cast long to ssize_t and back.

Where does it assume that it is safe to case ssize_t -> long?
That would be a bug.

Regards,
Martin
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4