[Python-3000] Unipath package

2007-01-28 Thread Mike Orr
arts. They silently succeed if the operation is already done, and have arguments to smartly create/delete intermediate directories, etc. - Two extra functions are in 'unipath.tools'. 'dict2dir' creates a directory hierarchy modeled after a dict. 'dump_path' displays an AS

Re: [Python-3000] self-contained exceptions

2007-01-04 Thread Mike Orr
on object would also be fine. The point is that one universal format is insufficient, especially if it includes a long traceback. -- Mike Orr <[EMAIL PROTECTED]> ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] PEP 3108: Standard Library Reorganization

2007-01-02 Thread Mike Orr
Jim is writing a PEP that would move all the os.path.is*() functions into os because they access the filesystem (except os.path.isabs()). That's a separate issue. -- Mike Orr <[EMAIL PROTECTED]> ___ Python-3000 mailing list Python-3000@python

Re: [Python-3000] PEP 3108: Standard Library Reorganization

2007-01-02 Thread Mike Orr
to > just remove code unless there are compelling enough alternatives that > folks are willing to rewrite everything to use them. There is the 'lib-old' directory for modules that are unsupported but we're not ready to finish off. Alternati

Re: [Python-3000] Status of True, False, bool type

2007-01-01 Thread Mike Orr
On 1/1/07, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > "Mike Orr" <[EMAIL PROTECTED]> wrote: > > Huh? 'True == 1' is a "feature"? '16 + (0 == 0)' being illegal is a > > "Javaism"? Would somebody care to explain th

Re: [Python-3000] PEP 3108: Standard Library Reorganization

2007-01-01 Thread Mike Orr
t take the pathname rather than the st_mode. I've never used them, but it would be a pity to make people calculate the bitmasks manually. > * fileinput +1 to leave it. -- Mike Orr <[EMAIL PROTECTED]> ___ Python-3000 mailing list Python-3000@

Re: [Python-3000] Status of True, False, bool type

2007-01-01 Thread Mike Orr
> Will this behavior continue? > > Yes. Don't confuse Python with Java. Huh? 'True == 1' is a "feature"? '16 + (0 == 0)' being illegal is a "Javaism"? Would somebody care to explain this? It's acceptable that 2 is true but not Tru

Re: [Python-3000] Py3k release schedule worries

2006-12-21 Thread Mike Orr
e rationale? > > See, I don't remember. :-) Maybe to make it easy to see it's a module and not a function or local variable? +1 for allowing underscores in module names. -- Mike Orr <[EMAIL PROTECTED]> ___ Python-3000 mailin

Re: [Python-3000] Mini Path object

2006-11-26 Thread Mike Orr
On 11/26/06, Jim Jewett <[EMAIL PROTECTED]> wrote: > On 11/26/06, Mike Orr <[EMAIL PROTECTED]> wrote: > > I tried to make a separate PathAlgebra class and FSPath class, but it > > got so unweildly to use I made the latter a subclass. They're now > > called P

Re: [Python-3000] Mini Path object

2006-11-26 Thread Mike Orr
g files and having them work on other platforms (Windows on embedded systems that don't have a current directory), without having to manually convert them. But os.path.normpath() and os.path.normcase() already convert Posix slashes to Windows backslashes. May

Re: [Python-3000] Builtin iterator type

2006-11-19 Thread Mike Orr
not be used, and often I forego tuple to make it shorter: "isinstance(obj, list)". That's fine but it's more restrictive than I want to me: my function *could* work with a tuple or list-like object too. Equality for tuples! Down with sequence discrimination! Supp

Re: [Python-3000] interfaces

2006-11-19 Thread Mike Orr
that 'implements(obj, sequence) == True' would mean the class author has promised it will. However, requiring objects to be list subclasses hasn't been that much of a burden in practical terms. -- Mike Orr <[EMAIL PROTECTED]> ___ Py

Re: [Python-3000] Builtin iterator type

2006-11-19 Thread Mike Orr
aneously there was discussion on this list about it, although I wasn't subscribed then so I haven't fully read it: http://mail.python.org/pipermail/python-3000/2006-April/thread.html -- Mike Orr <[EMAIL PROTECTED]> ___ Python-3000 mailing

[Python-3000] Fwd: Builtin iterator type

2006-11-18 Thread Mike Orr
s but not as flexibly. For instance, you can have several classes in one module, but not several modules in one module. -- Mike Orr <[EMAIL PROTECTED]> ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python

Re: [Python-3000] Builtin iterator type

2006-11-14 Thread Mike Orr
builtins are, because a future version of Python will add ones you can't predict. enumerate() and zip() were added because they solve extremely widespread problems. I can't say I like sorted() and reversed(), but they're there because somebody thought they'd be very widely used

Re: [Python-3000] Builtin iterator type

2006-11-14 Thread Mike Orr
class because it has to be another, yet it can still "behave like" the other object. -- Mike Orr <[EMAIL PROTECTED]> ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] Python-3000 Digest, Vol 9, Issue 27

