> Programs that use variable names that are all upper case and contain only the characters M, D, C, L, X, V and I will be affected by the new literals.
MIDI, MIC, MIX... I guess musicians didn't like this proposal :)
> Any literal composed entirely of M, D, C, L, X, V and I characters that does not follow this format will raise a syntax error, because explicit is better than implicit.
But “I” will only ever occur to the left of a “V” or an “X”, never before a “D“. If “I” could occur to the left of a “D“, “MID” would mean 1499, but the proper way to write 1499 is “MCDXCIX”.
A vocal minority of users has also requested support for lower-cased numerals for use in (i) powerpoint slides, (ii) academic work, and (iii) Perl documentation.
I'm glad this was rejected. The author consideres violations of PEP8 to be broken code that doesn't generate exceptions.
Lots of people treat PEP8 as the word of god, but apparently have not bothered to read it. "Many projects have their own coding style guidelines. In the event of any conflicts, such project-specific guides take precedence for that project."
As the descendant of Carthaginians, I find this PEP offensive and disgraceful. If such module is to be introduced, I require that an equivalent "carthaginian" package be also added.
By the way, did you know that the third Punic war officially ended in 1985, just 38 years ago?
> Rome still exists as the capital of Italy; the ruins of Carthage lie 16 km (10 mi) east of modern Tunis on the North African coast. A symbolic peace treaty was signed by Ugo Vetere and Chedli Klibi, the mayors of Rome and modern Carthage, respectively, on 5 February 1985; 2,131 years after the war ended. As of 2020 the modern settlement of Carthage was a district of the city of Tunis.
1985 is about 1500 years after the Western Roman empire perished in 476 CE, and about 2100 years after Carthage city was burned to the ground and the citizen was killed in 146 BC, marking the end of the Carthage civilization.
The Wolfram Language has some support for converting to and from Roman numerals [1], and Common Lisp's `format` takes a `@R` modifier to print a number as its Roman numeral [2].
It would be great if we could extend the parser for “ruf” str prefixes in Python to add new string functionality. I’m sure we could subclass str, but using something like rn”XV” would be much nicer!
I had a project a couple years back implementing this and various other 'dead' (rejected) language-level proposals dynamically at the interpreter with just an install of a package, https://github.com/isidentical-archive/pepgrave. Was a fun experience looking back to the history of Python to see all these rejected proposals and getting them to play nice with the current language itself which has significantly evolved since they were proposed.
Look at old latin inscriptions in Europe and you might see IIII instead of IV. Turns out the rules of Roman numerals we know today are a recent convention :)
It's because Romans mostly concerned themselves with counting things, and this is what the system was optimized for.
When you want to add two roman numbers, you just i. put them together, ii. sort the digits in descending order, and iii. shorten all "iiiii" to "v", all "vv" to "x", and so on.
i. vii + xiii -> viixiii
ii. viixiii -> xviiiii
iii. xviiiii -> xvv -> xx
38 comments
[ 4.6 ms ] story [ 83.8 ms ] threadMIDI, MIC, MIX... I guess musicians didn't like this proposal :)
> Any literal composed entirely of M, D, C, L, X, V and I characters that does not follow this format will raise a syntax error, because explicit is better than implicit.
There isn't a standard for Roman numerals; you can largely do what you want. The Eighteenth Legion used XIIX.
But MIDI is obviously invalid by any standard.
You wouldn't expect to name a variable 15D5 would you?
/s
I think this made my day
:D
https://metacpan.org/dist/Lingua-Romana-Perligata/view/lib/L...
Lots of people treat PEP8 as the word of god, but apparently have not bothered to read it. "Many projects have their own coding style guidelines. In the event of any conflicts, such project-specific guides take precedence for that project."
It’s an April Fools joke from forever ago…
By the way, did you know that the third Punic war officially ended in 1985, just 38 years ago?
What does "surrender" even mean?
Sorry, without a "/s", can't tell if joking.
Was some form of paperwork requirement the norm for officially ending a war back in 146BC?
Also, how do we know that no treaty was made then? A lot of documents can get lost, or just disintegrate, in 2,000 years.
> Rome still exists as the capital of Italy; the ruins of Carthage lie 16 km (10 mi) east of modern Tunis on the North African coast. A symbolic peace treaty was signed by Ugo Vetere and Chedli Klibi, the mayors of Rome and modern Carthage, respectively, on 5 February 1985; 2,131 years after the war ended. As of 2020 the modern settlement of Carthage was a district of the city of Tunis.
[1]: https://en.wikipedia.org/wiki/Third_Punic_War#Aftermath
Edit: But also, that does not answer my question of why Carthage surrendering did not officially end the war.
Enough with the revisionism already!
1985 is about 1500 years after the Western Roman empire perished in 476 CE, and about 2100 years after Carthage city was burned to the ground and the citizen was killed in 146 BC, marking the end of the Carthage civilization.
How is that date "official", exactly?
Amazingly, R actually seems to support Roman numerals natively: https://stat.ethz.ch/R-manual/R-devel/library/utils/html/rom... Limited numerical range, but seems to have full support for treating them as normal numbers!
The Wolfram Language has some support for converting to and from Roman numerals [1], and Common Lisp's `format` takes a `@R` modifier to print a number as its Roman numeral [2].
[1] https://reference.wolfram.com/language/ref/RomanNumeral.html [2] http://www.lispworks.com/documentation/HyperSpec/Body/22_c.h...
E.g. here was an implementation of the roman numeral literals PEP, https://github.com/isidentical-archive/pepgrave/blob/master/... which is extremely simple AST manipulation
When you want to add two roman numbers, you just i. put them together, ii. sort the digits in descending order, and iii. shorten all "iiiii" to "v", all "vv" to "x", and so on.