A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-May/064900.html below:

[Python-Dev] Alternative path suggestion

[Python-Dev] Alternative path suggestion [Python-Dev] Alternative path suggestionMike Orr sluggoster at gmail.com
Sat May 6 09:37:05 CEST 2006
There's something that bothers me about putting the path in an
attribute rather than subclassing tuple.  I prefer it that way but I
don't see how you'd do directory slicing and joining.  If the path is
a tuple it's easy:

p = Path("/a/b/c")
p[:-1]         # Path("/a/b")

If the directory components are on an attribute

p.path[:-1]       # ("a", "b")

How do you do slicing and joining?  If Path subclasses object, it
could be done there like in the first example.  But if Path subclasses
string, that API is taken:

p[:-1]                # "/a/b"


--
Mike Orr <sluggoster at gmail.com>
(mso at oz.net address is semi-reliable)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4