On Mon, Sep 19, 2011 at 10:26:30PM -0400, Roy Smith wrote:
> In article <4e77eae1$0$29978$c3e8da3$54964...@news.astraweb.com>,
> Steven D'Aprano wrote:
>
> > Westley Mart??nez wrote:
> >
> > > def __radd__(self, other):
> > > return self.__add__(self, other)
> >
> > Which, inside a class,
In article <4e77eae1$0$29978$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> Westley MartÃnez wrote:
>
> > def __radd__(self, other):
> > return self.__add__(self, other)
>
> Which, inside a class, can be simplified to:
>
> __radd__ = __add__
Ooh, I could see that lead
Westley Martínez wrote:
> def __radd__(self, other):
> return self.__add__(self, other)
Which, inside a class, can be simplified to:
__radd__ = __add__
--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
Antoon Pardon wrote:
int PyThreadState_SetAsyncExc(long id, PyObject *exc)
To prevent
naive misuse, you must write your own C extension to call this.
Not if we use ctypes! Muahahahaaa!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Sep 20, 2011 at 8:04 AM, Ian Kelly wrote:
> "PowerCordRemoved" is not relevant here, as that would kill the entire
> process, which renders the issue of broken shared data within a
> continuing process rather moot.
>
Assuming that the "broken shared data" exists only in RAM on one
single
ActiveState is pleased to announce ActivePython 3.2.2.3, a complete,
ready-to-install binary distribution of Python 3.2.
http://www.activestate.com/activepython/downloads
What's New in ActivePython-3.2.2.3
==
New Features & Upgrades
---
-
I want dynamically place the 'return' statement in a function via user input
or achieve the same through some other means. If some other means, the user
must be able initiate this at runtime during a raw_input(). This is what I
have so far, this would be an awesome command line debugging tool if
Is it possible to use {-style formatting with a logging config file? I
can add style='{' to a logging.Formatter() call and it works fine, but I
see no way of doing this from a config file. I tried adding a style
option in the config file, but it has no effect. I see no mention of the
{-style in the
On Mon, Sep 19, 2011 at 12:25 AM, Chris Angelico wrote:
> On Mon, Sep 19, 2011 at 3:41 PM, Ian Kelly wrote:
>> And what if the thread gets killed in the middle of the commit?
>>
>
> Database managers solved this problem years ago. It's not done by
> preventing death until you're done - death can
On Sun, 18 Sep 2011 23:41:29 -0600, Ian Kelly wrote:
>> If the transaction object doesn't get its commit() called, it does no
>> actions at all, thus eliminating all issues of locks.
>
> And what if the thread gets killed in the middle of the commit?
The essence of a commit is that it involves a
On 2011.09.19 09:00 AM, Brian Curtin wrote:
> You said "the application does not create an app folder in the user's
> 'application data' directory" -- what does this mean, or rather, what
> is the specific folder you're expecting to have? If Python can't
> create the directory but you can do it man
On Mon, Sep 19, 2011 at 01:11:51PM +0200, Henrik Faber wrote:
> Hi there,
>
> when I have a python class X which overloads an operator, I can use that
> operator to do any operation for example with an integer
>
> y = X() + 123
>
> however, say I want the "+" operator to be commutative. Then
>
On Sep 19, 1:42 pm, Robin Becker wrote:
> I'm not really very used to the decimal module so I'm asking here if any one
> can
> help me with a problem in a well known third party web framework
>
> The code in question is
>
> def format_number(value, max_digits, decimal_places):
> """
> F
I used xlrd library for the parse of excel before. But now, I
encounter a problem that the file has been encrypted for some security
reason. On the official website, i found "xlrd will not attempt to
decode password-protected (encrypted) files. " :((
And I also tried another library called pyExcele
On 9/19/2011 8:48 AM, Ethan Furman wrote:
Roy Smith wrote:
__radd__() only solves the problem if the left-hand operand has no
__add__() method itself.
Only true if the left-hand operand is so ill-behaved it doesn't check to
see if it makes sense to add itself to the right-hand operand. If it
On Sat, Sep 17, 2011 at 13:01, Kevin Walzer wrote:
> I have been testing my Python application on the just-released developer
> preview of Windows 8 and have noted an error: the application does not
> create an app folder in the user's "application data" directory. This causes
> the app to crash o
Roy Smith wrote:
In article ,
Henrik Faber wrote:
On 19.09.2011 13:23, Paul Rudin wrote:
Henrik Faber writes:
How can I make this commutative?
Incidentally - this isn't really about commutativity at all - the
question is how can you define both left and right versions of add,
irrespectiv
I'm not really very used to the decimal module so I'm asking here if any one can
help me with a problem in a well known third party web framework
The code in question is
def format_number(value, max_digits, decimal_places):
"""
Formats a number into a string with the requisite number of
In article ,
Henrik Faber wrote:
> On 19.09.2011 13:23, Paul Rudin wrote:
> > Henrik Faber writes:
> >
> >> How can I make this commutative?
> >
> > Incidentally - this isn't really about commutativity at all - the
> > question is how can you define both left and right versions of add,
> > ir
On 19.09.2011 13:23, Paul Rudin wrote:
> Henrik Faber writes:
>
>> How can I make this commutative?
>
> Incidentally - this isn't really about commutativity at all - the
> question is how can you define both left and right versions of add,
> irrespective of whether they yield the same result.
R
Henrik Faber wrote:
> Hi there,
>
> when I have a python class X which overloads an operator, I can use that
> operator to do any operation for example with an integer
>
> y = X() + 123
>
> however, say I want the "+" operator to be commutative. Then
>
> y = 123 + X()
>
> should have the sam
Henrik Faber writes:
> How can I make this commutative?
Incidentally - this isn't really about commutativity at all - the
question is how can you define both left and right versions of add,
irrespective of whether they yield the same result.
I think __radd__ is what you're after.
--
http://ma
On 19 September 2011 12:11, Henrik Faber wrote:
> Hi there,
>
> when I have a python class X which overloads an operator, I can use that
> operator to do any operation for example with an integer
>
> y = X() + 123
>
> however, say I want the "+" operator to be commutative. Then
>
> y = 123 + X()
>
Hi there,
when I have a python class X which overloads an operator, I can use that
operator to do any operation for example with an integer
y = X() + 123
however, say I want the "+" operator to be commutative. Then
y = 123 + X()
should have the same result. However, since it does not call __ad
On Sun, Sep 18, 2011 at 07:35:01AM +1000, Chris Angelico wrote:
> On Sun, Sep 18, 2011 at 5:00 AM, Nobody wrote:
> Forking a thread to discuss threads ahem.
>
> Why is it that threads can't be killed? Do Python threads correspond
> to OS-provided threads (eg POSIX threads on Linux)? Every OS
I think you cannnot use "\" as normal string ,it’s a metacharacter, u can use
it like this:
'\\begin{document}'
-Shambhu
-Original Message-
From: Steven D'Aprano [mailto:steve+comp.lang.pyt...@pearwood.info]
Sent: Monday, September 19, 2011 3:31 AM
To: python-list@python.org
Subject: Re:
26 matches
Mail list logo