diff --git a/test/bytecode_3.0_run/04_def_annotate.pyc b/test/bytecode_3.0_run/04_def_annotate.pyc new file mode 100644 index 00000000..97074d99 Binary files /dev/null and b/test/bytecode_3.0_run/04_def_annotate.pyc differ diff --git a/test/bytecode_3.1_run/04_def_annotate.pyc b/test/bytecode_3.1_run/04_def_annotate.pyc new file mode 100644 index 00000000..58090494 Binary files /dev/null and b/test/bytecode_3.1_run/04_def_annotate.pyc differ diff --git a/test/bytecode_3.2_run/04_def_annotate.pyc b/test/bytecode_3.2_run/04_def_annotate.pyc new file mode 100644 index 00000000..b6df7297 Binary files /dev/null and b/test/bytecode_3.2_run/04_def_annotate.pyc differ diff --git a/test/bytecode_3.3_run/04_def_annotate.pyc b/test/bytecode_3.3_run/04_def_annotate.pyc index d3b56657..2c4cc7fb 100644 Binary files a/test/bytecode_3.3_run/04_def_annotate.pyc and b/test/bytecode_3.3_run/04_def_annotate.pyc differ diff --git a/test/bytecode_3.4_run/04_def_annotate.pyc b/test/bytecode_3.4_run/04_def_annotate.pyc index 8fd46ab4..c91d59ce 100644 Binary files a/test/bytecode_3.4_run/04_def_annotate.pyc and b/test/bytecode_3.4_run/04_def_annotate.pyc differ diff --git a/test/bytecode_3.6_run/04_def_annotate.pyc b/test/bytecode_3.6_run/04_def_annotate.pyc index 1ec44615..030f4832 100644 Binary files a/test/bytecode_3.6_run/04_def_annotate.pyc and b/test/bytecode_3.6_run/04_def_annotate.pyc differ diff --git a/test/bytecode_3.7_run/04_def_annotate.pyc b/test/bytecode_3.7_run/04_def_annotate.pyc index 754ab6a5..4e165c1c 100644 Binary files a/test/bytecode_3.7_run/04_def_annotate.pyc and b/test/bytecode_3.7_run/04_def_annotate.pyc differ diff --git a/test/simple_source/bug31/04_def_annotate.py b/test/simple_source/bug31/04_def_annotate.py index 4281a809..de80dd1a 100644 --- a/test/simple_source/bug31/04_def_annotate.py +++ b/test/simple_source/bug31/04_def_annotate.py @@ -47,6 +47,12 @@ def test14(*args, name: int=1, qname): def test15(*args, name='S', fname, qname=4): return args, name, fname, qname +# From 3.4 /asyncio/streams.py open_connection +_DEFAULT_LIMIT = 5 +def test16(host=None, port=None, *, + loop=None, limit=_DEFAULT_LIMIT, **kwds): + return host, port, loop, limit, kwds + # Python 3.1 _pyio.py uses the -> "IOBase" annotation def o(f, mode = "r", buffering = None) -> "IOBase": return (f, mode, buffering) @@ -122,6 +128,10 @@ def ann2(args_1, b: int = 5, **kwargs: float) -> float: assert ann2.__annotations__['return'] == float assert b == 5 +class TestSignatureObject(): + def test_signature_on_wkwonly(self): + def test(x:int=55, *args: (int, str), c='test', a:float, kwargs:str="S", **b: int) -> int: + pass assert test1(1, 5) == (1, 5, 4, {}) assert test1(1, 5, 6, foo='bar') == (1, 5, 6, {'foo': 'bar'}) @@ -139,3 +149,4 @@ ann2(1) assert test12(1, 2, 3, name='hi') == (1, (2, 3)), "a, *args, name" assert test13(1, 2, 3, name='hi') == ((1, 2, 3), 'hi'), "*args, name" +assert test16('localhost', loop=2, limit=3, a='b') == ('localhost', None, 2, 3, {'a': 'b'})