Message1812

Author rajesh_battala
Recipients
Date 2007-08-30.07:35:29
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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
History
Date User Action Args
2008-02-20 17:17:57adminlinkissue1768969 messages
2008-02-20 17:17:57admincreate