Commit Graph

22 Commits

Author SHA1 Message Date
Mike Pagel 5698c21e8b corrected import in sample (#1220) 2019-11-04 14:11:13 +00:00
Mark Mendoza e0a2affe5d Remove additional error from error example (#1097)
The example with `Concrete` and `Template` is supposed to highlight that adding properties to a protocol in the implementation of a method is not supported, and does not add to the required signature of the protocol.
However, this also has the problem of `Concrete` not being a `Template` anyway because it is missing that `method`.
2019-06-03 22:19:48 +01:00
Ivan Levkivskyi a6c96caf46
Mark PEPs 544, 586, 589, and 591 as accepted for Python 3.8 (#1088) 2019-05-26 10:58:57 +01:00
Ivan Levkivskyi 74f0fb256d PEP 544: Couple final edits (#1084)
Co-Authored-By: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2019-05-23 22:16:04 -07:00
Ivan Levkivskyi 8aecf9d07a
Minor tweaks to PEP 544 (#1046)
This PR contains mostly minor wording tweaks plus a paragraph explicitly allowing class objects as implementations of protocols, previously there were questions whether it is actually allowed, see python/mypy#4536.
2019-05-13 11:22:49 +01:00
Ivan Levkivskyi 88135b711d
PEP 544: Specify usage of modules as subtypes of protocols (#646)
See python/mypy#5018 for motivation.
2019-05-12 00:18:56 +01:00
jimbo1qaz 4b703079ff PEP 544: Fix typo in code block (#974) 2019-04-04 14:59:00 +01:00
Guido van Rossum 74d7ab4b91 PEP 544: Make Guido the BDFL-Delegate (Protocols) (#799)
* Make Guido the BDFL-Delegate for PEP 544 (Protocols)

* Fix lint
2018-10-07 07:55:46 +11:00
Ivan Levkivskyi da41a811d7 PEP 544: Specify self-types in protocols (#647)
This is already implemented in mypy in exactly the same way it works for nominal classes (and thus shares most bugs of self-types in nominal classes).
2018-05-10 18:01:32 -04:00
Ivan Levkivskyi 9c06059758 Update PEP 544 (#644)
* Rename `@runtime` to `@runtime_checkable`
* Postpone making mappings and sequences protocols, this can be done later in Python 3.8
* Update the implementation status
* More strict and precise specification for `isinstance()` and `issubclass()` with protocols.
* Few typos
2018-05-10 17:55:54 -04:00
Guido van Rossum 5af613bbb2 Fix markup bug in PEP 544 2018-04-03 11:22:59 -07:00
Łukasz Langa cea4966702 lukasz@langa.pl -> lukasz@python.org 2018-01-27 13:19:45 -08:00
JR Heard 9873d9fb19 typo fix for pep 544 (#482) 2017-12-04 08:44:14 -08:00
Mariatta cf3bad5ab3
Revert "Rename all .txt PEP files to .rst (GH-462)" (GH-464)
This reverts commit bb0e518ed3.
2017-11-11 11:28:55 -08:00
Huang Huang bb0e518ed3 Rename all .txt PEP files to .rst (GH-462)
For https://github.com/python/peps/issues/1
2017-11-11 10:30:43 -08:00
Ivan Levkivskyi 338dcabc7b Updates to PEP 544 (#289)
Including a title change.
2017-06-19 21:38:56 -07:00
Ivan Levkivskyi 4205604fc8 Updates to PEP 544: Protocols (#255)
* Add covariant mutable overriding and overriding variance to rejected ideas

* Update the notes on runtime implementation

* Add one more argument for prohibiting variance overrides
2017-05-24 13:38:49 -07:00
Andreas Pelme ff3b268335 Correct bad naming in TypeScript example (#253)
The interface should be named `LabeledItem` and not `LabeledValue`.
2017-05-10 22:20:33 +10:00
Ivan Levkivskyi ea2cd1593b Few more updates to PEP 544: Protocols (#246)
* Drop Set's from protocols; add adapters to rejected ideas

* Add link to runtime implementation
2017-04-27 16:06:36 -07:00
Jelle Zijlstra bcd4fef673 fix typos in PEP 544 (#244)
Fixes a few typos in an example and a confusing phrase.
2017-04-23 08:10:00 +10:00
Ivan Levkivskyi 6024eea320 Updates for PEP 544: Protocols (#243)
Note: there's an open question about whether interface variance should be inferred or be user-declared (defaulting to invariant unless declared otherwise). The current draft uses inferred invariance. See e.g. discussion at https://github.com/python/peps/pull/243#issuecomment-295826456.
2017-04-22 07:43:32 -07:00
Ivan Levkivskyi 938c61d1d7 PEP 544: Protocols (#224)
This adds static support for structural subtyping. Previous discussion is here python/typing#11

Fixes #222
2017-03-18 11:12:56 -07:00