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/2001-April/014351.html below:

Experimental Number Types (Integer, Rational, Floats)

[Python-Dev] ANN: Experimental Number Types (Integer, Rational, Floats)M.-A. Lemburg mal@lemburg.com
Thu, 19 Apr 2001 22:25:50 +0200
Michael Hudson wrote:
> 
> Before I d/l and take a look...
> 
> "M.-A. Lemburg" <mal@lemburg.com> writes:
> 
> > (e.g. Integer(2) + "3" works as one would expect ;-).
> 
> So it raises an exception?  Seriously, that's what *I'd* expect, and
> if it's not what your package does, I beg you to reconsider.

Integer(2) + "3" gives you Integer(5). This is a side-effect
of how the implementation converts arbitrary objects into ones
usable for coercion: Integer(2) + "3" is interpreted as 
Integer(2) + Integer("3") which gives Integer(2) + Integer(3).

After having played with it for a while, I must say, that I
kind of like it :-)

-- 
Marc-Andre Lemburg
______________________________________________________________________
Company & Consulting:                           http://www.egenix.com/
Python Pages:                           http://www.lemburg.com/python/



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