Why Nostr? What is Njump?
2024-11-08 17:30:38

AstraLuma on Nostr: Today in Python, I'm going to do dynamic class and metaclass stuff. It's going to be ...

Today in Python, I'm going to do dynamic class and metaclass stuff. It's going to be hilarious shenanigans.

But I'm having to be really clever, because:

* I want to avoid redundant-feeling declarations (registration decorator and required fields parent class)
* attrs might replace the class with a changeling
* I want static analysis to keep working

So far, I think I need a custom property descriptor, a metaclass, and some dynamic subclassing to make it work.

#Python
Author Public Key
npub190nxy95nad03cn3aqfjldj72kvw6n3pzny4mzuaczl3nsq8xfqaq9wr8sx