On 1/17/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 1/17/06, Bob Ippolito <[EMAIL PROTECTED]> wrote: > > There shouldn't be a %B for the same reason there isn't an %O or %D > > -- they're all just digits, so there's not a need for an uppercase > > variant. > > Right. > > > The difference between hex() and oct() and the proposed binary() is > > I'd propose bin() to stay in line with the short abbreviated names. > > > that hex() and oct() return valid Python expressions in that base. > > In order for it to make sense, Python would need to grow some syntax. > > Fair enough. So let's define it. > > > If Python were to have syntax for binary literals, I'd propose a > > trailing b: "1100b". It would be convenient at times to represent > > bit flags, but I'm not sure it's worth the syntax change. > > Typically, suffixes are used to indicated *types*: 12L, 12j, and even > 12e0 in some sense. > > The binary type should have a 0b prefix. >
0b101 for 5? > Perhaps this could be implemented at the PyCon sprint? > Added to the wiki along with possibly hashing out the bytes type. -Brett _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com