On Tue, Dec 27, 2011 at 3:19 PM, K Richard Pixley wrote:
> Are you trying to demonstrate that I haven't prevented you from
> instantiating Foo? If so, then I will cede that point. I certainly don't
> know enough about python internals just now to even claim to be capable of
> protecting a class
On 12/27/11 12:34 , Ian Kelly wrote:
On Tue, Dec 27, 2011 at 1:31 PM, K Richard Pixley wrote:
On 12/27/11 10:28 , Ian Kelly wrote:
On Tue, Dec 27, 2011 at 10:41 AM, K Richard Pixleywrote:
The conceptual leap for me was in recognizing that a class is just an
object. The best way, (imo,
On 12/27/11 10:28 , Ian Kelly wrote:
On Tue, Dec 27, 2011 at 10:41 AM, K Richard Pixley wrote:
The conceptual leap for me was in recognizing that a class is just an
object. The best way, (imo, so far), to create a singleton in python is to
use the class itself as the singleton rather than ever
On Tue, Dec 27, 2011 at 1:31 PM, K Richard Pixley wrote:
> On 12/27/11 10:28 , Ian Kelly wrote:
>>
>> On Tue, Dec 27, 2011 at 10:41 AM, K Richard Pixley wrote:
>>>
>>> The conceptual leap for me was in recognizing that a class is just an
>>> object. The best way, (imo, so far), to create a singl
On Tue, Dec 27, 2011 at 10:41 AM, K Richard Pixley wrote:
> The conceptual leap for me was in recognizing that a class is just an
> object. The best way, (imo, so far), to create a singleton in python is to
> use the class itself as the singleton rather than ever instantiating it.
> With a littl
On Tue, 27 Dec 2011, Ian Kelly wrote:
On Mon, Dec 26, 2011 at 10:48 PM, Fredrik Tolf wrote:
I'm also a bit confused about __new__. I'd very much appreciate it if
someone could explain the following aspects of it:
* The manual (<http://docs.python.org/reference/datamodel.html&
On 12/26/11 21:48 , Fredrik Tolf wrote:
On Mon, 26 Dec 2011, K. Richard Pixley wrote:
I don't understand. Can anyone explain?
I'm also a bit confused about __new__. I'd very much appreciate it if
someone could explain the following aspects of it:
* The manual (<http
On 12/27/2011 04:48 PM, Fredrik Tolf wrote:
On Mon, 26 Dec 2011, K. Richard Pixley wrote:
I don't understand. Can anyone explain?
I'm also a bit confused about __new__. I'd very much appreciate it if
someone could explain the following aspects of it:
* The manual (<http
On Mon, Dec 26, 2011 at 10:48 PM, Fredrik Tolf wrote:
> I'm also a bit confused about __new__. I'd very much appreciate it if
> someone could explain the following aspects of it:
>
> * The manual (<http://docs.python.org/reference/datamodel.html>) says
> t
On Mon, 26 Dec 2011, K. Richard Pixley wrote:
I don't understand. Can anyone explain?
I'm also a bit confused about __new__. I'd very much appreciate it if
someone could explain the following aspects of it:
* The manual (<http://docs.python.org/reference/datamodel.h
On 12/26/11 20:53 , Steven D'Aprano wrote:
On Mon, 26 Dec 2011 20:28:26 -0800, K. Richard Pixley wrote:
I'm confused about the following. The idea here is that the set of
instances of some class are small and finite, so I'd like to create them
at class creation time, then hijack __new__ to sim
On Mon, 26 Dec 2011 20:28:26 -0800, K. Richard Pixley wrote:
> I'm confused about the following. The idea here is that the set of
> instances of some class are small and finite, so I'd like to create them
> at class creation time, then hijack __new__ to simply return one of the
> preexisting clas
I'm confused about the following. The idea here is that the set of
instances of some class are small and finite, so I'd like to create them
at class creation time, then hijack __new__ to simply return one of the
preexisting classes instead of creating a new one each call.
This seems to work i
13 matches
Mail list logo