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/068302.html below:

[Python-Dev] Type of range object members

[Python-Dev] Type of range object members [Python-Dev] Type of range object membersGuido van Rossum guido at python.org
Wed Aug 16 16:51:16 CEST 2006
On 8/15/06, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> Greg Ewing schrieb:
> > Martin v. Löwis wrote:
> >> We had this discussion before; if you use ob_size==0 to indicate
> >> that it's an int, this space isn't needed in a long int.
> >
> > What about int subclasses?
>
> It's what Guido proposes.
>
> It would still leave two types (perhaps three) at the C level,
> so C code might have to continue making conditional code depending
> on which of these it is. Also, Python code that dispatches by type
> still needs to make the distinction.

I'm not sure that subclassing ints gives us much. We could make int
and long "final" types, and then all we have to do is tweak type() and
__class__ so that they always return the 'int' type.

Alternatively, yes, there would be some minimal awareness of the two
types in Python -- but nothing like we currently have; dispatching on
exact type (which we discourage anyway) would be the only case. Would
that be so bad?

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
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