Author: Matti Picus <matti.pi...@gmail.com> Branch: issue-2592 Changeset: r91632:7fc61a836a84 Date: 2017-06-22 23:09 +0300 http://bitbucket.org/pypy/pypy/changeset/7fc61a836a84/
Log: pop and pop_end return values diff --git a/pypy/module/cpyext/sequence.py b/pypy/module/cpyext/sequence.py --- a/pypy/module/cpyext/sequence.py +++ b/pypy/module/cpyext/sequence.py @@ -346,11 +346,11 @@ def pop(self, w_list, index): w_list.switch_to_object_strategy() - w_list.strategy.pop(w_list, index) + return w_list.strategy.pop(w_list, index) def pop_end(self, w_list): w_list.switch_to_object_strategy() - w_list.strategy.pop_end(w_list) + return w_list.strategy.pop_end(w_list) def insert(self, w_list, index, w_item): w_list.switch_to_object_strategy() diff --git a/pypy/module/cpyext/test/test_listobject.py b/pypy/module/cpyext/test/test_listobject.py --- a/pypy/module/cpyext/test/test_listobject.py +++ b/pypy/module/cpyext/test/test_listobject.py @@ -154,7 +154,9 @@ l = module.newlist() p = l.pop() assert p == 1000 - assert l == [3, -5] + p = l.pop(0) + assert p == 3 + assert l == [-5] def test_list_macros(self): """The PyList_* macros cast, and calls expecting that build.""" _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit