Re: Single type for __builtins__ in Py3.0

2005-09-23 Thread Michael Hoffman
Collin Winter wrote: > If possible, I'd like to see this go in before 3.0. +1 -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Overloading __init__ & Function overloading

2005-09-30 Thread Michael Hoffman
baseclass.__init__(arg) This is an example of polymorphism generally, not overloading. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

unittest and non-.py files

2005-12-07 Thread Michael Hoffman
oad_source() compiles the script first, making a file called "polysubc" which I do not want. Is there a better solution? And even if there is a better solution, can you please tell me of a way to load the script as a module without generating the "polysubc" file? No points for tellin

Re: unittest and non-.py files

2005-12-08 Thread Michael Hoffman
[Michael Hoffman] >>Hi. I am trying to use unittest to run a test suite on some >>scripts that do not have a .py extension. [Sybren Stuvel] > I'd move the functionality of the script into a separate file that > does end in .py, and only put the invocation into the .py-less

Re: Recent infoworld column

2005-01-09 Thread Michael Hoffman
look up who Rasmus Lerdorf was... -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: shutil.move has a mind of its own

2005-01-11 Thread Michael Hoffman
on of code? What version of Python are you using? Is it the standard Windows distribution? -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] 20050112 while statement

2005-01-13 Thread Michael Hoffman
Xah Lee wrote: # here's a while statement in python. > [...] > # here's the same code in perl [...] So? -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: query python env

2005-01-14 Thread Michael Hoffman
ions are installed in different directories. What problems are you having? -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Python.org, Website of Satan

2005-01-14 Thread Michael Hoffman
except herror: hostname = "NONE" print hostname, ip_address break -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: query python env

2005-01-14 Thread Michael Hoffman
Steve Holden wrote: I suspect rather that the OP is looking for os.environ, as in: He was using the examples of PYTHONHOME and PYTHONPATH which have specific meanings. Using sys.prefix is better than os.environ["PYTHONHOME"], which is unlikely to be set. -- Michael Hoffm

Re: Python.org, Website of Satan

2005-01-14 Thread Michael Hoffman
Denis S. Otkidach wrote: Certainly, it can be done more efficient: Yes, of course. I should have thought about the logic of my code before posting. But I didn't want to spend any more time on it than I had to. ;-) -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: How to del item of a list in loop?

2005-01-15 Thread Michael Hoffman
RE_FAST 1 (i) 72 JUMP_ABSOLUTE9 With the other methods, when you find a false result, all you have to do is the JUMP_ABSOLUTE. That saves you some time over several million repetitions. Well, that was longer than I thought it would be. HTH. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Pointer or unique id

2005-01-15 Thread Michael Hoffman
ast): File "", line 1, in ? TypeError: list objects are unhashable -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: What strategy for random accession of records in massive FASTA file?

2005-01-15 Thread Michael Hoffman
defline_old = self._defline else: lines.append(line.rstrip()) return defline_old, ''.join(lines) blastdb.py: #!/usr/bin/env python from __future__ import division __version__ = "$Revision: 1.3 $" """ blastdb.py access blastdb f

Re: deleting from tarfile

2005-01-15 Thread Michael Hoffman
Uwe Mayer wrote: is it possible to delete a file from a tar-archive using the tarfile module? The tarlib.py in pyNMS claims to be able to do it. It doesn't use the tarfile module, though. http://cvs.sourceforge.net/viewcvs.py/pynms/pyNMS/lib/tarlib.py?rev=1.1.1.1&view=auto -- Michae

Re: How to del item of a list in loop?

2005-01-15 Thread Michael Hoffman
k yourself and it will be in exactly the format you want. Give me a break. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: How to del item of a list in loop?

2005-01-16 Thread Michael Hoffman
bined edification. I would have been considerably less annoyed if you had done that and explained why it is better rather than nitpicking my version. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: List problems in C code ported to Python

