Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-02 Thread Mike Klaas
On 2-May-08, at 11:23 PM, Scott David Daniels wrote: Mike Klaas wrote: ... A common pattern for me is to replace an instances method with a lambda to add monitoring hooks or disable certain functionality: inst.get_foo = lambda: FakeFoo() This is not replacable in one line with a def (or witho

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-02 Thread Scott David Daniels
Mike Klaas wrote: ... A common pattern for me is to replace an instances method with a lambda to add monitoring hooks or disable certain functionality: inst.get_foo = lambda: FakeFoo() This is not replacable in one line with a def (or without locals() detritius). Assuming this is good style,

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-02 Thread Brett Cannon
On Sat, May 3, 2008 at 1:03 AM, Terry Reedy <[EMAIL PROTECTED]> wrote: > Some people write > somename = lambda args: expression > instead of the more obvious (to most people) and, dare I say, standard > def somename(args): return expression > > The difference in the result (the only one I

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-02 Thread Alex Martelli
On Fri, May 2, 2008 at 4:11 PM, Jesse Noller <[EMAIL PROTECTED]> wrote: > +1 from me +2 from me -- of all abuses of lambdas, this one's the worst. Alex ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

[Python-Dev] AST Optimization: Branch Elimination in Generator Functions

2008-05-02 Thread Thomas Lee
The next problem that cropped up during the implementation of the AST code optimizer is related to branch elimination and the elimination of any code after a return. Within a FunctionDef node, we would (ideally) like to blow away If nodes with a constant - but false - test expression. e.g.:

Re: [Python-Dev] Detecting 64bit Windows (was RE: Reminder: last alphas next Wednesday 07-May-2008)

2008-05-02 Thread Mark Hammond
> > OK - I'll make a patch for this tomorrow (unless someone pipes up > > suggesting it's not a great idea, or that ctypes should be used, etc) > > I'd like to pipe that up. I thought you might. > It sounds like clutter of the sys module to > me. Fair enough - but no more than getwindowsversion

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-02 Thread Jeff Hall
+1 For what it's worth from a newbie ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

[Python-Dev] AST Optimization: Branch Elimination in Generator Functions

2008-05-02 Thread Thomas Lee
The next problem that cropped up during the implementation of the AST code optimizer is related to branch elimination and the elimination of any code after a return. Within a FunctionDef node, we would (ideally) like to blow away If nodes with a constant - but false - test expression. e.g.:

Re: [Python-Dev] [Python-3000] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread skip
Fred> If user-local package installs went to ~/ by default ... with a Fred> way to set an alternate "prefix" instead of ~/ using a distutils Fred> configuration setting, I'd be happy enough. +1 from me. Skip ___ Python-Dev mailing list Pyth

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-02 Thread Mike Klaas
On 2-May-08, at 4:03 PM, Terry Reedy wrote: Some people write somename = lambda args: expression instead of the more obvious (to most people) and, dare I say, standard def somename(args): return expression The difference in the result (the only one I know of) is that the code and funct

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-02 Thread Jesse Noller
+1 from me On May 2, 2008, at 7:03 PM, "Terry Reedy" <[EMAIL PROTECTED]> wrote: Some people write somename = lambda args: expression instead of the more obvious (to most people) and, dare I say, standard def somename(args): return expression The difference in the result (the only one I k

Re: [Python-Dev] PEP 8: Discourage named lambdas?

2008-05-02 Thread Guido van Rossum
Agreed, I tend to pick these out of style reviews at Google. On Fri, May 2, 2008 at 4:03 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > Some people write > somename = lambda args: expression > instead of the more obvious (to most people) and, dare I say, standard > def somename(args): retur

[Python-Dev] PEP 8: Discourage named lambdas?

2008-05-02 Thread Terry Reedy
Some people write somename = lambda args: expression instead of the more obvious (to most people) and, dare I say, standard def somename(args): return expression The difference in the result (the only one I know of) is that the code and function objects get the generic name '' instead of

Re: [Python-Dev] Special offer! Ten code reviews

2008-05-02 Thread Christian Heimes
Guido van Rossum schrieb: > I'd like to get some more people trying out codereview.appspot.com, so > I'm offering the first 10 people to submit a new patch there for my > review to do the review by Monday. Oh gosh! As I read the title I was hoping for a free beer or a signed Guido photography for

Re: [Python-Dev] [Python-3000] Invitation to try out open source code review tool

2008-05-02 Thread Guido van Rossum
On Fri, May 2, 2008 at 2:28 PM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > One more question: What's the number on the upper right hand corner by > my username? It's a debugging counter. It gets reset each time a new service instance is created. -- --Guido van Rossum (home page: http://www

Re: [Python-Dev] tracker issues? server error

2008-05-02 Thread Brett Cannon
On Fri, May 2, 2008 at 12:17 AM, Gregory P. Smith <[EMAIL PROTECTED]> wrote: > trying to update a bug I get: > > Fri May 2 07:17:17 2008: An error occurred. Please check the server log for > more infomation. > Issues like this should go to the meta-tracker. Fail that, mail tracker-discuss. But I

Re: [Python-Dev] [Python-3000] Invitation to try out open source code review tool

2008-05-02 Thread Benjamin Peterson
On Fri, May 2, 2008 at 4:25 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > My request at the moment is to let people use their real names for > > display; my email address does not at all resemble my name. > > I've noticed. Surely there's an interesting story there. :-) Maybe I tell you

Re: [Python-Dev] [Python-3000] Invitation to try out open source code review tool

2008-05-02 Thread Guido van Rossum
On Fri, May 2, 2008 at 2:09 PM, Benjamin Peterson <[EMAIL PROTECTED]> wrote: > On Thu, May 1, 2008 at 11:41 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > Some of you may have seen a video recorded in November 2006 where I > > showed off Mondrian, a code review tool that I was developing fo

Re: [Python-Dev] [Python-3000] Invitation to try out open source code review tool

2008-05-02 Thread Benjamin Peterson
On Thu, May 1, 2008 at 11:41 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Some of you may have seen a video recorded in November 2006 where I > showed off Mondrian, a code review tool that I was developing for > Google (http://www.youtube.com/watch?v=sMql3Di4Kgc). I've always hoped > that I

Re: [Python-Dev] Module Suggestion: ast

2008-05-02 Thread Paul Moore
2008/5/2 Georg Brandl <[EMAIL PROTECTED]>: > Paul Moore schrieb: > > Excuse my confusion over process, but if this is to go into 2.6, does > > that mean it needs to be ready before the first beta? Or is there a > > more relaxed schedule for the stdlib (and if so, what is the deadline > > for the st

[Python-Dev] Special offer! Ten code reviews

2008-05-02 Thread Guido van Rossum
I'd like to get some more people trying out codereview.appspot.com, so I'm offering the first 10 people to submit a new patch there for my review to do the review by Monday. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev

Re: [Python-Dev] Problems with the new super()

2008-05-02 Thread Larry Hastings
Barry Warsaw wrote: I think of all the alternatives in PEP 3135, I'd probably prefer self.__super__.foo(), except that I'd call it self.super.foo(). I'm not sure that's sufficient. You need to be able to specify a class when using MI. I'd prefer self.super().foo(). self.super() would take

Re: [Python-Dev] [Python-3000] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread glyph
On 05:53 pm, [EMAIL PROTECTED] wrote: On May 1, 2008, at 7:54 PM, Barry Warsaw wrote: Interesting. I'm of the opposite opinion. I really don't want Python dictating to me what my home directory should look like (a dot file doesn't count because so many tools conspire to hide it from me).

Re: [Python-Dev] [Python-3000] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Bill Janssen
> Windows and Mac OS X have dedicated directories for application specific > libraries. That is ~/Library on Mac and Application Data on Windows. In fact, I had to write code for this, and had to read the specs for each. Here's the code (I've substituted Python for UpLib): if sys.platform == 'dar

Re: [Python-Dev] [Python-3000] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Fred Drake
On May 1, 2008, at 7:54 PM, Barry Warsaw wrote: Interesting. I'm of the opposite opinion. I really don't want Python dictating to me what my home directory should look like (a dot file doesn't count because so many tools conspire to hide it from me). I guess there's always $PYTHONUSERBASE

Re: [Python-Dev] Detecting 64bit Windows (was RE: Reminder: last alphas next Wednesday 07-May-2008)

2008-05-02 Thread Martin v. Löwis
> Sorry, my bad, yes, the platform.architecture() is helpful, the only problem > is that I'd rather settle for a sort of standardized nomenclature for this. > Both platforms use the win32 API, so would Windows XP be win32-32 and x64 be > win32-64 or something like that? We settled that the archite

Re: [Python-Dev] Detecting 64bit Windows (was RE: Reminder: last alphas next Wednesday 07-May-2008)

2008-05-02 Thread Martin v. Löwis
> OK - I'll make a patch for this tomorrow (unless someone pipes up > suggesting it's not a great idea, or that ctypes should be used, etc) I'd like to pipe that up. It sounds like clutter of the sys module to me. Isn't there some environment variable you can look at? Some registry key? Regards,

Re: [Python-Dev] Optimization of Python ASTs: How should we deal with constant values?

2008-05-02 Thread Martin v. Löwis
Thomas Lee wrote: > Martin v. Löwis wrote: >>> This leaves us with a few options: >>> >> >> 5. Reuse/Abuse Num(object) for arbitrary constants. >>AFAICT, this should work out of the box. >> >> > Eek. It *does* seem like Num would work out of the box, but would this > be a good idea? No

[Python-Dev] Summary of Tracker Issues

2008-05-02 Thread Tracker
ACTIVITY SUMMARY (04/25/08 - 05/02/08) Tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue number. Do NOT respond to this message. 1850 open (+29) / 12712 closed (+16) / 14562 total (+45) Open issues with patches: 560 Average durati

Re: [Python-Dev] Optimization of Python ASTs: How should we deal with constant values?

2008-05-02 Thread Thomas Lee
Martin v. Löwis wrote: This leaves us with a few options: 5. Reuse/Abuse Num(object) for arbitrary constants. AFAICT, this should work out of the box. Eek. It *does* seem like Num would work out of the box, but would this be a good idea? What about *replacing* Num with Const? Mig

Re: [Python-Dev] [Python-3000] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Nick Coghlan
Barry Warsaw wrote: > Time is running short to get any new features into Python 2.6 and 3.0. > The release after this one is scheduled to be the first beta release, at > which time we will institute a feature freeze. If your feature doesn't > make it in by then, you'll have to wait until 2.7/3.1.

Re: [Python-Dev] Should bytearray(b'a')[0] should 1-char or number?

2008-05-02 Thread Guido van Rossum
On Fri, May 2, 2008 at 2:47 AM, ocean <[EMAIL PROTECTED]> wrote: > # I tried to post this to bug tracker, but couldn't, so posted here... Was this because you can't figure out how to get a username, or because it was down? It's up now; to create a username, use this form: http://bugs.python.org/[E

Re: [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Guido van Rossum
I'm withdrawing my opposition in the light of the sheer number of words that have already been written with this. On Fri, May 2, 2008 at 1:30 AM, Christian Heimes <[EMAIL PROTECTED]> wrote: > Guido van Rossum schrieb: > > > I like this, except one issue: I really don't like the .local > > directo

[Python-Dev] warnings.showwarning (was Re: [Python-3000] Reminder: last alphas next Wednesday 07-May-2008)

2008-05-02 Thread Jean-Paul Calderone
On Thu, 1 May 2008 19:31:20 -0700, Brett Cannon <[EMAIL PROTECTED]> wrote: [snip] I just closed the release blocker I created (the backwards-compatibility issue with warnings.showwarning() ). I would like to add a PendingDeprecationWarning (or stronger) to 2.6 for showwarning() implementations

Re: [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Nick Coghlan
Phil Thompson wrote: On Friday 02 May 2008, Nick Coghlan wrote: Jeroen Ruigrok van der Werven wrote: -On [20080502 10:50], Steve Holden ([EMAIL PROTECTED]) wrote: Groan. Then everyone else realizes what a "great idea" this is, and we see ~/Perl/, ~/Ruby/, ~/C# (that'll scre

Re: [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Jeroen Ruigrok van der Werven
-On [20080502 14:49], Richard Boulton ([EMAIL PROTECTED]) wrote: >So, on Ubuntu computers at least, it seems likely that a $HOME/.local/ >directory will already exist, with the beginnings of a unix style layout >inside it. On my Ubuntu 8 box: [15:11] [EMAIL PROTECTED] (0) {0} % ls

Re: [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread glyph
On 11:01 am, [EMAIL PROTECTED] wrote: On Friday 02 May 2008, Nick Coghlan wrote: This sums up my opinion pretty well. Hidden by default, but easy to expose (e.g. via a local -> .local symlink) for the more experienced users that want it more easily accessible. But you can't be serious about

Re: [Python-Dev] Should bytearray(b'a')[0] should 1-char or number?

2008-05-02 Thread Amaury Forgeot d'Arc
On Fri, May 2, 2008 at 11:47 AM, ocean wrote: > # I tried to post this to bug tracker, but couldn't, so posted here... > > r62095 says > > >Fix and enable a skipped test: > >with python 2.6, enumerating bytes yields 1-char strings, not numbers. > > > >Don't merge this into the py3k branch. > >

Re: [Python-Dev] [Python-3000] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On May 2, 2008, at 1:48 AM, [EMAIL PROTECTED] wrote: etc, though. In the long term, if everyone followed suit on ~/.local, that would be great. But I don't want a ~/Python, ~/Java, ~/Ruby, ~/PHP, ~/Perl, ~/OCaml and ~/Erlang and a $PATH as long

Re: [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Phil Thompson
On Friday 02 May 2008, Nick Coghlan wrote: > Jeroen Ruigrok van der Werven wrote: > > -On [20080502 10:50], Steve Holden ([EMAIL PROTECTED]) wrote: > >> Groan. Then everyone else realizes what a "great idea" this is, and we > >> see ~/Perl/, ~/Ruby/, ~/C#

Re: [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Nick Coghlan
Jeroen Ruigrok van der Werven wrote: -On [20080502 10:50], Steve Holden ([EMAIL PROTECTED]) wrote: Groan. Then everyone else realizes what a "great idea" this is, and we see ~/Perl/, ~/Ruby/, ~/C# (that'll screw the Microsoft users, a directory with a comment market in its nam

[Python-Dev] Should bytearray(b'a')[0] should 1-char or number?

2008-05-02 Thread ocean
# I tried to post this to bug tracker, but couldn't, so posted here... r62095 says >Fix and enable a skipped test: >with python 2.6, enumerating bytes yields 1-char strings, not numbers. > >Don't merge this into the py3k branch. This is true for bytes, but not for bytearray. >>> bytearray(b'a'

Re: [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Christian Heimes
Jeroen Ruigrok van der Werven schrieb: > "Windows uses the Roaming folder for application specific data, such as > custom dictionaries, which are machine independent and should roam with the > user profile. The AppData\Roaming folder in Windows Vista is the same as the > Documents and Settings\user

Re: [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Jeroen Ruigrok van der Werven
-On [20080502 10:50], Steve Holden ([EMAIL PROTECTED]) wrote: >Groan. Then everyone else realizes what a "great idea" this is, and we see >~/Perl/, ~/Ruby/, ~/C# (that'll screw the Microsoft users, a directory with >a comment market in its name), ~/Lisp/ and the re

Re: [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Jeroen Ruigrok van der Werven
-On [20080502 11:00], Christian Heimes ([EMAIL PROTECTED]) wrote: >Windows and Mac OS X have dedicated directories for application specific >libraries. That is ~/Library on Mac and Application Data on Windows. The >latter is i18n-ed and called "Anwendungsdaten" in German. Fortun

Re: [Python-Dev] Detecting 64bit Windows (was RE: Reminder: last alphas next Wednesday 07-May-2008)

2008-05-02 Thread Jeroen Ruigrok van der Werven
-On [20080502 10:46], Mark Hammond ([EMAIL PROTECTED]) wrote: >OK - I'll make a patch for this tomorrow (unless someone pipes up >suggesting it's not a great idea, or that ctypes should be used, etc) Thanks. I am sure something like that might come in handy for our Python-using

Re: [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Christian Heimes
Steve Holden schrieb: > Nothing to say about OS X. > > One day Windows might start to respect the "hidden dot" convention, but > perhaps in the interim we could create a (Windows-hidden) ~/.private/? > Assuming we could work out where to put it ;-) Windows and Mac OS X have dedicated directories

Re: [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Steve Holden
Guido van Rossum wrote: I stand corrected on a few points. You've convinced me that ~/lib/ is wrong. But I still don't like ~/.local/; not in the last place because it's not any more local than any other dot files or directories. The "symmetry" with /usr/local/ is pretty weak, and certainly won't

[Python-Dev] Detecting 64bit Windows (was RE: Reminder: last alphas next Wednesday 07-May-2008)

2008-05-02 Thread Mark Hammond
> -On [20080502 07:57], Mark Hammond ([EMAIL PROTECTED]) wrote: > >The best way I can find for the win32 API to tell you this is a > combination > >of the above and the IsWow64Process() (which returns True if you are a > >32bit process on a 64bit platform) > > S

Re: [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Christian Heimes
Guido van Rossum schrieb: > I like this, except one issue: I really don't like the .local > directory. I don't see any compelling reason why this needs to be > ~/.local/lib/ -- IMO it should just be ~/lib/. There's no need to hide > it from view, especially since the user is expected to manage this

Re: [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Jeroen Ruigrok van der Werven
-On [20080502 07:57], Mark Hammond ([EMAIL PROTECTED]) wrote: >The best way I can find for the win32 API to tell you this is a combination >of the above and the IsWow64Process() (which returns True if you are a >32bit process on a 64bit platform) Support for IsWow64Process() is quite in

Re: [Python-Dev] Reminder: last alphas next Wednesday 07-May-2008

2008-05-02 Thread Jeroen Ruigrok van der Werven
-On [20080502 08:26], "Martin v. Löwis" ([EMAIL PROTECTED]) wrote: >It seems you don't want to identify whether the Windows installation is >a Win64 one, but whether the Python installation is, right? I think we can say with a reasonably certainty that if the Python installat

[Python-Dev] tracker issues? server error

2008-05-02 Thread Gregory P. Smith
trying to update a bug I get: Fri May 2 07:17:17 2008: An error occurred. Please check the server log for more infomation. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.pyth