[Python-Dev] PendingDeprecationWarning

Alex Martelli aleax@aleax.it
Wed, 29 May 2002 19:29:46 +0200


On Wednesday 29 May 2002 06:42 pm, Guido van Rossum wrote:
	...
> > oct()
> > hex()
>
> Why?  I use these a lot...

I assume the duplication of oct and hex wrt '%o'% and '%x'% was the
reason to suggest silently-deprecating the former (trying to have 'just
one obvious way' and all that).  Personally, what seems weird to me
is that we have a way to _parse_ numbers in any base (thanks to the
2-args form of str) but not one to _emit_ them in any base -- an issue
of asymmetry more than anything else (binary is probably the only
format besides oct and hex that would see significant use -- as I would
guess may be the case for 2-arguments str today).

The % operator is probably a bit too obscure / unreadable to consider
it a general substitute for oct and hex, alas.  Just MHO of course.


Alex