Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45541 > unrolled thread

Re: mutable ints: I think I have painted myself into a corner

Started byChris Angelico <rosuav@gmail.com>
First post2013-05-19 11:11 +1000
Last post2013-05-19 11:11 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: mutable ints: I think I have painted myself into a corner Chris Angelico <rosuav@gmail.com> - 2013-05-19 11:11 +1000

#45541 — Re: mutable ints: I think I have painted myself into a corner

FromChris Angelico <rosuav@gmail.com>
Date2013-05-19 11:11 +1000
SubjectRe: mutable ints: I think I have painted myself into a corner
Message-ID<mailman.1827.1368925919.3114.python-list@python.org>
On Sun, May 19, 2013 at 10:26 AM, Cameron Simpson <cs@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 things but they are, after all, ints...)
>

Why is it an int subclass? Because there are places where you want to
use it as though it were an int? It might be easier to render those,
instead, eg by creating a __int__ method. (Or is it "an __int__
method"? Not sure.)

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web