reST param type and namedtuple
I was wondering if there was a way to get autocomplete to recognize namedtuples.
So is it just a missing feature in PyCharm (I'm using 2.6 EAP) or am I declaring the type incorrectly?
EDIT: Formatting...
Given
Point = namedtuple('Point', ('x', 'y'))
PyCharm doesn't recognize Point as a type
def takes_a_point(point): """ This takes a point :param point: Point to do stuff with :type point: Point """ x = point.x # No autocomplete for x # ... do some stuff ... return
PyCharm does recognize this though
p = Point(5, 10) x = p.x # Autocomplete works
So is it just a missing feature in PyCharm (I'm using 2.6 EAP) or am I declaring the type incorrectly?
EDIT: Formatting...
Please sign in to leave a comment.
Wanted to confirm I wasn't just doing it wrong. Thanks!