2005-01-16 Thread Michael Hoffman
Lucas Raab wrote: Please see both the Python and C code at http://home.earthlink.net/~lvraab. The two files are ENIGMA.C and engima.py If you post a small testcase here you are much more likely to get helped. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: List problems in C code ported to Python

2005-01-16 Thread Michael Hoffman
Paul McGuire wrote: So "A" == 'a' is true in Python, not true in C. >>> "A" == 'a' False I think you meant: >>> "A" == "A" True -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: List problems in C code ported to Python

2005-01-16 Thread Michael Hoffman
ur web site and make some suggestions. If you had written a better question I guarantee you would have had more people answering your question sooner. Oh yeah, and: http://www.catb.org/~esr/faqs/smart-questions.html#not_losing -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: List problems in C code ported to Python

2005-01-16 Thread Michael Hoffman
Michael Hoffman wrote: Paul McGuire wrote: So "A" == 'a' is true in Python, not true in C. I think you meant: >>> "A" == "A" True Er, "A" == 'A' -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: how to find site-packages path

2005-01-17 Thread Michael Hoffman
hould do most of the work for you. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: is there better 32 clock() timing?

2005-01-23 Thread Michael Hoffman
entation. You could probably get a slight speedup by using "from time import clock" and then just clock(). -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: What is print? A function?

2005-01-23 Thread Michael Hoffman
once in the entire run of your program, not every time you call the debug() function (which is presumably many times). -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: regarding popen function

2005-06-19 Thread Michael Hoffman
Peter Hansen wrote: > Michael, tai64nlocal is a program that converts a special "packed" > timestamp to human-readable form. Thanks Peter. I was asking somewhat rhetorically but I have a love of UNIX arcana and now I know. :) -- Michael Hoffman -- http://mail.python.org/

Re: Why is there no instancemethod builtin?

2005-06-19 Thread Michael Hoffman
John Roth wrote: > you need _both_ isinstance and the types module to do a correct > check for any string type: isinstance(fubar, types.StringTypes). > That's because both string and unicode are subtypes of one base. But basestring, their base class is a built-in. -- Michael Ho

Re: Using print with format to stdout generates unwanted space

2005-06-20 Thread Michael Hoffman
Paul Watson wrote: > While printf() does tightly control formatting in C, it does not in > Python. There is no printf() in Python. You should not think of print as being a Python version of printf. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Using print with format to stdout generates unwanted space

2005-06-21 Thread Michael Hoffman
ackspace character. > If you feed this output to another program, chances are it will > not treat as no space at all. > > I prefer building up a list and doing ' '.join(thelist) in these situations. A much better approach. Or you can use sys.stdout.write() as others have

Re: Loop until condition is true

2005-06-22 Thread Michael Hoffman
ggs. You apparently don't know how to do it without getting egg on your face. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: how to use more than 1 __init__ constructor in a class ?

2005-06-22 Thread Michael Hoffman
__init__(self, x, y) > self.z = z > #-- Well for the example you used, multiple constructors are not needed. This will get you the same result as what I imagine you wanted the first example to do: class myPointClass: def __init__(self, x=0, y=0, z=0): self.x = x

Re: PEP ? os.listdir enhancement

2005-06-22 Thread Michael Hoffman
Peter Hansen wrote: > Using Jason Orendorff's "path" module, all this code basically collapses > down to this beauty (with your variable "path" renamed to myPath to > avoid a name collision): This has to be the non-stdlib library I use the most. It

Re: Loop until condition is true

2005-06-23 Thread Michael Hoffman
understand why this isn't in 2.4 Because it would break existing code. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop until condition is true

2005-06-23 Thread Michael Hoffman
o True or False, mainly as a compatibility measure for the days before they were built-ins. If you try assigning None, CPython will refuse to compile the module, even if the code where None is assigned is unreachable. If there was ever a good reason to assign to None, I don't know it. -- M

