On Tue, 20 Nov 2018 at 08:10, Sebastian Rittau <srittau@rittau.biz> wrote:
On 20.11.18 07:12, Michael Lee wrote:
> During the typing meetup from a week or two ago, I mentioned that we
> (the mypy team) were planning on implementing Literal types and would
> have a draft of the proposed semantics ready soon. Well, here it is:
> https://github.com/Michael0x2a/peps/blob/literal-types/pep-9999.rst

I still think that we should eventually be able to use plain integers,
True, False, and strings as shorthand for literals (in addition to the
verbose Literal syntax).

I am against this. A single literal is a rare case, much more common case is something like Literal[1, 2, 3] or Literal["rb", "wb"].
Introducing the special shorthand for rare use cases will only introduce confusion. Also explicit is better than implicit.

I would potentially only consider `True` and `False`, because:
* There are know cases for overloads on them in stdlib an third party.
* We already have `None` special cased: `Literal[None]` is the same as `None`.

--
Ivan