471,350 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,350 software developers and data experts.

verify whether "str" is still callable in Python 2.5.1

hi Group:

Once use ActivePython latest version for Python 2.5.1.
I happened to find function "str" is not callable, but it is available
for Python 2.5.
Can anybody give some comments about it?
Any response is highly appreciated.

Thanks
Ge Chunyuan

Aug 13 '07 #1
3 1491
Ge Chunyuan wrote:
Once use ActivePython latest version for Python 2.5.1.
I happened to find function "str" is not callable, but it is available
for Python 2.5.
If it's not callable it's not the str() function, but something else with a
badly chosen variable name.
>>callable(str)
True
>>str = "yadda"
callable(str)
False

Peter
Aug 13 '07 #2
On Aug 13, 4:48 pm, Peter Otten <__pete...@web.dewrote:
Ge Chunyuan wrote:
Once use ActivePython latest version for Python 2.5.1.
I happened to find function "str" is not callable, but it is available
for Python 2.5.

If it's not callable it's not the str() function, but something else with a
badly chosen variable name.
>callable(str)
True
>str = "yadda"
callable(str)

False

Peter
oh, please forget my silly question.
you are absolutely right.

Aug 13 '07 #3
Ge Chunyuan <hh****@gmail.comwrote:
Once use ActivePython latest version for Python 2.5.1.
I happened to find function "str" is not callable, but it is available
for Python 2.5.
Can anybody give some comments about it?
I don't really understand what your asking. str is a callable, it has
always been AFAIK, since it's a type constructor, like int()

In [1]: callable(str)
Out[1]: True

In [2]: str()
Out[2]: ''
--
Lawrence, oluyede.org - neropercaso.it
"It is difficult to get a man to understand
something when his salary depends on not
understanding it" - Upton Sinclair
Aug 13 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Tuxtrax | last post: by
1 post views Thread by ScottyO | last post: by
8 posts views Thread by John Nagle | last post: by
1 post views Thread by bcwhite | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.