On 8 Nov 2013 04:44, "Brett Cannon" wrote:
> On Thu, Nov 7, 2013 at 7:41 AM, Nick Coghlan wrote:
>>
>> The bigger problem is you can't change the constructor signature in a
backwards incompatible way. You would need a new class method as an
alternative constructor instead, or else use optional pa
On Thu, Nov 7, 2013 at 2:20 PM, Eric Snow wrote:
> On Thu, Nov 7, 2013 at 11:44 AM, Brett Cannon wrote:
> > Lazy message creation through
> > __str__ does leave the message out of `args`, though.
>
> If that's an issue you could make args a (settable) property that
> dynmically returns str(self)
On Thu, Nov 7, 2013 at 11:44 AM, Brett Cannon wrote:
> Lazy message creation through
> __str__ does leave the message out of `args`, though.
If that's an issue you could make args a (settable) property that
dynmically returns str(self) if appropriate:
@property
def args(self):
ac
On Thu, Nov 7, 2013 at 7:41 AM, Nick Coghlan wrote:
>
> On 7 Nov 2013 21:34, "Victor Stinner" wrote:
> >
> > 2013/11/7 Steven D'Aprano :
> > > My initial instinct here was to say that sounded like premature
> > > optimization, but to my surprise the overhead of generating the error
> > > message
On 7 Nov 2013 21:34, "Victor Stinner" wrote:
>
> 2013/11/7 Steven D'Aprano :
> > My initial instinct here was to say that sounded like premature
> > optimization, but to my surprise the overhead of generating the error
> > message is actually significant -- at least from pure Python 3.3 code.
>
>
07.11.13 00:32, Victor Stinner написав(ла):
I'm trying to avoid unnecessary temporary Unicode strings when
possible (see issue #19512). While working on this, I saw that Python
likes preparing an user friendly message to explain why getting an
attribute failed. The problem is that in most cases,
2013/11/7 Steven D'Aprano :
> My initial instinct here was to say that sounded like premature
> optimization, but to my surprise the overhead of generating the error
> message is actually significant -- at least from pure Python 3.3 code.
I ran a quick and dirty benchmark by replacing the error me
On Wed, Nov 06, 2013 at 11:32:33PM +0100, Victor Stinner wrote:
> Hi,
>
> I'm trying to avoid unnecessary temporary Unicode strings when
> possible (see issue #19512). While working on this, I saw that Python
> likes preparing an user friendly message to explain why getting an
> attribute failed.
Hi,
I'm trying to avoid unnecessary temporary Unicode strings when
possible (see issue #19512). While working on this, I saw that Python
likes preparing an user friendly message to explain why getting an
attribute failed. The problem is that in most cases, the caller
doesn't care of the message: t