[pypy-dev] Adding support for PEP526: variable annotations

Tin Tvrtković tinchester at gmail.com
Fri Jun 8 10:18:16 EDT 2018


Hi Armin,

thanks for the tip. I actually need the annotations in runtime to do
serialization / deserialization (using two my libraries, cattrs and another
one for which I haven't written the docs yet). I use annotated attrs
classes. Usually I just move the type annotations from the annotation
syntax to "attr.ib(type=...)" using sed so it's not that big of a deal, but
it's still a chore.

Cheers :)

On Fri, Jun 8, 2018 at 12:23 AM Armin Rigo <armin.rigo at gmail.com> wrote:

> Hi Tin,
>
> On 7 June 2018 at 18:38, Tin Tvrtković <tinchester at gmail.com> wrote:
> > it'd be great if we could get variable annotations in PyPy even before
> PyPy
> > 3.6 comes out. There's predecent with f-strings. I'm asking because it's
> a
> > major chore to strip out variable annotations while trying out PyPy,
> > (mostly) everything else can be worked around with imports etc.
>
> Look at tools that do the stripping automatically.  Maybe
> https://pypi.org/project/strip-hints/ with the option
> --only-assigns-and-defs ?
>
>
> A bientôt,
>
> Armin.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20180608/bbd776fd/attachment-0001.html>


More information about the pypy-dev mailing list