Chris Angelico <ros...@gmail.com>:

> On Sun, Jul 19, 2015 at 2:45 PM, Steven D'Aprano <st...@pearwood.info> wrote:
>> sys.setdigits('Devanagari')
>
> Easiest way to play with this would be a sys.displayhook, I think;

I think the numeral selection is analogous to the number base:

   >>> 0o10
   8
   >>> "{:o}".format(0o10)
   '10'

what we need is:

   >>> "{:d/base({base})}".format(0o10, base=7)
   '11'
   >>> "{:d/numeral('{num}')".format(0o10, num="European")
   '8'
   >>> "{:d/numeral('{num}')".format(0o10, num="Roman")
   'VIII'
   >>> "{:d/numeral('{num}')".format(0o10, num="RomanLowerCase")
   'viii'
   >>> "{:d/numeral('{num}')".format(0o10, num="EasternArabic")
   '٨'
   >>> "{:d/numeral('{num}')".format(0o10, num="Devanagari")
   '८'

IOW, don't make it global.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to