5/06/2008

the next interesting thing about types in Python::

>>> type(string)

>>> type(string.punctuation)

>>> type(string.join)

>>> callable(string.punctuation)
False
>>> callable(str)
True
>>> type(str)

>>> type(dir)

>>> type(type)
-- note! - type for "type" - is type))
>>> type(string.punctuation.isdigit)

>>> type(builtin_function_or_method)

Traceback (most recent call last):
File "", line 1, in
type(builtin_function_or_method)
NameError: name 'builtin_function_or_method' is not defined
-
- and type for "builtin function" is not defined))

>>>

1 коментар:

Traut сказав...

http://out.com.ua/blog/2007/12/20/faint-echo-of-waltz/

:)