hack to auto-define variables?

Michal Wallace sabren at manifestation.com
Thu Oct 5 23:13:55 EDT 2000


On Thu, 5 Oct 2000, Neil Schemenauer wrote:

> > I'm trying to come up with a way to make something like this happen:
> > 
> > >>> x
> > None
> > 
> > WITHOUT saying "x=None":
> 
> Python is not Perl.  Why do you want this?


Well, Python isn't Prolog either... :)

What I really want is to be able to say:

>>> name("michal")
>>> name("neil")
>>> name(X)
>>> X
["michal", "neil"]

I suspect I'll probably wind up using:

>>> import plato
>>> X = plato.Var()
>>>
>>> plato.name("michal")
>>> plato.name("neil")
>>> plato.name(X)
>>> X
["michal", "neil"]

Which is fine by me. I'm all for declaring variables anyway. I'm just
wondering if it's possible to not have to do it, without doing TOO
much work.. :)

Cheers,

- Michal
------------------------------------------------------------------------
www.manifestation.com  www.sabren.com  www.linkwatcher.com  www.zike.net
------------------------------------------------------------------------





More information about the Python-list mailing list