Skip to content

Commit f975066

Browse files
committed
Reorder some imports in a test, tweak PEP a little
1 parent 4b82459 commit f975066

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

pep.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,10 @@ or, using the type abbreviations we provide::
444444

445445
(Rationale discussed :ref:`below <callable-rationale>`.)
446446

447+
TODO: Should the extended argument list be wrapped in a
448+
``typing.Parameters[*Params]`` type (that will also kind of serve as a
449+
bound for ``ParamSpec``)?
450+
447451

448452
Specification
449453
=============
@@ -632,6 +636,8 @@ Union processing
632636
* ``FromUnion[T]``: returns a tuple containing all of the union
633637
elements, or a 1-ary tuple containing T if it is not a union.
634638

639+
* ``Union[*Ts]``: ``Union`` will become able to take variadic
640+
arguments, so that it can take unpacked comprehension arguments.
635641

636642

637643
Object inspection
@@ -1285,7 +1291,8 @@ Reference Implementation
12851291

12861292
There is an in-progress proof-of-concept implementation in mypy [#ref-impl]_.
12871293

1288-
It can type check the ORM and NumPy-style broadcasting examples.
1294+
It can type check the ORM, FastAPI-style model derivation, and
1295+
NumPy-style broadcasting examples.
12891296

12901297
It is missing support for callables, ``UpdateClass``, annotation
12911298
processing, and various smaller things.

tests/test_fastapilike_2.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import textwrap
2-
31
from typing import (
42
Callable,
53
Literal,
@@ -10,11 +8,8 @@
108
Self,
119
)
1210

13-
from typemap.type_eval import eval_typing
1411
from typemap import typing
1512

16-
from . import format_helper
17-
1813

1914
class FieldArgs(TypedDict, total=False):
2015
hidden: ReadOnly[bool]
@@ -214,6 +209,11 @@ class Hero:
214209

215210
#######
216211

212+
import textwrap
213+
214+
from typemap.type_eval import eval_typing
215+
from . import format_helper
216+
217217

218218
def test_fastapi_like_0():
219219
tgt = eval_typing(AddInit[Hero])

0 commit comments

Comments
 (0)