On 19May2013 09:01, Peter Otten __pete...@web.de wrote:
| Cameron Simpson wrote:
|
| TL;DR: I think I want to modify an int value in place.
|
| Yesterday I was thinking about various flag set objects I have
| floating around which are essentially bare objects whose attributes
| I access,
On 20May2013 13:23, Greg Ewing greg.ew...@canterbury.ac.nz wrote:
| Cameron Simpson wrote:
| It's an int _subclass_ so that it is no bigger than an int.
|
| If you use __slots__ to eliminate the overhead of an
| instance dict, you'll get an object consisting of a
| header plus one reference,
Cameron Simpson wrote:
TL;DR: I think I want to modify an int value in place.
Yesterday I was thinking about various flag set objects I have
floating around which are essentially bare objects whose attributes
I access, for example:
flags = object()
flags.this = True
flags.that =
Cameron Simpson wrote:
It's an int _subclass_ so that it is no bigger than an int.
If you use __slots__ to eliminate the overhead of an
instance dict, you'll get an object consisting of a
header plus one reference, which is probably about the
size of an int. But you'll also need an int to put
TL;DR: I think I want to modify an int value in place.
Yesterday I was thinking about various flag set objects I have
floating around which are essentially bare objects whose attributes
I access, for example:
flags = object()
flags.this = True
flags.that = False
and then elsewhere:
if
On Sun, May 19, 2013 at 10:26 AM, Cameron Simpson c...@zip.com.au wrote:
Before I toss this approach and retreat to my former object
technique, does anyone see a way forward to modify an int subclass
instance in place? (That doesn't break math, preferably; I don't
do arithmetic with these
On 19May2013 11:11, Chris Angelico ros...@gmail.com wrote:
| On Sun, May 19, 2013 at 10:26 AM, Cameron Simpson c...@zip.com.au wrote:
| Before I toss this approach and retreat to my former object
| technique, does anyone see a way forward to modify an int subclass
| instance in place? (That