On 20May2013 13:23, Greg Ewing 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, which is probably about the
| s
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 "object"s whose attributes
| >
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 i
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 "object"s whose attributes
> I access, for example:
>
> flags = object()
> flags.this = True
>
On 19May2013 11:11, Chris Angelico wrote:
| On Sun, May 19, 2013 at 10:26 AM, Cameron Simpson 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
On Sun, May 19, 2013 at 10:26 AM, Cameron Simpson 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 things but the
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 "object"s whose attributes
I access, for example:
flags = object()
flags.this = True
flags.that = False
and then elsewhere: