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

Guido van Rossum guido at python.org
Sat Apr 22 16:16:24 CEST 2006


That makes more sense than a builtin. Note that oct() and hex() return
something that's a valid Python literal. There are no binary literals
(nor should there be IMO).

On 4/22/06, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Ian Bicking wrote:
> > Guido van Rossum wrote:
> >> This has been brought up many times before. The value of bin() is
> >> really rather minimal except when you're just learning about binary
> >> numbers; and then writing it yourself is a useful exercise.
> >>
> >> I'm not saying that bin() is useless -- but IMO its (small) value
> >> doesn't warrant making, maintaining and documenting a new built-in
> >> function.
> >
> > And for some reason no one wants to propose it for any particular stdlib
> > module...
>
> binascii.a2b_bin and binascii.b2a_bin might actually make sense. . .
>
> Cheers,
> Nick.
>
> --
> Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
> ---------------------------------------------------------------
>              http://www.boredomandlaziness.org
>


--
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list