summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_functools.py
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2019-04-29 12:36:57 (GMT)
committerGitHub <noreply@github.com>2019-04-29 12:36:57 (GMT)
commit8c77b8cb9188165a123f2512026e3629bf03dc9b (patch)
tree863ea19f5f2c8ec179c32b3d06dc8366859ae26e /Lib/test/test_functools.py
parent99fcc616d400cd31af0733c3f8cc93bcc1d32a44 (diff)
downloadcpython-8c77b8cb9188165a123f2512026e3629bf03dc9b.zip
cpython-8c77b8cb9188165a123f2512026e3629bf03dc9b.tar.gz
cpython-8c77b8cb9188165a123f2512026e3629bf03dc9b.tar.bz2
bpo-36540: PEP 570 -- Implementation (GH-12701)
This commit contains the implementation of PEP570: Python positional-only parameters. * Update Grammar/Grammar with new typedarglist and varargslist * Regenerate grammar files * Update and regenerate AST related files * Update code object * Update marshal.c * Update compiler and symtable * Regenerate importlib files * Update callable objects * Implement positional-only args logic in ceval.c * Regenerate frozen data * Update standard library to account for positional-only args * Add test file for positional-only args * Update other test files to account for positional-only args * Add News entry * Update inspect module and related tests
Diffstat (limited to 'Lib/test/test_functools.py')
-rw-r--r--Lib/test/test_functools.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index 9890840..85c65d1 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -581,6 +581,13 @@ class TestPartialMethod(unittest.TestCase):
for func in [self.A.static, self.A.cls, self.A.over_partial, self.A.nested, self.A.both]:
self.assertFalse(getattr(func, '__isabstractmethod__', False))
+ def test_positional_only(self):
+ def f(a, b, /):
+ return a + b
+
+ p = functools.partial(f, 1)
+ self.assertEqual(p(2), f(1, 2))
+
class TestUpdateWrapper(unittest.TestCase):