[Python-Dev] Path inherits from string

BJörn Lindqvist bjourne at gmail.com
Sun Jan 29 08:13:38 CET 2006


> > See the steps I mentioned. Unless step #1 is completed there is no way
> > to make the following code work:
> >
> >     open(Path("foobar"))
> >
> > Well, there is one alternative which is:
> >
> >     open(Path("foobar").tostring())
> >
> > And that is a Java-esque workaraound that I think noone would be happy
> > with.
>
> Now maybe I'm missing context here but: what on earth are you talking
> about?  Of course there's a way to make "open(Path("foobar"))" work --
> you change how the builtin open() works.

That's what I said: Someone has to make the required modifications to
the Python core. Changing how open() works would AFAIK be a
modification to the Python core. open() was just an example and
changing only how open() works  would not be sufficient I think.
__import__(), execfile() and third party extensions implemented in C
would also have to be modified so that they treat Path("foobar")
equivalent to "foobar."

--
mvh Björn


More information about the Python-Dev mailing list