Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Libraries

    attrcheck 0.1.2

    Download button

    No screenshots available
    Downloads: 111  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Jun Namikawa | More programs
    ISC License / FREE
    October 11th, 2011, 19:54 GMT
    ROOT / Programming / Libraries

     Read user reviews (0)  Refer to a friend  Subscribe

    attrcheck description

    A simple attribution checker implemented as a decorator

    attrcheck is a Python module that provides a simple attribution checker implemented as a decorator. All functionality are provided as keyword arguments of the decorator.

    Sample example of usage is following:

     >>> from attrcheck import attrcheck
     >>> @attrcheck(x=['real'], y=['index', 'strip'], z=dir(list))
     >>> def foo(x, y, z=[]): pass


    The code above means the following:

     >>> def foo(x, y, z=[]):
     >>> if not hasattr(x, 'real'):
     >>> raise AttributeError
     >>> if not hasattr(y, 'index'):
     >>> raise AttributeError
     >>> if not hasattr(y, 'strip'):
     >>> raise AttributeError
     >>> for name in dir(list):
     >>> if not hasattr(z, name):
     >>> raise AttributeError


    In addition, attrcheck can check default argument values. Thus, the following code throws AttributeError.

     >>> @attrcheck(y=dir(str))
     >>> def bar(x, y=[]): pass



    Product's homepage

    Requirements:

    · Python

      


    TAGS:

    attribution checker | Python library | attribution | checker | decorator

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

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