Re: Disable automatic interning

2009-03-23 Thread Hrvoje Niksic
George Sakkis george.sak...@gmail.com writes: I'm working on some graph generation problem where the node identity is significant (e.g. if node1 is node2: # do something) but ideally I wouldn't want to impose any constraint on what a node is I'm not sure if it helps in your case, but you can

Disable automatic interning

2009-03-18 Thread George Sakkis
Is there a way to turn off (either globally or explicitly per instance) the automatic interning optimization that happens for small integers and strings (and perhaps other types) ? I tried several workarounds but nothing worked: 'x' is 'x' True 'x' is 'x'+'' True 'x' is ''+'x' True 'x' is

Disable automatic interning

2009-03-18 Thread R. David Murray
George Sakkis george.sak...@gmail.com wrote: Is there a way to turn off (either globally or explicitly per instance) the automatic interning optimization that happens for small integers and strings (and perhaps other types) ? I tried several workarounds but nothing worked: No. It's an

Re: Disable automatic interning

2009-03-18 Thread George Sakkis
On Mar 18, 2:13 pm, R. David Murray rdmur...@bitdance.com wrote: George Sakkis george.sak...@gmail.com wrote: Is there a way to turn off (either globally or explicitly per instance) the automatic interning optimization that happens for small integers and strings (and perhaps other types) ?

Re: Disable automatic interning

2009-03-18 Thread Martin v. Löwis
Is there a way to turn off (either globally or explicitly per instance) the automatic interning optimization that happens for small integers and strings (and perhaps other types) ? I tried several workarounds but nothing worked: No. It's an implementation detail. What use case do you have

Re: Disable automatic interning

2009-03-18 Thread Terry Reedy
George Sakkis wrote: On Mar 18, 2:13 pm, R. David Murray rdmur...@bitdance.com wrote: George Sakkis george.sak...@gmail.com wrote: Is there a way to turn off (either globally or explicitly per instance) the automatic interning optimization that happens for small integers and strings (and

Re: Disable automatic interning

2009-03-18 Thread Daniel Fetchinson
Is there a way to turn off (either globally or explicitly per instance) the automatic interning optimization that happens for small integers and strings (and perhaps other types) ? I tried several workarounds but nothing worked: No. It's an implementation detail. What use case do you

Re: Disable automatic interning

2009-03-18 Thread andrew cooke
George Sakkis wrote: I'm working on some graph generation problem where the node identity is significant (e.g. if node1 is node2: # do something) but ideally I wouldn't want to impose any constraint on what a node is (i.e. require a base Node class). It's not a show stopper, but it would be

Re: Disable automatic interning

2009-03-18 Thread George Sakkis
On Mar 18, 4:06 pm, Daniel Fetchinson fetchin...@googlemail.com wrote: I'm working on some graph generation problem where the node identity is significant (e.g. if node1 is node2: # do something) but ideally I wouldn't want to impose any constraint on what a node is (i.e. require a base

Re: Disable automatic interning

2009-03-18 Thread Daniel Fetchinson
I'm working on some graph generation problem where the node identity is significant (e.g. if node1 is node2: # do something) but ideally I wouldn't want to impose any constraint on what a node is (i.e. require a base Node class). It's not a show stopper, but it would be problematic if

Re: Disable automatic interning

2009-03-18 Thread George Sakkis
On Mar 18, 4:50 pm, andrew cooke and...@acooke.org wrote: this is completely normal (i do exactly this all the time), BUT you should use ==, not is.   Typically, but not always; for example check out the identity map [1] pattern used in SQLAlchemy [2]. George [1]