Re: [Python-Dev] Py_CmpToRich removed, alternatives for comparison?

2009-09-02 Thread Benjamin Peterson
2009/9/2 Campbell Barton : > For blender we have a number of types defined in the C/API like > meshes, lamps, metaballs, nurbs etc that dont make sense with some of > richcmp's operations. > A problem I have is that in python 3.1 the Py_CmpToRich function is removed. > > Should we copy Py_CmpToRich

Re: [Python-Dev] Decorator syntax

2009-09-02 Thread Brett Cannon
People, please note that the discussion has shifted to python-ideas and further comments should happen over there. Carl did the right thing to shift it there, although cross-posting once the conversation redirection has occurred is not needed. hoping-google-wave-will-have-a-permanent-redirector-fo

Re: [Python-Dev] Bugs discovered by researchers at Case Western Reserve University

2009-09-02 Thread Brett Cannon
On Wed, Sep 2, 2009 at 08:19, Boya Sun wrote: > Dear Developers, > > I am a Ph.D student from Case Western Reserve University, specialized at > software engineering.  Our recent approach analyzes bugs that are being > fixed in the issue database, and tries to discover any latent bug instances > tha

[Python-Dev] Py_CmpToRich removed, alternatives for comparison?

2009-09-02 Thread Campbell Barton
For blender we have a number of types defined in the C/API like meshes, lamps, metaballs, nurbs etc that dont make sense with some of richcmp's operations. A problem I have is that in python 3.1 the Py_CmpToRich function is removed. Should we copy Py_CmpToRich into our source tree? Otherwise we ha

Re: [Python-Dev] Setting up a buildbot

2009-09-02 Thread Martin v. Löwis
> I saw on planet Python that the buildbots have currently been shut > down. I guess this makes my question fairly irrelevant for the moment, > then :-( That was a misunderstanding. It was only the community buildbots, and Grig Gheorghiu is working on restoring them. Regards, Martin _

Re: [Python-Dev] Decorator syntax

2009-09-02 Thread MRAB
James Y Knight wrote: On Sep 2, 2009, at 6:15 AM, Rob Cliffe wrote: So - the syntax restriction seems not only inconsistent, but pointless; it doesn't forbid anything, but merely means we have to do it in a slightly convoluted (unPythonesque) way. So please, Guido, will you reconsider? Ind

Re: [Python-Dev] Decorator syntax

2009-09-02 Thread Eric Smith
Erik Bray wrote: I think Guido may have a point about not allowing any arbitrary expression. But I do think that if it allows calls, it should also at least support the itemgetter syntax, for which there seems to be a demonstrable use case. But that's just adding on another special case, so it

Re: [Python-Dev] Decorator syntax

2009-09-02 Thread Erik Bray
On Wed, Sep 2, 2009 at 10:35 AM, James Y Knight wrote: > On Sep 2, 2009, at 6:15 AM, Rob Cliffe wrote: > >> So - the syntax restriction seems not only inconsistent, but pointless; it >> doesn't forbid anything, but merely means we have to do it in a slightly >> convoluted (unPythonesque) way.  So p

[Python-Dev] Bugs discovered by researchers at Case Western Reserve University

2009-09-02 Thread Boya Sun
Dear Developers, I am a Ph.D student from Case Western Reserve University, specialized at software engineering. Our recent approach analyzes bugs that are being fixed in the issue database, and tries to discover any latent bug instances that are the same as the fixed bug but are left unfixed. We

Re: [Python-Dev] Decorator syntax

2009-09-02 Thread James Y Knight
On Sep 2, 2009, at 6:15 AM, Rob Cliffe wrote: So - the syntax restriction seems not only inconsistent, but pointless; it doesn't forbid anything, but merely means we have to do it in a slightly convoluted (unPythonesque) way. So please, Guido, will you reconsider? Indeed, it's a silly in

Re: [Python-Dev] Setting up a buildbot

2009-09-02 Thread Paul Moore
2009/8/22 Paul Moore : > 2009/8/22 Jeroen Ruigrok van der Werven : >> -On [20090822 21:30], Paul Moore (p.f.mo...@gmail.com) wrote: >>>I've just had a look on python.org, but couldn't immediately see a >>>pointer to instructions on what the process is to set up a buildbot. >> >> http://wiki.python.

Re: [Python-Dev] default of returning None hurts performance?

2009-09-02 Thread Kristján Valur Jónsson
Not advocating a change, merely pointing out that it's how Ruby works. K > -Original Message- > From: python-dev-bounces+kristjan=ccpgames@python.org > [mailto:python-dev-bounces+kristjan=ccpgames@python.org] On Behalf > Of Nick Coghlan > Sent: 2. september 2009 11:12 > To: Greg Ew

Re: [Python-Dev] default of returning None hurts performance?

2009-09-02 Thread Nick Coghlan
Greg Ewing wrote: > Xavier Morel wrote: > >> I fail to grasp the unpredictability of "the last expression >> evaluated in the body of a function is its return value". > > It's unpredictable in the sense that if you're writing > a function that's not intended to return a value, you're > not think

Re: [Python-Dev] Decorator syntax

2009-09-02 Thread Xavier Morel
On 2 Sep 2009, at 12:15 , Rob Cliffe wrote: @Identity(DecoList[0])# THIS WORKS def foo(): pass For what it's worth, you don't need an id function, you can simply write @itemgetter(0)(decorators) def foo(): 'whatever' or @decorators.__getitem__(0) def foo():

Re: [Python-Dev] [Python-ideas] Decorator syntax

2009-09-02 Thread Michael Foord
I actually encountered this for the first time yesterday and didn't realise that the decorator syntax was limited in this way (I was mentally preparing a blog entry when these emails arrived). What I needed to do was turn a Python function into a .NET event handler in IronPython. The simple case

Re: [Python-Dev] Decorator syntax

2009-09-02 Thread Carl Johnson
Crossposting to Python-ideas, I asked for the same change to the grammar a couple months back on python-ideas. See http://mail.python.org/pipermail/python-ideas/2009-February/thread.html#2787 I'm all for it, but you'll have to convince Guido that this won't result in confusing to read code. My o

[Python-Dev] Decorator syntax

2009-09-02 Thread Rob Cliffe
Hi All, This is my first post to python-dev so I will briefly introduce myself: My name is Rob Cliffe and I am a commercial programmer living in London, UK. I have some 30 years of programming experience but have only been using Python for a couple of years. First I want to say what a fantasti

Re: [Python-Dev] [OT] implicit return values

2009-09-02 Thread Xavier Morel
On 2 Sep 2009, at 00:10 , Greg Ewing wrote: Le mardi 01 septembre 2009 à 15:09 +0200, Xavier Morel a écrit : "We" are not Erlang, Smalltalk, OCaml or Haskell either, sadly. IIRC, the default return value of a Smalltalk method is self, not the last thing evaluated. Methods yes (and that's one of

Re: [Python-Dev] why different between staticmethod and classmethod on non-callable object?

2009-09-02 Thread xiaobing jiang
the three types: function, classmethod, staticmethod are descriptors. but staticmethod's __get__ return the orignal value, others return object of instancemethod. (from souce in Objects/funcobject.c) so the staticmethod just like a wrap that make the wrapped object 'frozen'. like in your example.