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
7837a968
Commit
7837a968
authored
15 years ago
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use true kwonly arg instead of **kwds hackaround.
parent
5dbb84a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
14 deletions
+2
-14
Lib/pstats.py
Lib/pstats.py
+2
-14
No files found.
Lib/pstats.py
View file @
7837a968
...
...
@@ -70,20 +70,8 @@ class Stats:
print_stats(5).print_callers(5)
"""
def
__init__
(
self
,
*
args
,
**
kwds
):
# I can't figure out how to explictly specify a stream keyword arg
# with *args:
# def __init__(self, *args, stream=sys.stdout): ...
# so I use **kwds and sqauwk if something unexpected is passed in.
self
.
stream
=
sys
.
stdout
if
"stream"
in
kwds
:
self
.
stream
=
kwds
[
"stream"
]
del
kwds
[
"stream"
]
if
kwds
:
keys
=
kwds
.
keys
()
keys
.
sort
()
extras
=
", "
.
join
([
"%s=%s"
%
(
k
,
kwds
[
k
])
for
k
in
keys
])
raise
ValueError
(
"unrecognized keyword args: %s"
%
extras
)
def
__init__
(
self
,
*
args
,
stream
=
None
):
self
.
stream
=
stream
or
sys
.
stdout
if
not
len
(
args
):
arg
=
None
else
:
...
...
This diff is collapsed.
Click to expand it.
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