Hi all, I was wondering what our plan was to allow use of Literal types to make more expressive stubs for the standard library. Now that PEP 586 is accepted, is it time for us to update the stubs for open, etc.? Best, Mark Mendoza
Fine with me, -- I've been waiting for this moment anxiously. What does Google think, for pytype? On Thu, Jun 13, 2019 at 14:00 Mark Mendoza <mendoza.mark.a@gmail.com> wrote:
Hi all, I was wondering what our plan was to allow use of Literal types to make more expressive stubs for the standard library. Now that PEP 586 is accepted, is it time for us to update the stubs for open, etc.? Best, Mark Mendoza _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
-- --Guido (mobile)
Yes, we should accept Literal (and other new features) as soon as enough type checkers support it, or at least are able to deal with stubs using the new feature. if pytype and PyCharm are OK with Literal, we should be able to use it. El jue., 13 jun. 2019 a las 15:07, Guido van Rossum (<guido@python.org>) escribió:
Fine with me, -- I've been waiting for this moment anxiously. What does Google think, for pytype?
On Thu, Jun 13, 2019 at 14:00 Mark Mendoza <mendoza.mark.a@gmail.com> wrote:
Hi all, I was wondering what our plan was to allow use of Literal types to make more expressive stubs for the standard library. Now that PEP 586 is accepted, is it time for us to update the stubs for open, etc.? Best, Mark Mendoza _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
-- --Guido (mobile) _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
pytype doesn't support Literal yet, but we added a `def __getattr__(name) -> Any` stub for typing_extensions ( https://github.com/google/pytype/blob/master/pytype/pytd/builtins/2and3/typi...), so it should be possible to annotate things with Literal without pytype complaining. Given that the PEP has been accepted, I agree that it seems reasonable to start using it. Rebecca On Thu, Jun 13, 2019 at 3:10 PM Jelle Zijlstra <jelle.zijlstra@gmail.com> wrote:
Yes, we should accept Literal (and other new features) as soon as enough type checkers support it, or at least are able to deal with stubs using the new feature. if pytype and PyCharm are OK with Literal, we should be able to use it.
El jue., 13 jun. 2019 a las 15:07, Guido van Rossum (<guido@python.org>) escribió:
Fine with me, -- I've been waiting for this moment anxiously. What does Google think, for pytype?
On Thu, Jun 13, 2019 at 14:00 Mark Mendoza <mendoza.mark.a@gmail.com> wrote:
Hi all, I was wondering what our plan was to allow use of Literal types to make more expressive stubs for the standard library. Now that PEP 586 is accepted, is it time for us to update the stubs for open, etc.? Best, Mark Mendoza _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
-- --Guido (mobile) _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
_______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
Excellent! In mypy we currently have a plugin for open(), I would love to get rid of that. On Thu, Jun 13, 2019 at 15:14 Rebecca Chen <rechen@google.com> wrote:
pytype doesn't support Literal yet, but we added a `def __getattr__(name) -> Any` stub for typing_extensions ( https://github.com/google/pytype/blob/master/pytype/pytd/builtins/2and3/typi...), so it should be possible to annotate things with Literal without pytype complaining. Given that the PEP has been accepted, I agree that it seems reasonable to start using it.
Rebecca
On Thu, Jun 13, 2019 at 3:10 PM Jelle Zijlstra <jelle.zijlstra@gmail.com> wrote:
Yes, we should accept Literal (and other new features) as soon as enough type checkers support it, or at least are able to deal with stubs using the new feature. if pytype and PyCharm are OK with Literal, we should be able to use it.
El jue., 13 jun. 2019 a las 15:07, Guido van Rossum (<guido@python.org>) escribió:
Fine with me, -- I've been waiting for this moment anxiously. What does Google think, for pytype?
On Thu, Jun 13, 2019 at 14:00 Mark Mendoza <mendoza.mark.a@gmail.com> wrote:
Hi all, I was wondering what our plan was to allow use of Literal types to make more expressive stubs for the standard library. Now that PEP 586 is accepted, is it time for us to update the stubs for open, etc.? Best, Mark Mendoza _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
-- --Guido (mobile) _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
_______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
-- --Guido (mobile)
Personally, I'm really looking forward to Literal in type stubs, even if pytype doesn't have support yet. -- Teddy On Thu, Jun 13, 2019 at 3:17 PM Guido van Rossum <guido@python.org> wrote:
Excellent! In mypy we currently have a plugin for open(), I would love to get rid of that.
On Thu, Jun 13, 2019 at 15:14 Rebecca Chen <rechen@google.com> wrote:
pytype doesn't support Literal yet, but we added a `def __getattr__(name) -> Any` stub for typing_extensions ( https://github.com/google/pytype/blob/master/pytype/pytd/builtins/2and3/typi...), so it should be possible to annotate things with Literal without pytype complaining. Given that the PEP has been accepted, I agree that it seems reasonable to start using it.
Rebecca
On Thu, Jun 13, 2019 at 3:10 PM Jelle Zijlstra <jelle.zijlstra@gmail.com> wrote:
Yes, we should accept Literal (and other new features) as soon as enough type checkers support it, or at least are able to deal with stubs using the new feature. if pytype and PyCharm are OK with Literal, we should be able to use it.
El jue., 13 jun. 2019 a las 15:07, Guido van Rossum (<guido@python.org>) escribió:
Fine with me, -- I've been waiting for this moment anxiously. What does Google think, for pytype?
On Thu, Jun 13, 2019 at 14:00 Mark Mendoza <mendoza.mark.a@gmail.com> wrote:
Hi all, I was wondering what our plan was to allow use of Literal types to make more expressive stubs for the standard library. Now that PEP 586 is accepted, is it time for us to update the stubs for open, etc.? Best, Mark Mendoza _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
-- --Guido (mobile) _______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
_______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
-- --Guido (mobile)
Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/
Am 14.06.19 um 00:09 schrieb Jelle Zijlstra:
Yes, we should accept Literal (and other new features) as soon as enough type checkers support it, or at least are able to deal with stubs using the new feature. if pytype and PyCharm are OK with Literal, we should be able to use it.
+1 From what I understand, mypy, pytype, and pyre can at least deal with it in stubs. I just checked PyCharm. While I don't think it supports literals, yet, it seems to cope with them. So if nobody objects, I am going to close #2931 (https://github.com/python/typeshed/issues/2913) and we can start accepting Literals. - Sebastian
participants (6)
-
Guido van Rossum
-
Jelle Zijlstra
-
Mark Mendoza
-
Rebecca Chen
-
Sebastian Rittau
-
Teddy Sudol