Page MenuHome

Auto-complete in PyConsole: bm.verts[0] throws error, missing check
Closed, ResolvedPublic

Description

There's an ugly error if you try to auto-complete e.g.

bm.verts[0]

Auto-complete checks for __getitem__ method, but in this case, that one does exist but there is no __len__, so here's a simple fix:

scripts\modules\console\complete_namespace.py:96

if not hasattr(obj, '__getitem__') or not hasattr(obj, '__len__'): # extra check for __len__

A dot could be added to console line, but since a BMLayerItem could follow as well (no dot), it should be fine with above fix.

Event Timeline

codemanx edited a custom field.Apr 30 2013, 10:29 PM
Campbell Barton (campbellbarton) changed the task status from Unknown Status to Resolved.May 1 2013, 1:02 AM