instance name for getting and setting this can all be done using metaclass here is an example of class that uses this conventionclass product(metaclass=autoslotproperties)def __init__(selfbarcodedescription)self __barcode barcode self description description def get_barcode(self)return self __barcode def get_description(self)return self __description def set_description(selfdescription)if description is none or len(description self __description "elseself __description description we must assign to the private __barcode property in the initializer since there is no setter for itanother consequence of this is that barcode is read-only property on the other handdescription is readable/writable property here are some examples of interactive useproduct product(" "" mm stapler"product barcodeproduct description (' '' mm stapler'product description " mm stapler (long)product barcodeproduct description (' '' mm stapler (long)'if we attempt to assign to the bar code an attributeerror exception is raised with the error text "can' set attributeif we look at the product class' attributes ( using dir())the only public ones to be found are barcode and description the get_name(and set_name(methods are no longer there--they have been replaced with the name property and the variables holding the bar code and description are also private (__barcode and __description)and have been added as slots to minimize the class' memory use this is all done by the autoslotproperties metaclass which is implemented in single methodclass autoslotproperties(type)def __new__(mclclassnamebasesdictionary)slots list(dictionary get("__slots__"[])