Creating a module that uses itself
Greg Krohn
infinitystwin.SPAM at IS.BAD.yahoo.com
Mon Mar 18 01:47:51 EST 2002
More information about the Python-list mailing list
Mon Mar 18 01:47:51 EST 2002
- Previous message (by thread): Creating a module that uses itself
- Next message (by thread): YANRQ (yet another regex question)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Asheesh Laroia" <pan-news at asheeshenterprises.com> wrote in message news:2yfl8.113994$nl1.19520473 at typhoon.nyroc.rr.com... > I'm writing a PageMaker-to-specialized-HTML module (henceforth > "pm2html"). In the module, I define the classes Article, Headline, and > Photo, among others. > > In the Article class, I want to have a Headline object. Is this > possible? Right now, ActivePython's PythonWin spits a syntax error at me > because the Headline class is not defined. You should post your code and the actual error traceback. What you're describing should work -- at least they way that you've described it. Could there be a typo in your code? This works for me: class Article: def __init__(self): self.headline = Headline() class Headline: pass class Photo: pass a = Article() greg
- Previous message (by thread): Creating a module that uses itself
- Next message (by thread): YANRQ (yet another regex question)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list