Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Libraries

    Metatools 0.1

    Download button

    No screenshots available
    Downloads: 45  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Kevin L. Mitchell | More programs
    GPL / FREE
    February 14th, 2012, 13:07 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    Metatools description

    Python Metaclass Construction Tools

    Metatools is a Python module that contains the metatools module, which provides a utility class (MetaClass) which metaclasses can extend. It provides three static methods (available only on classes inheriting from MetaClass; they will not clutter up your actual classes) which can be used to enhance inheritance.

    The most important of these static methods is the iter_bases() method. When passed a list of base classes, such as those passed to the __new__() method, it generates a list of the superclasses in proper Python Method Resolution Order. This can be used with the inherit_dict() and inherit_set() static methods.

    Both inherit_dict() and inherit_set() have similar interfaces. When passed a base class, the dictionary for the class being constructed, and the name of an attribute containing the dictionary or set which should have inheritance rules applied, they look up the attribute in both the base class and in the namespace dictionary, then walk through all entries in the base class's version; if the entry does not currently exist in the namespace's version of that dictionary or set, then it is automatically added. Both routines return a list of items added, if the metaclass needs to perform any additional post-processing on the entries. The items may also be filtered by passing a callable returning True or False as the inherit parameter to the routines. Additionally, if inherit is False or None (or any other value that tests as False), then the items are not automatically added to the dictionary or set, but are still provided in the list of returned items.


    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    metaclass construction | Python library | Python | metaclass | construction



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM