Subclass str: where is the problem?

pascal.parent at free.fr pascal.parent at free.fr
Mon Apr 24 09:52:53 EDT 2006


This is good... try this:

value = 'test'
value
'test'
type(value)
<type 'str'>
value = type(value) is type('') and Upper(value) or value
value
'TEST'
type(value)
 <class '__main__.Upper'>

value = 1
value
1
type(value)
<type 'int'>
value = type(value) is type('') and Upper(value) or value
value
1
type(value)
<type 'int'>




More information about the Python-list mailing list