Re: Loop until condition is true

2005-06-23 Thread Michael Hoffman
Antoon Pardon wrote: > Op 2005-06-22, Michael Hoffman schreef <[EMAIL PROTECTED]>: > >>Remi Villatel wrote: >> >>>Fredrik Lundh wrote: >>> >>>>checking if a logical expression is true by comparing it to True is bad >>>>style, an

Re: Listening for a Keypress (Console, not GUI)

2005-06-23 Thread Michael Hoffman
.html#how-do-i-check-for-a-keypress-without-blocking -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: super problem

2005-06-25 Thread Michael Hoffman
avior using a dummy class. If you try to create a self-contained testcase, you will have an easier time figuring where the problem is. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: a dictionary from a list

2005-06-25 Thread Michael Hoffman
ing featurism. Is this actually useful in real code? Personally, I use it all the time. It's a much more convenient literal for a dictionary. And before it was introduced I used this utility function: def mkdict(**kwargs): return kwargs -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Modules for inclusion in standard library?

2005-06-27 Thread Michael Hoffman
Robert Kern wrote: > I would like to see the setuptools/PythonEggs/EasyInstall trifecta get > more attention and eyeballs. Once it is mature, I think that it will > obviate the desire for stdlibification of most of the packages being > requested here. Looks pretty cool! -- Mic

Re: Set/Get attribute syntatic sugar

2005-06-28 Thread Michael Hoffman
> I think he means something like this: > e = 'i_am_an_attribute' > o.(e) = 10 > o.i_am_an_attribute == 10 I always use the getattr() and setattr() built-ins which could be considered syntactic sugar when compared to the alternatives above. But that's all the syntactic sugar you need--any more will give you cancer of the semicolon. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-28 Thread Michael Hoffman
nsophisticated and dumb? > > Be blunt. We Americans need to know. To be blunt, I have no idea what this has to do with Python. Surely selecting the right forum to use indicates more sophistication and high intelligence than the way one speaks. ;-) -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-28 Thread Michael Hoffman
muldoon wrote: > Michael Hoffman wrote: >>muldoon wrote: >> >>>Americans consider having a "British accent" a sign of sophistication >>>and high intelligence. Many companies hire salespersons from Britain to >>>represent their products,etc. Qu

Re: strange __call__

2005-06-29 Thread Michael Hoffman
The original function a(x) will still be stored as a closure in what is returned from b(). If this is of purely academic interest then the answer is I don't know. :) -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: How to compare two directories?

2005-06-29 Thread Michael Hoffman
may help, but I wonder if there is a ready-to-use function in python > libs? That's a good start. Why doesn't dircmp work for you? -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Set/Get attribute syntatic sugar

2005-06-29 Thread Michael Hoffman
n't understand the original question either until Robert Kern guessed what the OP was talking about. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Michael Hoffman
trangely enough there are Brits who pronounce "hotel" without an H at the beginning. And even those who pronounce it with an H sometimes say "an hotel" rather than "a hotel" because it used to be pronounced starting with the vowel! Similarly, the Brits should

Re: How to compare two directories?

2005-06-30 Thread Michael Hoffman
could ildg wrote: > I found dircmp compare only the direct dirs and files, > and it will not do anything to the sub-directories. The documentation for dircmp.report_full_closure() disagrees with you. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

No sys.ps2 in IDLE (was Re: question)

2005-07-03 Thread Michael Hoffman
; > > where is the problem? The problem is that you are using IDLE (and an old version at that), which doesn't use sys.ps2. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: No sys.ps2 in IDLE (was Re: question)

2005-07-03 Thread Michael Hoffman
shisa wrote: > What should I do to correct the errors accordingly? What error? IDLE appears to be behaving as designed. Also, please don't top-post--it makes responding to your message in a way that others can understand more difficult. http://en.wikipedia.org/wiki/Top-posting --

Re: question about raw_input

