[Python-Dev] Re: Int FutureWarnings and other 2.4 TODOs (original) (raw)
Neil Schemenauer nas-python at python.ca
Thu Dec 4 19:02:17 EST 2003
- Previous message: [Python-Dev] Re: Int FutureWarnings and other 2.4 TODOs
- Next message: [Python-Dev] Re: Int FutureWarnings and other 2.4 TODOs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Dec 04, 2003 at 03:54:21PM +1300, Greg Ewing wrote:
Does anyone have a real-life use case for subclassing int?
Not me. Dylan does not allow it's concrete numeric classes to be subclassed. That allows efficient method dispatch given restrictive enough declarations. Here is the standard numberic classes:
class number(object):
# Open Abstract Class
class complex(number):
# Sealed Abstract Class
class real(complex):
# Sealed Abstract Class
class float(real):
# Sealed Abstract Class
class single_float(float)
# Sealed Class
class double_float(float)
# Sealed Class
class rational(real):
# Sealed Abstract Class
class integer(rational):
# Sealed Class
complex is sealed which basically means that it cannot be subclassed by users. That allows Sealing is described here: http://www.gwydiondylan.org/drm/drm_70.htm.
The language reference does not describe a "long" integer type but the implementation is free to provide one.
Neil
- Previous message: [Python-Dev] Re: Int FutureWarnings and other 2.4 TODOs
- Next message: [Python-Dev] Re: Int FutureWarnings and other 2.4 TODOs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]