A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-January/059800.html below:

[Python-Dev] str with base

[Python-Dev] str with baseAlex Martelli aleaxit at gmail.com
Tue Jan 17 05:25:54 CET 2006
On Jan 16, 2006, at 8:03 PM, Jeremy Hylton wrote:

> It never occured to me that str() would behave like int() for this
> case.  It makes complete sense to me that a factory for numbers would
> ask about the base of the number.  What would the base of a string be,
> except in a few limited cases? str([1, 2], 4) doesn't make any sense.
> You might argue that I wasn't all that bright as a beginner <0.5
> wink>.
>
> I think it shouldn't be changed, because the second positional
> argument only works for a small number of the panoply types that can
> be passed to str().

Identically the same situation as for int: the base argument is only  
accepted if the first argument is a str (not a float, etc).  Just the  
same way, the base argument to str will only be accepted if the first  
argument is an int (not a float, etc).


Alex

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