Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
edd9b0df
Commit
edd9b0df
authored
Jul 29, 2006
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1441397: The compiler module now recognizes module and function
docstrings correctly as it did in Python 2.4.
parent
9fd21e31
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
Lib/compiler/transformer.py
Lib/compiler/transformer.py
+1
-0
Lib/test/test_compiler.py
Lib/test/test_compiler.py
+8
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/compiler/transformer.py
View file @
edd9b0df
...
...
@@ -1382,6 +1382,7 @@ _doc_nodes = [
symbol
.
testlist
,
symbol
.
testlist_safe
,
symbol
.
test
,
symbol
.
or_test
,
symbol
.
and_test
,
symbol
.
not_test
,
symbol
.
comparison
,
...
...
Lib/test/test_compiler.py
View file @
edd9b0df
...
...
@@ -68,6 +68,14 @@ class CompilerTest(unittest.TestCase):
def
testDefaultArgs
(
self
):
self
.
assertRaises
(
SyntaxError
,
compiler
.
parse
,
"def foo(a=1, b): pass"
)
def
testDocstrings
(
self
):
c
=
compiler
.
compile
(
'"doc"'
,
'<string>'
,
'exec'
)
self
.
assert_
(
'__doc__'
in
c
.
co_names
)
c
=
compiler
.
compile
(
'def f():
\
n
"doc"'
,
'<string>'
,
'exec'
)
g
=
{}
exec
c
in
g
self
.
assertEquals
(
g
[
'f'
].
__doc__
,
"doc"
)
def
testLineNo
(
self
):
# Test that all nodes except Module have a correct lineno attribute.
filename
=
__file__
...
...
Misc/NEWS
View file @
edd9b0df
...
...
@@ -52,6 +52,9 @@ Core and builtins
Library
-------
-
Bug
#
1441397
:
The
compiler
module
now
recognizes
module
and
function
docstrings
correctly
as
it
did
in
Python
2.4
.
-
Bug
#
1529297
:
The
rewrite
of
doctest
for
Python
2.4
unintentionally
lost
that
tests
are
sorted
by
name
before
being
run
.
This
rarely
matters
for
well
-
written
tests
,
but
can
create
baffling
symptoms
if
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment