[Tutor] Unbound Method Error

Steven D'Aprano steve at pearwood.info
Tue Apr 26 03:01:37 CEST 2011


Greg Nielsen wrote:

>     if isinstance(car, redracersprites26.BlueCarSprite()):
> TypeError: isinstance() arg 2 must be a class, type, or tuple of classes and
> types

Don't instantiate the class. Instead of

redracersprites26.BlueCarSprite()  # makes a new instance

just refer to the class object without calling it:

redracersprites26.BlueCarSprite


-- 
Steven


More information about the Tutor mailing list