Jaymon / pout

Python pretty print on steroids
MIT License
29 stars 0 forks source link

Switch Interface to use __init_subclass__ and module __getattr__ #91

Open Jaymon opened 3 months ago

Jaymon commented 3 months ago

Switch this to be similar to testdata. This would allow me to remove the Interface.inject methods and simplify the amount of startup pout needs until it's ready to go.

This would need two parts

  1. Add Interface.__init_subclass__ to record each of the Interface subclasses that get loaded into memory.
  2. Add pout.__init__.__getattr__ method that can use the Interface.instances that were recorded in __init_subclass__ and find the correct subclass to usefor the method that was called.

That should do it.