[Pythonmac-SIG] parameterize dot notation

tmk@microscript.be tmk@microscript.be
Tue, 19 Sep 2000 11:39:23 +0200


Yo,

I've got a question for python hackers. This is not really related to =
PythonMac but anyway...

In UserLand's Frontier, paths to 'objects' are denoted using a syntax =
such as the following:

root.foo.bar.fubar (1)

Now suppose that v1, v2, v3 are variables holding the values 'foo', =
'bar', 'fubar' respectively, the following notation is equivalent to =
(1):

root.[v1].[v2].[v3] (2)

I was wondering if there's a way in Python to achieve the same ie =
'parameterize'(is that a correct word anyway?) the path to an object an =
object path. After all, Python seems to support syntax such as

root.foo().bar().fubar (meaning that the intermediate steps in the =
previous path are not taken 'literally' if you see what I mean).

TIA for your help.

=3D tmk =3D=