[Q] Type checking...

Olivier Deckmyn olivier.deckmyn at mail.dotcom.fr
Mon Jul 19 06:49:36 EDT 1999


Hi !

Abstract : [Q]How to check the type of an instance before(after?) sending it
to a method...

Here is my source :

class ClassA
...


class ClassB :
   def myMethod(self, anInstance)
...

and myMethod expects that anInstance is a ClassA !
How can I force my user to send only instances of this class (or subclasses)
?

Thx !










More information about the Python-list mailing list