Message205905
| Author |
filip.zyzniewski |
| Recipients |
BreamoreBoy, brian.curtin, daaku, filip.zyzniewski, georg.brandl, ncoghlan, steven.daprano, terry.reedy |
| Date |
2013年12月11日.13:25:49 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1386768349.32.0.164713986829.issue4037@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
It seems like there is also an issue with property classes defined in a different module.
In the example below Foo.x uses standard property, and Foo.y uses prop imported from the prop module.
This results in docstring for Foo.y to be missed:
filip@klocek:~/test$ cat prop.py
class prop(property):
pass
filip@klocek:~/test$ cat foo.py
from prop import prop
class Foo(object):
@property
def x(self):
"""
>>> Foo().x
'x'
"""
return 'x'
@prop
def y(self):
"""
>>> Foo().y
'y'
"""
return 'y'
filip@klocek:~/test$ python --version
Python 2.7.3
filip@klocek:~/test$ python -m doctest foo.py -v
Trying:
Foo().x
Expecting:
'x'
ok
2 items had no tests:
foo
foo.Foo
1 items passed all tests:
1 tests in foo.Foo.x
1 tests in 3 items.
1 passed and 0 failed.
Test passed.
filip@klocek:~/test$ python3 --version
Python 3.2.3
filip@klocek:~/test$ python3 -m doctest foo.py -v
Trying:
Foo().x
Expecting:
'x'
ok
2 items had no tests:
foo
foo.Foo
1 items passed all tests:
1 tests in foo.Foo.x
1 tests in 3 items.
1 passed and 0 failed.
Test passed.
filip@klocek:~/test$ |
|