On 9/5/07, Daniel Larsson <[EMAIL PROTECTED]> wrote:
> Here's my two files again:
>
> # decorator.py
> import functools
>
> def simplelog(f):
> @functools.wraps(f)
> def new_f(*args, **kwds):
> print "Wrapper calling func"
> return f(*args, **kwds)
> return new_
The __module__ attribute is set, but the problem is the test in
doctest.py(DocTestFinder._from_module)
...
elif inspect.isfunction(object):
return module.__dict__ is object.func_globals
elif inspect.isclass(object):
return module.__name__ == object._
> En Tue, 04 Sep 2007 19:29:11 -0300, Daniel Larsson
> <[EMAIL PROTECTED]> escribi?:
>
>
>
> > On 9/5/07, Ferenczi Viktor <[EMAIL PROTECTED]> wrote:
>
> >> > > @functools.wraps(f)
> >> > > Pass the function to be wrapped by the decorator to the wraps
> >> function.
> >> > Ooops, right. That doesn't
On 9/5/07, Gabriel Genellina <[EMAIL PROTECTED]> wrote:
>
> En Tue, 04 Sep 2007 19:29:11 -0300, Daniel Larsson
> <[EMAIL PROTECTED]> escribi�:
>
> > On 9/5/07, Ferenczi Viktor <[EMAIL PROTECTED]> wrote:
> >>
> >> > > @functools.wraps(f)
> >> > > Pass the function to be wrapped by the decorator to t
En Tue, 04 Sep 2007 19:29:11 -0300, Daniel Larsson
<[EMAIL PROTECTED]> escribi�:
> On 9/5/07, Ferenczi Viktor <[EMAIL PROTECTED]> wrote:
>>
>> > > @functools.wraps(f)
>> > > Pass the function to be wrapped by the decorator to the wraps
>> function.
>> > Ooops, right. That doesn't change the fact
On 9/5/07, Ferenczi Viktor <[EMAIL PROTECTED]> wrote:
>
> > > @functools.wraps(f)
> > > Pass the function to be wrapped by the decorator to the wraps
> function.
> > Ooops, right. That doesn't change the fact that decorated functions get
> > hidden from doctest though.
I have no issue when the de
> > @functools.wraps(f)
> > Pass the function to be wrapped by the decorator to the wraps function.
> Ooops, right. That doesn't change the fact that decorated functions get
> hidden from doctest though.
Run my test script (one file) with the -v (verbose) option. Without the -v
option it does not
On 9/4/07, Ferenczi Viktor <[EMAIL PROTECTED]> wrote:
>
> > @functools.wraps
>
> Correctly:
>
> @functools.wraps(f)
>
> Pass the function to be wrapped by the decorator to the wraps function.
Ooops, right. That doesn't change the fact that decorated functions get
hidden from doctest though.
--
h
> @functools.wraps
Correctly:
@functools.wraps(f)
Pass the function to be wrapped by the decorator to the wraps function.
Regards, Viktor
--
http://mail.python.org/mailman/listinfo/python-list
On 9/4/07, Ferenczi Viktor <[EMAIL PROTECTED]> wrote:
>
> > I assume this is a FAQ, but I couldn't find much helpful information
> > googling. I'm having trouble with doctest skipping my functions, if I'm
> > using decorators (that are defined in a separate module). If I'm
> > understanding what is
> I assume this is a FAQ, but I couldn't find much helpful information
> googling. I'm having trouble with doctest skipping my functions, if I'm
> using decorators (that are defined in a separate module). If I'm
> understanding what is happening correctly, it's because doctest checks if
> the funct
11 matches
Mail list logo