[Python-Dev] Type hints -- a mediocre programmer's reaction (original) (raw)
Harry Percival harry.percival at gmail.com
Thu Apr 23 16:25:30 CEST 2015
- Previous message (by thread): [Python-Dev] Type hints -- a mediocre programmer's reaction
- Next message (by thread): [Python-Dev] Type hints -- a mediocre programmer's reaction
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
lol @ the fact that the type hints are breaking github's syntax highlighter :)
On 23 April 2015 at 14:44, Paul Sokolovsky <pmiscml at gmail.com> wrote:
Hello,
On Thu, 23 Apr 2015 14:48:58 +0200 Wolfgang Langner <tds333+pydev at gmail.com> wrote: > Hello, > > On Thu, Apr 23, 2015 at 11:59 AM, Paul Sokolovsky <pmiscml at gmail.com> > wrote: > > > Hello, > > > > On Thu, 23 Apr 2015 10:43:52 +0200 > > Wolfgang Langner <tds333+pydev at gmail.com> wrote: > > > > [] > > > > > Also ask why no one used type specifier, they are possible since > > > Python 3.0 ? > > > Because it is the wrong way for Python. > > > > That's an example of how perceptions differ. In my list, everyone(*) > > uses them - MyPy, MicroPython, etc. Even more should use them (any > > JIT module, which are many), but sit in the bushes, waiting for a > > kick, like PEP484 provides. > > > > > > (*) Everyone of those who needs them. Otherwise, let's throw out > > metaclasses - noone uses them. > > > > > They are there to be used and won't go away. > But for most Libraries out there no one used it. > > JIT (Numba), Cython and other compilers/tools doing optimization have > their own syntax and needs. That's exactly what needs to change, and where this PEP helps, as was already pointed out: http://code.activestate.com/lists/python-dev/135659/ > They need even more information like i32, i64, different floats and > so on. That's poor excuse for not trying to be a good member of Python community (and work on standard type annotation syntax, instead of digging own hole). > MyPy is really new and in development. And the docstring type > spec way is still possible. Anything is possible. The talk is about what makes most of sense. Docstrings were always arbitrary string designated at human's consumption, how (ab)using them for type annotations is better than having clean language-grammar syntax? > MicroPython uses one annotation for their inline assembler stuff not > type hints. Here's how MicroPython uses type annotations: https://github.com/micropython/micropython/blob/master/tests/micropython/viperptr8load.py > For the library there are no type hints for function definitions. > > > Remark: I use Metaclasses, seldom but if needed very useful. :-) > > > -- > bye by Wolfgang
-- Best regards, Paul mailto:pmiscml at gmail.com
Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/hjwp2%40cantab.net
--
Harry J.W. Percival
Twitter: @hjwp Mobile: +44 (0) 78877 02511 Skype: harry.percival -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20150423/55b0d3ba/attachment-0001.html>
- Previous message (by thread): [Python-Dev] Type hints -- a mediocre programmer's reaction
- Next message (by thread): [Python-Dev] Type hints -- a mediocre programmer's reaction
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]