Skip to content

Commit ada03b6

Browse files
author
Guido van Rossum
committed
Update proposed resolution formatting.
1 parent 2ef3bdc commit ada03b6

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

README.rst

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,21 @@ Work in progress notes
2626
precedent in ``abc``, namely ``Callable``, and ``Hashable``.
2727
However, attempts at implementing reasonable runtime behavior
2828
suggests that it may be better to leave ``collections.abc`` alone.
29-
**Proposed resolution: leave ``collections.abc`` alone.**
29+
**Proposed resolution:** Leave ``collections.abc`` alone.
3030

3131
* ``Var('T')`` is put in ``collections.abc`` as a helper with generics
3232
and covariance/contravariance in ABCs. May be renamed to ``TypeVar``.
3333
The co-/contravariance behavior requires more thinking.
34-
**Proposed resolution: Use ``TypeVar``, with mypy's semantics mapped:
35-
``typevar('T', values=(str, bytes)`` becomes ``TypeVar('T', str, bytes)``.**
34+
**Proposed resolution:** Use ``TypeVar``, with mypy's semantics mapped:
35+
``typevar('T', values=(str, bytes)`` becomes ``TypeVar('T', str, bytes)``.
3636

3737
* ``AnyStr`` (and consequently ``IO``) smells like basestring in
3838
disguise, what is the use case for Python 3? Answer: There are
3939
lots of things in the stdlib that are essentially overloaded as
4040
str-in-str-out and bytes-in-bytes-out; ``AnyStr`` has exactly the
4141
right behavior for this (unlike ``Union[str, bytes]``).
42-
**Proposed resolution: keep ``AnyStr``, ``IO`` and its subclasses,
43-
in typing.py.**
42+
**Proposed resolution:** Keep ``AnyStr``, ``IO`` and its subclasses,
43+
in typing.py.
4444

4545
* ``Undefined`` smells like JavaScript, I (Łukasz) left it out for now.
4646
However, mypy needs it. See https://github.com/ambv/typehinting/issues/20
@@ -50,13 +50,13 @@ Work in progress notes
5050
rather be fixed in ``re`` directly, with the types just imported in
5151
``typing``. If so, are there any other potentially useful types we'd
5252
like? See https://github.com/ambv/typehinting/issues/23
53-
**Proposed resolution: keep these two in typing.py for convenience.**
53+
**Proposed resolution:** Keep these two in typing.py for convenience.
5454

5555
* I (Łukasz) left out ``overload`` because I don't understand its purpose. If we
5656
need generic dispatch, we should add it to ``functools``.
5757
Perhaps ``overload`` should only be allowed in stub modules?
5858
See https://github.com/ambv/typehinting/issues/14
59-
**Proposed resolution: support the syntax but only in stub files.**
59+
**Proposed resolution:** support the syntax but only in stub files.
6060

6161
* I (Łukasz) left out specifying protocols as they are an ABC implementation
6262
detail from the perspective of this PEP. However, they should be
@@ -69,8 +69,8 @@ Work in progress notes
6969
* Having the last thing in mind, ``IO``, ``BinaryIO`` and ``TextIO``
7070
would simply be new abstract base classes, usable with or without type
7171
hinting.
72-
**Proposed resolution: ``IO`` is generic over ``AnyStr``, the other two
73-
are concrete (subclassing ``IO[bytes]`` and ``IO[str]`` respectively).**
72+
**Proposed resolution:** ``IO`` is generic over ``AnyStr``, the other two
73+
are concrete (subclassing ``IO[bytes]`` and ``IO[str]`` respectively).
7474

7575
* The current implementation of ``*IO`` is quite un-ducktyped (specifies
7676
both reading and writing as one protocol)
@@ -83,10 +83,10 @@ Work in progress notes
8383
well_typed_list = bad_typed_list # type: List[int]
8484

8585
See https://github.com/ambv/typehinting/issues/15
86-
**Proposed resolution: add ``cast(type, value)`` back in.**
86+
**Proposed resolution:** Add ``cast(type, value)`` back in.
8787

8888
* I (Łukasz) removed ``mypy`` from the listed "existing approaches" since we
89-
basically describe what mypy is. **Proposed resolution: fine.**
89+
basically describe what mypy is. **Proposed resolution:** Fine.
9090

9191
* I (Łukasz) thought if introducing optional contravariance/invariance to ``Var``
9292
has merit but I'm undecided; definitely complicates the type checker.
@@ -104,12 +104,12 @@ Changes to MyPy coming from this proposal
104104
https://github.com/JukkaL/mypy/issues/539 and
105105
https://github.com/ambv/typehinting/issues/1 and
106106
https://github.com/ambv/typehinting/issues/2 and maybe others.
107-
**Proposed resolution: ``TypeVar`` (see above).**
107+
**Proposed resolution:** ``TypeVar`` (see above).
108108

109109
* ``Union`` behaves differently, it holds the defined types in order
110110
to be able to actually respond to issubclass.
111-
**Proposed resolution: This doesn't affect mypy; I do want this for
112-
typing.py (also for generic types).**
111+
**Proposed resolution:** This doesn't affect mypy; I do want this for
112+
typing.py (also for generic types).
113113

114114
* ``typing.Function`` becomes ``typing.Callable``, which is equivalent
115115
to ``collections.abc.Callable``. (Has now been implemented in mypy.)
@@ -130,23 +130,23 @@ Open issues
130130
longer to type than dict?
131131

132132
* Is multiple dispatch using type hints in scope for this PEP?
133-
**Proposed resolution: let's wait, allow @overload only in stubs.**
133+
**Proposed resolution:** let's wait, allow @overload only in stubs.
134134

135135
* Should we mention platform- or version-specific typing? Guido mentioned
136136
Windows vs. POSIX during the Skype meeting.
137-
**Proposed resolution: let typing.py export a few specific constants;
138-
PY3, PY2, PY3_x (for x in 2, 3, 4, 5).**
137+
**Proposed resolution:** Let typing.py export a few specific constants;
138+
PY3, PY2, PY3_x (for x in 2, 3, 4, 5).
139139

140140
* It would be useful to have a ``Subclass[]`` factory that would be
141141
equivalent to "any class that has the all the following classes in its
142142
MRO". Maybe we'd want to rename union to ``Any[]`` and this new
143143
proposed type to ``All[]``? See https://github.com/ambv/typehinting/issues/18
144-
**Proposed resolution: let's just have ``Union[T1, T2, ...]`` and ``Any``.**
144+
**Proposed resolution:** Let's just have ``Union[T1, T2, ...]`` and ``Any``.
145145

146146
* Callable signature definition should be explained and support all
147147
valid function signatures.
148-
**Proposed resolution: ``Callable[[T1, T2, ...], Tr]``.**
148+
**Proposed resolution:** ``Callable[[T1, T2, ...], Tr]``.
149149

150150
* What about all other collections available in the ``collections``
151151
module?
152-
**Proposed resolution: make Generic types retain their argument type(s).**
152+
**Proposed resolution:** Make Generic types retain their argument type(s).

0 commit comments

Comments
 (0)