type annotations

14 views
Skip to first unread message

Николай Рулёв

unread,
Sep 30, 2018, 12:48:57 AM9/30/18
to Sanic Task Force
Good morning, what do you think about add typing support in sanic. I think it's good idea, because annotations are the only effective way to build AST in Pycharm, VScode, maybe vim and emacs plugins. This task is simple, but very helpful for project.
P.S I'm just starting my way in open source, this task nice for me, because it will help me to understand project.
P.S.S sorry for my English, I'm not good at this

Adam Hopkins

unread,
Sep 30, 2018, 2:20:40 AM9/30/18
to Николай Рулёв, Sanic Task Force
Do you mean typing the Sanic code base or creating stub files?

--
Adam Hopkins



Sep 30, 2018, 7:48 AM by nikola...@gmail.com:
Good morning, what do you think about add typing support in sanic. I think it's good idea, because annotations are the only effective way to build AST in Pycharm, VScode, maybe vim and emacs plugins. This task is simple, but very helpful for project.
P.S I'm just starting my way in open source, this task nice for me, because it will help me to understand project.
P.S.S sorry for my English, I'm not good at this


--
You received this message because you are subscribed to the Google Groups "Sanic Task Force" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sanic-dev+...@googlegroups.com.
To post to this group, send email to sani...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Николай Рулёв

unread,
Sep 30, 2018, 2:34:51 AM9/30/18
to Sanic Task Force
I mean Sanic code base

Николай Рулёв

unread,
Oct 1, 2018, 7:32:08 AM10/1/18
to Sanic Task Force
Aaaaaand, what do you think?

Richard Kuesters

unread,
Oct 1, 2018, 9:09:07 AM10/1/18
to nikola...@gmail.com, sani...@googlegroups.com

My two cents regarding this:

  1. We have to be careful (if doing this), because Sanic targets Python version 3.5+, so there might be some gotchas between Python versions (like, myvar: str = "hello" won’t work inside a function / class body under Python 3.5);
  2. Having annotations in runtime for Python versions prior to 3.7 may have some performance penalties on initialization;
  3. Perhaps, at first, we can provide these for devtools, like mypy?


On Mon, Oct 1, 2018 at 8:32 AM Николай Рулёв <nikola...@gmail.com> wrote:
Aaaaaand, what do you think?


--
You received this message because you are subscribed to the Google Groups "Sanic Task Force" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sanic-dev+...@googlegroups.com.
To post to this group, send email to sani...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages