added the required object derivation to the main descriptor classes for compatibility (they can be omitted for code to be run in onlybut don' hurt in xand aid portability if present)file validate_descriptors pyusing shared descriptor state class cardholder(object)acctlen retireage def __init__(selfacctnameageaddr)self acct acct self name name self age age self addr addr need all "(object)in only class data instance data these trigger __set__ calls too__x not neededin descriptor addr is not managed remain has no data class name(object)def __get__(selfinstanceowner)class namescardholder locals return self name def __set__(selfinstancevalue)value value lower(replace('' 'self name value name name(class age(object)def __get__(selfinstanceowner)return self age def __set__(selfinstancevalue)if value raise valueerror('invalid age'elseself age value age age(class acct(object)def __get__(selfinstanceowner)return self acct[:- '***def __set__(selfinstancevalue)value value replace('-'''if len(value!instance acctlenraise typeerror('invald acct number'elseself acct value acct acct(class remain(object)def __get__(selfinstanceowner)return instance retireage instance age def __set__(selfinstancevalue)raise typeerror('cannot set remain'remain remain( managed attributes use descriptor data use instance class data triggers age __get__ else set allowed here