Re: [Python-Dev] Py2.6 ideas

2007-03-17 Thread Edward Loper
Sorry, forgot to include the output of doctest_driver.py --help. Here it is: -Edward Usage: doctest_driver.py [options] NAME ... Options: --version show program's version number and exit -h, --helpshow this help message and exit Actions (default=check):

Re: [Python-Dev] Py2.6 ideas

2007-03-17 Thread Edward Loper
On Feb 15, 2007, at 2:59 PM, Raymond Hettinger wrote: * Enhance doctest with a method that computes updated doctest results. If the only change I make to a matrix suite is to add commas to long numbers in the matrix repr(), then it would be nice to have an automated way to update the

Re: [Python-Dev] xturtle.py a replacement for turtle.py(!?) ATTENTION PLEASE!

2006-06-29 Thread Edward Loper
Gregor Lingl wrote: Yes,, and I have some ideas in this respect, but mainly a prioncipal question. I read about using doctest and unittest, but how does one devise automatic test suites for graphical output. In the end it depends on how it looks like. There are a few options here.. Two

Re: [Python-Dev] correction of a bug

2006-05-14 Thread Edward Loper
draconux wrote: Hello all , string.lstrip(source/old_prog,source/) return ld_prog instead of old_prog You are misunderstanding what the second argument to lstrip does. It is interpreted as a list of characters; and lstrip will remove the maximal prefix of the string that consists of

Re: [Python-Dev] total ordering.

2006-05-11 Thread Edward Loper
Guido van Rossum wrote: On 5/11/06, Vladimir 'Yu' Stepanov [EMAIL PROTECTED] wrote: If for Python-3000 similar it will be shown concerning types str(), int(), complex() and so on, and the type of exceptions will strongly vary, it will make problematic redefinition of behavior of function of

Re: [Python-Dev] PEP 3101 Update

2006-05-08 Thread Edward Loper
Steven Bethard wrote: On 5/7/06, Edward Loper [EMAIL PROTECTED] wrote: Talin wrote: Braces can be escaped using a backslash: My name is {0} :-\{\}.format('Fred') Which would produce: My name is Fred :-{} Do backslashes also need to be backslashed

Re: [Python-Dev] PEP 3101 Update

2006-05-07 Thread Edward Loper
Talin wrote: Braces can be escaped using a backslash: My name is {0} :-\{\}.format('Fred') Which would produce: My name is Fred :-{} Do backslashes also need to be backslashed then? If not, then what is the translation of this:? r'abc\{%s\}' % 'x' I

Re: [Python-Dev] Alternative path suggestion

2006-05-06 Thread Edward Loper
On May 6, 2006, at 2:40 AM, Nick Coghlan wrote: Remember, the idea with portable path information is to *never* store os.sep and os.extsep anywhere in the internal data - those should only be added when needed to produce strings to pass to OS-specific functions or to display to users.

Re: [Python-Dev] PEP 3102: Keyword-only arguments

2006-05-01 Thread Edward Loper
Martin v. Löwis wrote: One reason I see is to have keyword-only functions, i.e. with no positional arguments at all: def make_person(*, name, age, phone, location): pass which also works for methods: def make_person(self, *, name, age, phone, location): pass In

Re: [Python-Dev] PEP 3102: Keyword-only arguments

2006-05-01 Thread Edward Loper
Fred L. Drake, Jr. wrote: On Sunday 30 April 2006 22:50, Edward Loper wrote: I see two possible reasons: Another use case, observed in the wild: - An library function is written to take an arbitrary number of positional arguments using *args syntax. The library is released

Re: [Python-Dev] PEP 3102: Keyword-only arguments

2006-05-01 Thread Edward Loper
Fredrik Lundh wrote: And again, why would you *make* me, the user-programmer, type make_person(name=namex, age=agex, phone=phonex, location = locationx) #instead of make_person(namex,agex,phonex,locationx) ? because a good API designer needs to consider more than just the current

Re: [Python-Dev] signature object issues (to discuss while I am out of contact)

2006-05-01 Thread Edward Loper
Brett Cannon wrote: The second question is whether it is worth providing a function that will either figure out if a tuple and dict representing arguments would work in calling the function. Some have even suggested a function that returns the actual bindings if the call were to occur.

Re: [Python-Dev] [Python-3000] in-out parameters

2006-04-30 Thread Edward Loper
Rudy Rudolph wrote: 2) pass-by-reference: def f(wrappedParam): wrappedParam[0] += 5 # ugh return this is my result # call it x = 2 result = f([x]) # also ugly, but x is now 7 This example is broken; here's what you get when you run it: def

Re: [Python-Dev] PEP 3102: Keyword-only arguments

2006-04-30 Thread Edward Loper
Terry Reedy wrote: There are two subproposals: first, keyword-only args after a variable number of positional args, which requires allowing keyword parameter specifications after the *args parameter, and second, keyword-only args after a fixed number number of positional args, implemented

Re: [Python-Dev] Crazy idea for str.join

2006-04-29 Thread Edward Loper
Josiah Carlson wrote: [...] get str.join to support objects which implement the buffer interface as one of the items in the sequence? Something like: y = 'hello world' buf1 = buffer(y, 0, 5) buf2 = buffer(y, 6) print ''.join([buf1, buf2]) should print helloworld

Re: [Python-Dev] Crazy idea for str.join

2006-04-29 Thread Edward Loper
Nick Coghlan wrote: Edward Loper wrote: This is incompatible with the recent proposal making str.join automatically str-ify its arguments. i.e.: ''.join(['a', 12, 'b']) - 'a12b'. I don't feel strongly about either proposal, I just thought I'd point out that they're mutually exclusive

Re: [Python-Dev] Must objects with __enter__/__exit__ also supply __context__?

2006-04-27 Thread Edward Loper
Nick Coghlan wrote: OTOH, if the two protocols are made orthogonal, then it's clear that the manager is always the original object with the __context__ method. Then the three cases are: - a pure context manager (only provides __context__) - a pure managed context (only provides

Re: [Python-Dev] Python Library Reference top page too long

2006-03-16 Thread Edward Loper
Martin v. Löwis wrote: Edward C. Jones wrote: The contents page for the Python Library Reference (http://docs.python.org/dev/lib/lib.html;) has become much too long. I disagree. It serves my purposes very well: I usually search in the page for a keywork I think should be there. If the page

Re: [Python-Dev] [Doc-SIG] that library reference, again

2006-01-27 Thread Edward Loper
Robey Pointer wrote: On 30 Dec 2005, at 18:29, Christopher Armstrong wrote: [epydoc] is not really even good enough for a lot of my usage without some seriously evil hacks. The fundamental design decision of epydoc to import code, plus some other design decisions on the way it figures types