Message1812
def dis(x):
return x
class badstr(str):
pass
print "test subclass of str"
res = filter(dis, badstr("1234"))
print "res=", res
print "type=", type(res),"\n"
output:-
test subclass of str
res= 1234
type= <type 'str'>
when i run this above prog i got the same o/p both in Jython and Python
it returns base class type only instead of the Specific sub class type
can you comment on this !
thanks
|
|
Date |
User |
Action |
Args |
2008-02-20 17:17:57 | admin | link | issue1768969 messages |
2008-02-20 17:17:57 | admin | create | |
|