On Thu, Oct 9, 2008 at 5:37 PM, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Amaury Forgeot d'Arc wrote:
>
>> But this is already the case, and the reason why there are three
>> variable to describe an exception: type, value and traceback.
>
> Yes, but you only get one object for the value, which means
Amaury Forgeot d'Arc wrote:
But this is already the case, and the reason why there are three
variable to describe an exception: type, value and traceback.
Yes, but you only get one object for the value, which means
at least allocating a tuple if you want to be able to report
something like "At
Hello,
On Fri, Oct 10, 2008 at 2:15 AM, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Nick Coghlan wrote:
>
>> If the time is being spent in PyErr_Format, how far could you get adding
>> a dedicated function for creating AttributeErrors? Something along the
>> lines of:
>>
>> PyErr_AttributeError(PyObje
Nick Coghlan wrote:
If the time is being spent in PyErr_Format, how far could you get adding
a dedicated function for creating AttributeErrors? Something along the
lines of:
PyErr_AttributeError(PyObject *object, PyObject *attr_name)
More generally, it might be useful to have some mechanism f
to:[EMAIL PROTECTED]
> Sent: Thursday, October 09, 2008 11:54
> To: Kristján Valur Jónsson
> Cc: Python-Dev
> Subject: Re: [Python-Dev] __getattr__ and new style classes
>
> Kristján Valur Jónsson wrote:
> > Running regular python code through a profiler, and especially cod
Kristján Valur Jónsson wrote:
> Running regular python code through a profiler, and especially code that
> relies much on the use of
> __getattr__() to emulate attribute access, will show hideous amounts of time
> spent formatting
> attribute exceptions that get thrown away.
>
> Any thoughts on
Christian Heimes wrote:
> Nick Coghlan wrote:
>> I think it's actually some single quotes that got mangled by the mailer.
>> Either way, something else is going on for Kristján to see such wildly
>> different results between old-style and new-style attribute access, when
>> the differences are in t
Nick Coghlan wrote:
I think it's actually some single quotes that got mangled by the mailer.
Either way, something else is going on for Kristján to see such wildly
different results between old-style and new-style attribute access, when
the differences are in the noise for the other folks checkin
No, it was really me being sloppy using outlook and fighting the editor trying
to insert smart quotes :)
Sorry for the confusion.
K
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf
> Of Christian Heimes
> Kristján is using the old style and alternative
5
0.186524222345
patch active:
0.352850669641
0.147599760073
0.0910020300097
1.4453737036
0.212842069748
0.203442097864
Cheers,
Kristján
> -Original Message-
> From: Nick Coghlan [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, October 08, 2008 21:37
> To: Kristján Valur Jónsson
> Cc: Py
Christian Heimes wrote:
> Steven D'Aprano wrote:
>> Not only don't I observe the same results as you, I'm afraid I can't
>> even get your code to run. I get a SyntaxError from the funny quotes
>> you're using: ´d.foo´ instead of 'd.foo' or "d.foo".
>
> Kristján is using the old style and alternati
Kristján Valur Jónsson wrote:
Using new style classes to provide attribute-like access using
__getattr__ is considerably slower than old style classes
Do you really need __getattr__, or could you use
properties instead?
--
Greg
___
Python-Dev mailin
Steven D'Aprano wrote:
Not only don't I observe the same results as you, I'm afraid I can't
even get your code to run. I get a SyntaxError from the funny quotes
you're using: ´d.foo´ instead of 'd.foo' or "d.foo".
Kristján is using the old style and alternative syntax for repr().
Somehow the
On Thu, 9 Oct 2008 06:27:06 am Kristján Valur Jónsson wrote:
> Hello there.
> I've just noticed what I consider a performance problem:
> Using new style classes to provide attribute-like access using
> __getattr__ is considerably slower than old style classes: Observe:
>
> s = """
> class dude:
>
Kristján Valur Jónsson wrote:
> Hello there.
>
> I‘ve just noticed what I consider a performance problem:
>
> Using new style classes to provide attribute-like access using
> __getattr__ is considerably slower than old style classes: Observe:
I can't reproduce those relative numbers using SVN t
Hello there.
I've just noticed what I consider a performance problem:
Using new style classes to provide attribute-like access using __getattr__ is
considerably slower than old style classes: Observe:
s = """
class dude:
def bar(self):pass
def __getattr__(self, a): return a
class
16 matches
Mail list logo