Python complaints

Will Ware wware-nospam at world.std.com
Mon Nov 29 05:31:53 CET 1999


William J. King (wjk at wjk.mv.com) wrote:
: 4. conversion of integer to a string ( which may exist but havn't found
: yet)

Try this:
	str(123)
or:
	hex(123)

: 2. would like something like  'increment'/'decrement' operators
:         either in form:
:                     "x++"  or "incr x" vice "x = x + 1 " but its ok

I find myself grumbling about having to type "x = x + 1". The really
clean thing to do, given that integers are objects, would be to define
increment and decrement methods, so you'd type something like "i.incr()".
Then you'd want to go around looking for other objects for which
it made sense to increment and decrement. Long ints and floats can do
what integers do. Sequences (lists, tuples, strings, xranges) might
grow and shrink in length. No good idea what to do for dictionaries.
-- 
 - - - - - - - - - - - - - - - - - - - - - - - -
Resistance is futile. Capacitance is efficacious.
Will Ware	email:    wware @ world.std.com




More information about the Python-list mailing list