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

[Python-Dev] str with base

[Python-Dev] str with baseAahz aahz at pythoncraft.com
Tue Jan 17 18:04:47 CET 2006
On Mon, Jan 16, 2006, Alex Martelli wrote:
>
> Is it finally time in Python 2.5 to allow the "obvious" use of, say,  
> str(5,2) to give '101', just the converse of the way int('101',1)  
> gives 5?  I'm not sure why str has never allowed this obvious use --  
> any bright beginner assumes it's there and it's awkward to explain  
> why it's not!-).  I'll be happy to propose a patch if the BDFL  
> blesses this, but I don't even think it's worth a PEP... it's an  
> inexplicable though long-standing omission (given the argumentative  
> nature of this crowd I know I'll get pushback, but I still hope the  
> BDFL can Pronounce about it anyway;-).

-1

I agree with all the other comments about the functional asymmetry
between int() and str() in the Python universe, and that therefore str()
shouldn't necessarily mimic int()'s API.  Propose some other mechanism;
I so far haven't seen a good reasons to prefer any of the ones already
proposed.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"19. A language that doesn't affect the way you think about programming,
is not worth knowing."  --Alan Perlis
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