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
4c11f608
Commit
4c11f608
authored
Aug 30, 2004
by
Johannes Gijsbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #934356: if a module defines __all__, believe that rather than using
heuristics for filtering out imported names.
parent
d2a1aa4b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
Lib/pydoc.py
Lib/pydoc.py
+12
-4
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/pydoc.py
View file @
4c11f608
...
...
@@ -592,7 +592,9 @@ class HTMLDoc(Doc):
classes
,
cdict
=
[],
{}
for
key
,
value
in
inspect
.
getmembers
(
object
,
inspect
.
isclass
):
if
(
inspect
.
getmodule
(
value
)
or
object
)
is
object
:
# if __all__ exists, believe it. Otherwise use old heuristic.
if
(
all
is
not
None
or
(
inspect
.
getmodule
(
value
)
or
object
)
is
object
):
if
visiblename
(
key
,
all
):
classes
.
append
((
key
,
value
))
cdict
[
key
]
=
cdict
[
value
]
=
'#'
+
key
...
...
@@ -606,7 +608,9 @@ class HTMLDoc(Doc):
cdict
[
key
]
=
cdict
[
base
]
=
modname
+
'.html#'
+
key
funcs
,
fdict
=
[],
{}
for
key
,
value
in
inspect
.
getmembers
(
object
,
inspect
.
isroutine
):
if
inspect
.
isbuiltin
(
value
)
or
inspect
.
getmodule
(
value
)
is
object
:
# if __all__ exists, believe it. Otherwise use old heuristic.
if
(
all
is
not
None
or
inspect
.
isbuiltin
(
value
)
or
inspect
.
getmodule
(
value
)
is
object
):
if
visiblename
(
key
,
all
):
funcs
.
append
((
key
,
value
))
fdict
[
key
]
=
'#-'
+
key
...
...
@@ -1015,12 +1019,16 @@ class TextDoc(Doc):
classes
=
[]
for
key
,
value
in
inspect
.
getmembers
(
object
,
inspect
.
isclass
):
if
(
inspect
.
getmodule
(
value
)
or
object
)
is
object
:
# if __all__ exists, believe it. Otherwise use old heuristic.
if
(
all
is
not
None
or
(
inspect
.
getmodule
(
value
)
or
object
)
is
object
):
if
visiblename
(
key
,
all
):
classes
.
append
((
key
,
value
))
funcs
=
[]
for
key
,
value
in
inspect
.
getmembers
(
object
,
inspect
.
isroutine
):
if
inspect
.
isbuiltin
(
value
)
or
inspect
.
getmodule
(
value
)
is
object
:
# if __all__ exists, believe it. Otherwise use old heuristic.
if
(
all
is
not
None
or
inspect
.
isbuiltin
(
value
)
or
inspect
.
getmodule
(
value
)
is
object
):
if
visiblename
(
key
,
all
):
funcs
.
append
((
key
,
value
))
data
=
[]
...
...
Misc/NEWS
View file @
4c11f608
...
...
@@ -79,6 +79,9 @@ Extension modules
Library
-------
-
Patch
#
934356
:
if
a
module
defines
__all__
,
believe
that
rather
than
using
heuristics
for
filtering
out
imported
names
.
-
Patch
#
941486
:
added
os
.
path
.
lexists
(),
which
returns
True
for
broken
symlinks
,
unlike
os
.
path
.
exists
().
...
...
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