On Tue, Dec 14, 2021 at 10:23 AM Joao S. O. Bueno <jsbu...@python.org.br> wrote:
> Just a short one, for everyone agreeing type.Annotated does the job, > but thinks we need new syntax, because it is verbose: > > You can already do: > > from typing import Annotated as A > > And: > > attr: A[type, "docstring goes here"] > > I see no need for any new syntax. > > (and maybe adding typing.Docstring for the cases when one > just wants the docs, but no type annotation) > You're not wrong exactly. But there has been a desire to reduce the need for typing module imports in general, and I think eliminating the need to import Annotation for this specific use case might have merit, if is becomes blessed as The Way, and if we think it is a good idea to say to people "hey! providing docstrings for members is a really good practice, and so we're making is super duper easy and standardizing it!" (just as we encouraged people to provide docstrings in the past for modules and classes by making that syntax dead simple to use). --- Ricky. "I've never met a Kentucky man who wasn't either thinking about going home or actually going home." - Happy Chandler
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/H5NIEA24YOZOY6TUFIRAYV4IK5FNYQQJ/ Code of Conduct: http://python.org/psf/codeofconduct/