Strongly typed list

Diez B. Roggisch deets at nospam.web.de
Tue Aug 18 15:15:42 CEST 2009


هاني الموصلي wrote:

> I think i found a good managable solution. Actually it is trivial but
> may help (I used it now).
> When i wnat to access the list then i assign the object which i want
> to access to a variable ex:
> 1)x=AutomataBranch()
> 2)x=self.cfgAutomata[i]
> 
> The first line is used only to make the IDE knows that x is from
> AutomatBranch type.After that when i press x. then all methods and
> properties are visualized.
> 
> I think it is some how good.

Unless x=AutomataBranch() is something that is expensive. And to be honest:
changing code (possibly introducing bugs!!!) to work around short-comings
in either your IDE or your way you insist to work strikes me as odd.

I understand the desire to have autocompletion. But it's not *that*
important. Maybe fabrio (who's maintaining the PyDev-eclipse-plugin) could
be asked to add something like this:

  #@x:AutomataBranch

to the plugin - so that when pydev reads that comment, it has a hint on what
to use for autocompletion.

Diez



More information about the Python-list mailing list