On Tue, Aug 31, 2010 at 08:27:10AM +0200, Peter Otten wrote: > Subclasses of immutable types, e. g. tuple:
That was one great example, thanks. Some doubts, a. I have seen this cls before, what does it mean? b. What does type(_) mean? Thanks a lot in advance. With warm regards, -Payal -- > >>> class A(tuple): > ... def __new__(cls, a, b): > ... return tuple.__new__(cls, (a, b)) > ... > >>> A(1, 2) > (1, 2) > >>> type(_) > <class '__main__.A'> > > Peter > > _______________________________________________ > Tutor maillist - [email protected] > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
