?
=?ISO-8859-1?Q?Sch=FCle_Daniel?=
Hello
what I sometimes miss in Python is the possibility to
switch tha base of a number
for example this is how it's done in Ruby
irb(main):099:0* a = 10.to_s(2)
=> "1010"
irb(main):100:0> a.to_i(2)
=> 10
irb(main):101:0>
irb(main):102:0* a = 10.to_s(3)
=> "101"
irb(main):103:0> a.to_i(3)
=> 10
the Python int-Function behaves similar
however we lack the reverse functionality
the logical
Traceback (most recent call last):
fails
it would not break anything if str interface would be changed
what do you think?
Is this already proposed or maybe implemented in 2.5?
Regards, Daniel
what I sometimes miss in Python is the possibility to
switch tha base of a number
for example this is how it's done in Ruby
irb(main):099:0* a = 10.to_s(2)
=> "1010"
irb(main):100:0> a.to_i(2)
=> 10
irb(main):101:0>
irb(main):102:0* a = 10.to_s(3)
=> "101"
irb(main):103:0> a.to_i(3)
=> 10
the Python int-Function behaves similar
however we lack the reverse functionality
the logical
Traceback (most recent call last):
fails
it would not break anything if str interface would be changed
what do you think?
Is this already proposed or maybe implemented in 2.5?
Regards, Daniel