By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,034 Members | 1,325 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,034 IT Pros & Developers. It's quick & easy.

verify whether "str" is still callable in Python 2.5.1

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.