Skip to content

Commit

Permalink
General cleanup, discuss negative numbers and enums, allow nested lit…
Browse files Browse the repository at this point in the history
…erals

This commit:

1. Performs a bunch of cleanup suggested by Ivan
2. Adds a note clarifying that negative numbers are *allowed*
3. Adds a note reiterating that PEP 484 expects type checkers to
   understand enum values when performing type inference (and
   suggests this can be implemented by treating enums as roughly
   equal to the union of their types)
4. Moves "nested literals" into the "supported" category -- as I
   discovered in python/mypy#5947,
   implementing support for this is not as bad as I thought.
5. Adds an explicit warning to the "literals and generics" section.
6. Modifies some text to become more firm about disallowing
   'Literal[Any]' and related constructs.
7. Deletes discussion about TypeScript's "index types" and "keyof"
   operator -- I mostly included that only because I got some feedback
   earlier to discuss TypeScript. It felt pretty shoehorned in,
   anyways.
  • Loading branch information
MichaelLeeDBX committed Mar 14, 2019
1 parent b467857 commit 12c6f44
Showing 1 changed file with 224 additions and 179 deletions.
Loading

0 comments on commit 12c6f44

Please sign in to comment.