[Geany] Detecting symbols

spir denis.spir at xxxxx
Tue May 19 21:12:28 UTC 2009


Le Tue, 19 May 2009 22:33:07 +0200,
Enrico Tröger <enrico.troeger at uvena.de> s'exprima ainsi:

> For testing the parser, I mainly used the following code snippet:
> import os, sys, errno, re, glob, gc, datetime, shutil
> try: import cPickle
> except: import pickle as cPickle
> import Runner, TaskGen, Node, Scripting, Utils, Environment, Task,
> Logs, Options
> from Logs import debug, error, info
> from Constants import *
> 
> Are there other variants of "import" statements possible? You know, my
> Python knowledge is very limited :).

Yes, sadly, there's a variant that will complicate a bit your table updating:
   from soup import foo as f, bar as b, ...
renames (in local scope) while importing.

There are also imports from sub packages (read: sub-dir):
  import foo.bar
  from foo.bar import fish, chips as crisps

And recently (python 2.5 I guess) relative imports using leading dot(s), in a form similar to *nix filesystems:
  from ..foo import bar

Denis
------
la vita e estrany



More information about the Users mailing list