diff options
author | 2023-05-20 13:26:43 +0200 | |
---|---|---|
committer | 2023-05-20 13:26:43 +0200 | |
commit | 0fc02d458230220d66e4ec41c918e72c85dafa7b (patch) | |
tree | 5d86151aa62bf67bed418a492ca44567e76dc8bd | |
parent | add _hashlib.scrypt (issue 3921) (diff) | |
download | pypy-0fc02d458230220d66e4ec41c918e72c85dafa7b.tar.gz pypy-0fc02d458230220d66e4ec41c918e72c85dafa7b.tar.bz2 pypy-0fc02d458230220d66e4ec41c918e72c85dafa7b.zip |
we can just use posonly args now for list.__init__ and set.__init__
-rw-r--r-- | pypy/objspace/std/listobject.py | 10 | ||||
-rw-r--r-- | pypy/objspace/std/setobject.py | 8 |
2 files changed, 2 insertions, 16 deletions
diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py index e0f02c0ef4..2185ab8da8 100644 --- a/pypy/objspace/std/listobject.py +++ b/pypy/objspace/std/listobject.py @@ -465,11 +465,8 @@ class W_ListObject(W_Root): w_obj.clear(space) return w_obj - def descr_init(self, space, __args__): + def descr_init(self, space, w_iterable=None, __posonly__=None): """Initialize self. See help(type(self)) for accurate signature.""" - # this is on the silly side - w_iterable, = __args__.parse_obj( - None, 'list', init_signature, init_defaults) self.clear(space) if w_iterable is not None: self.extend(w_iterable) @@ -2304,11 +2301,6 @@ def plain_int_w(space, w_obj): # for that use case it should never raise. return w_obj._int_w(space) -# _______________________________________________________ - -init_signature = Signature(['sequence'], posonlyargcount=1) -init_defaults = [None] - # ____________________________________________________________ # Sorting diff --git a/pypy/objspace/std/setobject.py b/pypy/objspace/std/setobject.py index 0ad50cf927..9b1c6fc925 100644 --- a/pypy/objspace/std/setobject.py +++ b/pypy/objspace/std/setobject.py @@ -158,11 +158,7 @@ class W_BaseSetObject(W_Root): # app-level operations - def descr_init(self, space, __args__): - w_iterable, = __args__.parse_obj( - None, 'set', - init_signature, - init_defaults) + def descr_init(self, space, w_iterable=None, __posonly__=None): _initialize_set(space, self, w_iterable) def descr_repr(self, space): @@ -1722,8 +1718,6 @@ def _update_from_iterable(space, w_set, w_iterable): w_set.add(w_item) -init_signature = Signature(['some_iterable'], None, None) -init_defaults = [None] def _initialize_set(space, w_obj, w_iterable=None): w_obj.clear() set_strategy_and_setdata(space, w_obj, w_iterable) |