The closest is this (Observe that the casts of wrapper aren't needed should you make self posonly), but it breaks typing for self.funct. If you don't require that attribute or are OK with it getting perhaps incompatible https://allytech.net.in/courses/python-training-in-bangalore/