[Python-3000] New built-in function: bin()

2006-04-21 Thread Mike Traynar
I've always wondered why there isn't a bin() built-in in Python. Built-in functions already exist for converting ints to hexadecimal and octal strings and vice versa i.e. s = hex() and int(s, 16) s = oct() and int(s, 8) but no bin() function for binary strings s = ??? and int(s, 2)

Re: [Python-3000] New built-in function: bin()

2006-04-21 Thread Mike Traynar
Or a new string formatting character bin() == "%b" % (i), but perhaps not, here is no precedent for this not even in C. Like you say a new method in a lib somewhere is more reasonable. Mike Talin wrote: Mike Traynar credence.com> writes: I've always wondered