2005-07-03 Thread Michael Hoffman
with PyScripter, not Python. You'd be better off asking the PyScripter people than asking here. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: looping over a big file

2005-07-03 Thread Michael Hoffman
in data: > whatever > finally: > data.close() > > Guido has made a pronouncement on open vs. file. I think he prefers > open for opening files, and file for type testing, but may well be > wrong. I don't think it's critical. He has said tha

Re: "long int..." exception reported with strange traceback location

2005-07-04 Thread Michael Hoffman
h a simpler testcase. Strangely, the exception occurs in the statement *following* the os.utime() call: >>> import os, sys >>> os.utime("foo_test_file", (0, float(sys.maxint+1))) >>> print "hi" OverflowError: long int too large to convert to int Loo

Re: readline: edit-and-execute-command

2005-07-05 Thread Michael Hoffman
might just be added for bash. That said, this would be very useful. You should submit an RFE on the Sourceforge tracker. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: f*cking re module

2005-07-05 Thread Michael Hoffman
Greg Lindstrom wrote: > I hear that Perl 6 is > going to have a rewrite of regular expressions; it will be interesting > to see what their hard work produces. From what I saw a while ago, it didn't look like it would be any simpler or more elegant. But that was a while ag

Re: More On - deepcopy, Tkinter

2005-07-05 Thread Michael Hoffman
l the advice applies to you, feel free to ignore it, but you clearly haven't been getting the results from this forum that you expected. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Strange os.path.exists() behaviour

2005-07-06 Thread Michael Hoffman
Jeff Epler wrote: > Here's the bug. You're using Windows. QOTW (speaking as someone who is using Windows right now). -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Inheritance/Late Private Binding

2005-07-06 Thread Michael Hoffman
e you don't seem to have anything callable named ctor. As for the constructor, just call it __init__, it will avoid confusion with __new__. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Forum

2005-07-10 Thread Michael Hoffman
Throne Software wrote: > Throne Software has opened up a Python Forum at: > > http://www.thronesoftware.com/forum/ > > Join us! Why shouldn't I just stay here? -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: **kwargs?

2005-07-13 Thread Michael Hoffman
gs *x and **y instead, but they will still act just like *args and **kwargs. The stars are magic, not the names. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Who uses input()? [was Re: question on "input"]

2005-07-14 Thread Michael Hoffman
to get this deprecated but Guido disagreed. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: HTML expect in python

2005-07-16 Thread Michael Hoffman
D H wrote: > See the mechanize module: http://wwwsearch.sourceforge.net/mechanize/ I second this, a very useful module. I've unfortunately had to change it a little to deal with inevitably bad HTML supplied by web sites. -- Michael Hoffman -- http://mail.python.org/mailman/listinf

Re: beginner question fibonacci

2005-07-17 Thread Michael Hoffman
our existing a and b "a0" and "b0", and the next a and b "a1" and "b1". When you do a, b = b, a+b you are assigning: a1 = b0 b1 = a0 + b0 But when you use separate statements, you are assigning: a1 = b0 b1 = a1 + b0 = b0 + b0 = 2*b0 -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: What does "::" mean?

2005-07-21 Thread Michael Hoffman
is. > > Well, that part's easy at least: > > live[::-1] > > :-) And so the circle is complete ... What about reversed(live)? Or if you want a list instead of an iterator, list(reversed(live))? -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

PEP on path module for standard library

2005-07-21 Thread Michael Hoffman
in more of my modules and scripts than any other third-party module, and I know it will be very helpful when I no longer have to worry about deploying it. Thanks in advance, -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: is this pythonic?

2005-07-21 Thread Michael Hoffman
what the function signature for enumerate() was when that is easy to Google, then I would think they were wasting everyone's time. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Overriding a built-in exception handler

2005-07-21 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > I've Read-TFM, but I only see good info on how to create my own class > of exception; I don't see anything on how to override an existing > exception handler. You need to read the tutorial on handling exceptions: http://docs.python.org/tut/node

