File: _functools_dummy.py

package info (click to toggle)
espresso 6.7-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 311,068 kB
  • sloc: f90: 447,429; ansic: 52,566; sh: 40,631; xml: 37,561; tcl: 20,077; lisp: 5,923; makefile: 4,503; python: 4,379; perl: 1,219; cpp: 761; fortran: 618; java: 568; awk: 128
file content (22 lines) | stat: -rw-r--r-- 666 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'''
testcode2._dummy_functools
--------------------------

Dummy stub functions of required functools objects used.

This means that we can use python 2.4 and advanced features in later versions
of python.

:copyright: (c) 2012 James Spencer.
:license: modified BSD; see LICENSE for more details.
'''

def wraps(func1):
    '''Upgrade from python 2.4 to use functools.wraps.'''
    def wrapper(func2):
        '''Upgrade from python 2.4 to use functools.wraps.'''
        def decorated_func(*args, **kwargs):
            '''Upgrade from python 2.4 to use functools.wraps.'''
            return func2(*args, **kwargs)
        return decorated_func
    return wrapper