• Login or register

discuss.effbot.org

  • Popular
  • Recent
  • Using Metaclasses to Create Self-Registering Plugins (effbot.org)
    2 points by effbot 11 months ago
    • 2 comments
  • 1 point by benjhayden 8 months ago 0 children

    You forgot to pass 'cls' to type.__init__.
    http://code.google.com/p/benjhayden/source/browse/trunk/plugins.py

    • link
    • reply
  • 1 point by holdenweb 11 months ago 0 children

    Nice example! Most use an external class separately bound by assignment. Defining the __metaclass__ class inside the Plugin base class actually makes the example more meaningful (IMHO).

    • link
    • reply
  • Widget
  • Recent Comments
  • Leaders
Powered by