Re: PEP on path module for standard library

2005-07-21 Thread Michael Hoffman
just notified Jason about this. I presume a solution like mine > will be used, and look forward to seeing Jason's module in stdlib. This sounds like a bug in "freeze" rather than something that should be worked around in the standard library. Although there have already been people opposed to naming it path because the duplication with os.path might confuse humans. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between " and '

2005-07-21 Thread Michael Hoffman
John Machin wrote: > [EMAIL PROTECTED] wrote: > >> Can someone tell me the difference between single quote and double >> quote? > > >>> ord("'") - ord('"') > 5 Very zen. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-21 Thread Michael Hoffman
Reinhold Birkenfeld wrote: > Michael Hoffman wrote: > >>Having path descend from str/unicode is extremely useful since I can >>then pass a path object to any function someone else wrote without >>having to worry about whether they were checking for basestring. I think

Re: PEP on path module for standard library

2005-07-21 Thread Michael Hoffman
Java hackers here want to tell us of the wonders of the Java Path class? I would be interested in seeing how other OO languages deal with paths. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between " and '

2005-07-22 Thread Michael Hoffman
Steven D'Aprano wrote: > Michael Hoffman wrote: > >> John Machin wrote: >> >>> [EMAIL PROTECTED] wrote: >>> >>>> Can someone tell me the difference between single quote and double >>>> quote? >>> >>> >&g

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
Stefan Rank wrote: > on 22.07.2005 00:21 Michael Hoffman said the following: >> Any Java hackers here want to tell us of the wonders of the Java Path >> class? > > no such thing exists. > > there is only the `File` class that incorporates a little bit of the > `p

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
whether they were checking for basestring. I think there is a widely used pattern of accepting either a basestring[1] or a file-like object as a function argument, and using isinstance() to figure out which it is. What do you gain from removing these methods? A smaller dir()? [1] Probabl

Re: dictionary that discards old items

2005-07-22 Thread Michael Hoffman
that does this, but I cant remember > where I read about it. Can anyone enlighten me? You want a Least Recently Used, or LRU, cache. Here's one: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252524 Google for to find others. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Returning histogram-like data for items in a list

2005-07-22 Thread Michael Hoffman
s a histogram): > > i.e.: > > L2 = [(1,3),(2,2),(3,1)] >>> import itertools >>> L1 = [1,1,1,2,2,3] >>> L2 = [(key, len(list(group))) for key, group in itertools.groupby(L1)] >>> L2 [(1, 3), (2, 2), (3, 1)] -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with string

2005-07-22 Thread Michael Hoffman
Tzanko Tzanev wrote: > #but there is an error in > playlist_txt += mp3id + mp3_title + mp3_artist It'd be a lot easier to help if you'd say what the error was. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
make people's lives easier. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: dictionary that discards old items

2005-07-22 Thread Michael Hoffman
hich one it is you want. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: time.time() under load between two machines

2005-07-22 Thread Michael Hoffman
nder intense CPU load. How negative are we talking about? What platforms are you using? -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterators from urllib2

2005-07-22 Thread Michael Hoffman
#x27;, 'fp', > 'geturl', 'headers', 'info', 'read', 'readline', 'url'] > Traceback (most recent call last): > File "CSVParser.py", line 144, in ? > print parseQHost(circuits[cktname], cktname) > File "CSVParser.py", line 126, in parseQHost > r = csv.DictReader(ifs, fieldlist) > File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/csv.py", line 100, in __init__ > self.reader = reader(f, dialect, *args) > TypeError: argument 1 must be an iterator > > Whoa! Where did the __iter__, readlines, and next attributes go? Ideas? Works for me on Python 2.4.1. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
h the current path implementation, this Just Works. If I were using something that parsed and understood paths, the scp/rcp convention of host:filename would either cause an error or have to be programmed in separately. The current implementation is much more flexible. What are the practical

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
tring. Mainly, that you can use it anywhere a basestring would be used today and it Just Works. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: return None

2005-07-22 Thread Michael Hoffman
tion() What do you want to be in a, if not None? -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
ile systems have something to do with the > encoding? So D: (a FAT drive) might naturally be str, while C: > (an NTFS drive) might naturally be unicode. The current path module handles these situations at least as well as the libraries that come with Python do. ;-) -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
Peter Hansen wrote: > When files are opened through a "path" object -- e.g. > path('name').open() -- then file.name returns the path object that was > used to open it. Also works if you use file(path('name')) or open(path('name')). -- M

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
new users will not try to use a Path instance where a string is > needed, just as you wouldn't try to pass a list where a string is wanted. But many functions were written expecting lists as arguments but also work for strings, and do not require an explicit list(mystring) before calling the function. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
hen I informed him of it. I'd love to hear what he had to say about the design. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: "Aliasing" an object's __str__ to a different method

2005-07-22 Thread Michael Hoffman
that a class implements special method names, but doesn't make it very clear that an object can't always override them. If you redirect to a second method you can overwrite on the instance, I think you will get the results you want. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP on path module for standard library

2005-07-22 Thread Michael Hoffman
line, which is convenient, but strange. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: [path-PEP] Path inherits from basestring again

2005-07-24 Thread Michael Hoffman
se methods to start with. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: FAQ?

2005-07-24 Thread Michael Hoffman
nce slicing has little to do with the newsgroup. A more general Python FAQ will be more helpful. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: [path-PEP] Path inherits from basestring again

2005-07-24 Thread Michael Hoffman
7;s a string method with that name. Instead it's path.joinpath(). This is a nuisance, but changing the semantics of base class methods is worse. (I know, I tried it.) The same goes for split(). """ It ain't broke. Please stop breaking it. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: FAQ?

2005-07-24 Thread Michael Hoffman
Keith P. Boruff wrote: > Michael Hoffman wrote: >> Keith P. Boruff wrote: >>> Is there an FAQ available specific to this NG as I'm sure some of the >>> list slicing questions I have have been asked before. >> >> Try Google for . > > I tried and

Re: Try this

2005-07-24 Thread Michael Hoffman
al message instead of making a new post. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: [path-PEP] Path inherits from basestring again

2005-07-24 Thread Michael Hoffman
or design principles and discussion here: http://wiki.python.org/moin/PathClass -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: [path-PEP] Path inherits from basestring again

2005-07-25 Thread Michael Hoffman
Reinhold Birkenfeld wrote: > * Add base() method for converting to str/unicode. +1 -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: [path-PEP] Path inherits from basestring again

2005-07-25 Thread Michael Hoffman
y and always use joinpath(). Personally, I'm -0 on __div__, but I suppose if anyone here claimed to have used in the past, rather than it just being some novelty that might be a good idea, that would be good enough for keeping it. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Path PEP: What should Path(None) do?

2005-07-25 Thread Michael Hoffman
Currently it returns Path('None'). This means I have to do a check on input before pathifying it to make sure it is not None. Perhaps it should throw ValueError? -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Emacs skeletons

2005-07-26 Thread Michael Hoffman
Does anyone have any Emacs skeletons they find useful for Python? I Googled a little but didn't find anything enticing. I already have a script that sets up script/module templates, so those aren't all that useful. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Emacs skeletons

2005-07-26 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: > Michael> Does anyone have any Emacs skeletons they find useful for > Michael> Python? > > What's an "Emacs skeleton"? Somewhat of an elaborate mini-language for inserting boilerplate. http://www.emacswiki.org/cgi-bin/emacs-en

Re: Emacs skeletons

2005-07-26 Thread Michael Hoffman
use pdb from the commandline instead these days, with 'alias pdb="python -m pdb"' in my .bashrc. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   >