summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-09-02 20:33:30 (GMT)
committerGeorg Brandl <georg@python.org>2009-09-02 20:33:30 (GMT)
commit7837a968e270654fdf2d1d08d83b2078c4294e63 (patch)
treeeb28c555b3f98cbc1119d591ff634e27f5a818c7
parent5dbb84a23440977fa4ae84a75829dff563f35862 (diff)
downloadcpython-7837a968e270654fdf2d1d08d83b2078c4294e63.zip
cpython-7837a968e270654fdf2d1d08d83b2078c4294e63.tar.gz
cpython-7837a968e270654fdf2d1d08d83b2078c4294e63.tar.bz2
Use true kwonly arg instead of **kwds hackaround.
-rw-r--r--Lib/pstats.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/Lib/pstats.py b/Lib/pstats.py
index 3e6e994..fe7f225 100644
--- a/Lib/pstats.py
+++ b/Lib/pstats.py
@@ -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: