Chi Ho Kwok
2014-11-06 10:41:47 UTC
Hi there,
Is it possible to add generics support to the docstring parser in Pydev? I
used to use Pydev almost exclusively for Python/Django projects, but the
lack of support for "list of Stuff" or "dict from unicode to MoreStuff"
makes PyCharm a far better editor for more complex projects (if it works,
that is, its analysis is kinda buggy using fully qualified paths).
A real life examples from an __init__
self*.*characters *=* *[];* "@type: list of
(wol.world.models.Realm, unicode)"
self*.*fails *=* *[];* "@type: list of (unicode, unicode)"
self*.*lookupMap *=* *{};* "@type: dict from
(wol.world.models.Realm, unicode) to wol.world.models.Character"
With PyCharm's code analysis, I can subsequently write "for realm, name in
self.characters" with full typing support; in PyDev, it requires some
assert isinstance each time I reference these data structures.
In a small project, this doesn't matter much, but when there are a ton of
classes written in the past few years, you don't know exactly what to call
anymore, having a docstring parser that fully understands generics (and
tuples) in @type and @rtype increases productivity a lot.
Kind regards,
Is it possible to add generics support to the docstring parser in Pydev? I
used to use Pydev almost exclusively for Python/Django projects, but the
lack of support for "list of Stuff" or "dict from unicode to MoreStuff"
makes PyCharm a far better editor for more complex projects (if it works,
that is, its analysis is kinda buggy using fully qualified paths).
A real life examples from an __init__
self*.*characters *=* *[];* "@type: list of
(wol.world.models.Realm, unicode)"
self*.*fails *=* *[];* "@type: list of (unicode, unicode)"
self*.*lookupMap *=* *{};* "@type: dict from
(wol.world.models.Realm, unicode) to wol.world.models.Character"
With PyCharm's code analysis, I can subsequently write "for realm, name in
self.characters" with full typing support; in PyDev, it requires some
assert isinstance each time I reference these data structures.
In a small project, this doesn't matter much, but when there are a ton of
classes written in the past few years, you don't know exactly what to call
anymore, having a docstring parser that fully understands generics (and
tuples) in @type and @rtype increases productivity a lot.
Kind regards,
--
Chi Ho Kwok
Digibites Technology
***@digibites.nl
Chi Ho Kwok
Digibites Technology
***@digibites.nl