2006-11-14 Thread Mike Orr
t does what I need. I suppose it would be nice to chain iterators with "+", but I chain iterators so rarely it's no big deal. I suspect many other programmers are the same way. What I'd most like to see in itertools are the functions on the "Recipes" page. W

Re: [Python-3000] Mini Path object

2006-11-09 Thread Mike Orr
On 11/9/06, Talin <[EMAIL PROTECTED]> wrote: > Mike Orr wrote: > > On 11/9/06, Talin <[EMAIL PROTECTED]> wrote: > >> (This is a good reason to have paths represented as strings instead of > >> as a tuple, since you can't defer interpretation this way

Re: [Python-3000] Mini Path object

2006-11-09 Thread Mike Orr
ow, they've got bigger problems than we can handle. One can imagine a guesspath() or any2posix() function, but I can't imagine it would be widely used... or 100% correct. -- Mike Orr <[EMAIL PROTECTED]> ___ Python-3000 mailing list Python-300

Re: [Python-3000] Mini Path object

2006-11-09 Thread Mike Orr
On 11/9/06, Mike Orr <[EMAIL PROTECTED]> wrote: > the destination format will at least recognize it as an even if it > doesn't know what it means. ... recognize it as an absolute path ... -- Mike Orr <[EMAIL PROTECTED]> ___ P

Re: [Python-3000] Mini Path object

2006-11-09 Thread Mike Orr
'', the source format knows how to convert it to that, and the destination format will at least recognize it as an even if it doesn't know what it means. That's enough information to raise an exception or convert the path to relative. -- Mike Orr <[EMAIL PROTECTED]> ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] Mini Path object

2006-11-08 Thread Mike Orr
gt; > .replace_exts(N, *exts) > > Someone in another message pointed out that paths, being based on > strings, are immutable, so this whole handling of extensions will have > to be done another way. They would return new Path's, just like str.replace() does.

Re: [Python-3000] Mini Path object

2006-11-07 Thread Mike Orr
h? Is there an actual case where calling normpath() would change which file the path referred to? Any case that's not handled by (posix|nt|mac)path.normpath itself? -- Mike Orr <[EMAIL PROTECTED]> ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] Mini Path object

2006-11-07 Thread Mike Orr
How do you convert an absolute path anyway? PosixPath(NTPath("C:\winnt\system")) => ?? NTPath(PosixPath("/mnt/cdrom") => ?? You can convert them to "/winnt/system" and "\mnt\cdrom", but what's the point? They

Re: [Python-3000] Mini Path object

2006-11-07 Thread Mike Orr
On 11/7/06, Talin <[EMAIL PROTECTED]> wrote: > Mike Orr wrote: > > My latest idea is something like this: > > > > BEGIN > > class Path(unicode): > > """Pathname-manipulation methods.""" > > pa

Re: [Python-3000] Mini Path object

2006-11-06 Thread Mike Orr
promote all str's to unicode in the constructor so that any possible UnicodeDecodeErrors are localized in one place. On 11/5/06, Talin <[EMAIL PROTECTED]> wrote: > Mike Orr wrote: > > Path( Path("directory"), "subdirectory", "file")

Re: [Python-3000] Path Reform: Get the ball rolling

2006-11-02 Thread Mike Orr
7;m thinking of making the path module a class attribute, so that you can subclass any of these and use ntpath or macpath instead of your default if you want. I'll also try my hand at Glyph's "safe join" feature if I can get it to work right, but that will be an optional separat

[Python-3000] Mini Path object

2006-11-01 Thread Mike Orr
ng why.)This could theoretically go either way, doing either the same thing as os.path.join, getting a little smarter, or doing "safe" joins by disallowing "/" embedded in string arguments. I would say that a directory-tuple Path object with these features could be maintaine

Re: [Python-3000] Path Reform: Get the ball rolling

2006-11-01 Thread Mike Orr
object. If the root is chopped off it becomes a relative path. > I would argue that both paths and query strings are passive, whereas > tables and file systems are, if not exactly lively, at least more > 'actor-like' than paths or queries. I can see your point. The only reason I went with a "monolithic" OO class is because that's what all the proposals have been for the past three years until last month, and I didn't think another way was possible or desirable. -- Mike Orr <[EMAIL PROTECTED]> ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Re: [Python-3000] Path Reform: Get the ball rolling

2006-11-01 Thread Mike Orr
vein, the os.path.is* and os.path.get* functions are an improvement. However, there is one good thing about stat(): P.stat().mtime and P.lstat().mtime look a lot better than P.mtime() and P.lmtime() -- especially considering the two dozen other functions/methods that would accompany the latter

Re: [Python-3000] Path Reform: Get the ball rolling

2006-10-31 Thread Mike Orr
path classes * 3 platforms). Functions would cut down the need for multiple classes and duplicated methods between them, but functions would make "subclassing Path" more difficult. I would like to see one or more implementations tested and widely used as soon as possible, so that we'd have confidence using them in our programs until a general Python solution emerges. But first we need to see if we can achieve a common API, as Talin started this thread saying. -- Mike Orr <[EMAIL PROTECTED]> ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com