Re: Module listing in order.

2007-05-28 Thread Nick Craig-Wood
Ramashish Baranwal <[EMAIL PROTECTED]> wrote: > > > I want a way to get the contents in the order of their declaration, > > > i.e. [B, A, D]. Does anyone know a way to get it? > > > > My suggestion would be to actually parse the text of the module. "Brute > > force" is what it's called ;). But doin

Re: Module listing in order.

2007-05-26 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Wildemar Wildenburger <[EMAIL PROTECTED]> wrote: . . . >Good God! Is there *anything* that python does not already do? I hardly >feel the need to write programs anymore ... >Its really 80% like

Re: Module listing in order.

2007-05-25 Thread Steve Holden
Wildemar Wildenburger wrote: > Peter Otten wrote: >> Ramashish Baranwal wrote: >> >> > I want a way to get the contents in the order of their declaration, > i.e. [B, A, D]. Does anyone know a way to get it? > My suggestion would be to actually parse the text of the modu

Re: Module listing in order.

2007-05-25 Thread Wildemar Wildenburger
Peter Otten wrote: > Ramashish Baranwal wrote: > > I want a way to get the contents in the order of their declaration, i.e. [B, A, D]. Does anyone know a way to get it? >>> My suggestion would be to actually parse the text of the module. "Brute >>> force" is what it's cal

Re: Module listing in order.

2007-05-25 Thread Peter Otten
Ramashish Baranwal wrote: >> > I want a way to get the contents in the order of their declaration, >> > i.e. [B, A, D]. Does anyone know a way to get it? >> >> My suggestion would be to actually parse the text of the module. "Brute >> force" is what it's called ;). But doing so with, say, pyparsin

Re: Module listing in order.

2007-05-25 Thread Ramashish Baranwal
> > I want a way to get the contents in the order of their declaration, > > i.e. [B, A, D]. Does anyone know a way to get it? > > My suggestion would be to actually parse the text of the module. "Brute > force" is what it's called ;). But doing so with, say, pyparsing > shouldn't be *very* difficul

Re: Module listing in order.

2007-05-23 Thread Wildemar Wildenburger
Ramashish Baranwal wrote: > I want a way to get the contents in the order of their declaration, > i.e. [B, A, D]. Does anyone know a way to get it? > My suggestion would be to actually parse the text of the module. "Brute force" is what it's called ;). But doing so with, say, pyparsing shouldn

Re: Module listing in order.

2007-05-23 Thread Diez B. Roggisch
Ramashish Baranwal wrote: > Hi, > > I want to get a module's contents (classes, functions and variables) > in the order in which they are declared. Using dir(module) therefore > doesn't work for me as it returns a list in alphabetical order. As an > example- > > # mymodule.py > class B: pass > c

Re: Module listing in order.

2007-05-23 Thread Gabriel Genellina
En Wed, 23 May 2007 04:32:42 -0300, Ramashish Baranwal <[EMAIL PROTECTED]> escribió: > I want to get a module's contents (classes, functions and variables) > in the order in which they are declared. Using dir(module) therefore > doesn't work for me as it returns a list in alphabetical order. As

Module listing in order.

2007-05-23 Thread Ramashish Baranwal
Hi, I want to get a module's contents (classes, functions and variables) in the order in which they are declared. Using dir(module) therefore doesn't work for me as it returns a list in alphabetical order. As an example- # mymodule.py class B: pass class A: pass class D: pass # test.py import my