This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: parameters for int(), str(), etc.
Type: Stage:
Components: Documentation Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: aahz, rhettinger
Priority: normal Keywords:

Created on 2002-12-30 15:47 by aahz, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
libfuncs.diff rhettinger, 2003-01-02 04:31 Patch to docs
Messages (3)
msg13704 - (view) Author: Aahz (aahz) * (Python triager) Date: 2002-12-30 15:47
The built-in functions int(), str(), float(), long() are documented as
requiring a parameter, but the type/class unification has changed them
so that they return a false object without a parameter:

>>> int()
0
>>> str()
''
>>> float()
0.0
>>> long()
0L
msg13705 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-01-02 04:31
Logged In: YES 
user_id=80475

There are a lot of these:
[(0, False), (0.0, False), (0j, False), (0L, False), ((), False), 
([], False), ({}, False), ('', False), (u'', False)]

See attached doc patch. Also, consider adding a 
\versionchanged tag and changing the doc strings.

BTW, I think it is more complete and accurate to say that 
the contructors return an empty container or zero than it 
is to just say that bool(constructor()) is False.

msg13706 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-06-11 08:16
Logged In: YES 
user_id=80475

Fixed.  See Doc/lib/libfuncs.tex 1.135
History
Date User Action Args
2022-04-10 16:06:04adminsetgithub: 37662
2002-12-30 15:47:25aahzcreate