B
Berthold =?iso-8859-15?Q?H=F6llmann?=
Saving the following code to a file and running the code through
python does not give the expected error. disableling the "@decor" line
leads to the expected error message. Is this a bug or an overseen
feature?
--- snip dectest.py ---
class decor(object):
def __init__(self, f):
self.f = f
def __call__(self, *args, **kw):
return self.f(*args, **kw)
@decor
def f(a, b):
""" False
"""
return a == b
def _test():
import doctest
doctest.testmod()
if __name__ == "__main__":
_test()
--- snip dectest.py ---
Our Python is:
Python 2.4.2 (#1, Dec 5 2005, 10:13:23)
[GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Thanks
Berthold
python does not give the expected error. disableling the "@decor" line
leads to the expected error message. Is this a bug or an overseen
feature?
--- snip dectest.py ---
class decor(object):
def __init__(self, f):
self.f = f
def __call__(self, *args, **kw):
return self.f(*args, **kw)
@decor
def f(a, b):
""" False
"""
return a == b
def _test():
import doctest
doctest.testmod()
if __name__ == "__main__":
_test()
--- snip dectest.py ---
Our Python is:
Python 2.4.2 (#1, Dec 5 2005, 10:13:23)
[GCC 3.3.5 20050117 (prerelease) (SUSE Linux)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Thanks
Berthold