PEP 313 - Roman numeral literals

rzed Dick.Zantow at lexisnexis.com
Tue Apr 1 16:32:45 EST 2003


Peter Hansen wrote:
> Mike Meyer wrote:
>>
>> Abstract
>>
>>     This PEP proposes adding Roman numerals as a literal type.  It
>>     also proposes the new built-in function "roman", which
>>     converts an object to an integer, then converts the integer to
>>     a string that is the Roman numeral literal equivalent to the
>> integer.
>>
>> Rationale
>>
>>     Roman numerals are used in a number of areas, and adding them
>>     to Python as literals would make computations in those areas
>>     easier. For instance, Superbowls are counted with Roman
>>     numerals, and many older movies have copyright dates in Roman
>> numerals.
>

As an enhancement, I'd like to suggest two-way conversion to the
similar Pig-Latinate numeric system of the form XIA (9), CIXA (91), or
IIVA (7).

> In addition, any calculations involving the Roman calendar
> (cf http://www.clubs.psu.edu/aegsa/rome/romec.html) would clearly
> benefit from such a module.
>
> My kalend.py module, currently running at 87,543 lines of code,
> could be shrunk substantially if it could do its calculations using
> the new roman type.  *Thank you*, Mike, for starting the process of
> getting this valuable feature into Python.
>
> (I've also considered whether we should be including the roman
> alphabet in the source encodings (PEP 263) so that, for example,
> names like "MAIOR" and "IVSTINIANUS" would be properly interpreted
> as "major" and "Justinians".  Unfortunately, this requires coupling
> that PEP with PEP 235 (Migration to Case-Insensitive Python), and
> coupling is always a bad idea in computing.)
>

Isn't that already covered in LATIN-1?

> Oh, and a Festive Veneralia to you all. :-)
>

I'm all for this proposal, but I'm afraid their may be some confusion
with proto-PEP 7334(Romansch Numerals) and PEP 2/14 (Romantic
numerals), not to mention PEPS 3.95/# (Romaine Minerals) and 5/$1
(Ramen noodles).

 --
rzed






More information about the Python-list mailing list