On 12 July 2013 13:36, Zaur Shibzukhov <szport at gmail.com> wrote:
Hello!
Is it good idea to allow float('∞') to be float('inf') in python?
Why?
Because it obviously means infinity -- much more so than "inf" does :)
Do you have the infinity symbol on your keyboard? I don't! So, for me, should I ask for float('oo') ?? -1 -- Gerald Britton
On Fri, Jul 12, 2013 at 3:09 PM, Gerald Britton <gerald.britton@gmail.com>wrote:
Do you have the infinity symbol on your keyboard? I don't!
Why does what you have on your keyboard matter? Just because the example uses a string literal, doesn't mean that's the only use case. I can pass infinity symbols along in any text medium.
Gerald Britton _______________________________________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas
On 12 July 2013 14:09, Gerald Britton <gerald.britton@gmail.com> wrote:
On 12 July 2013 13:36, Zaur Shibzukhov <szport at gmail.com> wrote:
Hello!
Is it good idea to allow float('∞') to be float('inf') in python?
Why?
Because it obviously means infinity -- much more so than "inf" does :)
Do you have the infinity symbol on your keyboard? I don't! So, for me, should I ask for
Do you have any of: ٠١٢٣٤٥٦٧٨٩۰۱۲۳۴۵۶۷۸۹߀߁߂߃߄߅߆߇߈߉०१२३४५६७८९০১২৩৪৫৬৭৮৯੦੧੨੩੪੫੬੭੮੯૦૧૨૩૪૫૬૭૮૯୦୧୨୩୪୫୬୭୮୯௦௧௨௩௪௫௬௭௮௯౦౧౨౩౪౫౬౭౮౯೦೧೨೩೪೫೬೭೮೯൦൧൨൩൪൫൬൭൮൯๐๑๒๓๔๕๖๗๘๙໐໑໒໓໔໕໖໗໘໙༠༡༢༣༤༥༦༧༨༩၀၁၂၃၄၅၆၇၈၉႐႑႒႓႔႕႖႗႘႙០១២៣៤៥៦៧៨៩᠐᠑᠒᠓᠔᠕᠖᠗᠘᠙᥆᥇᥈᥉᥊᥋᥌᥍᥎᥏᧐᧑᧒᧓᧔᧕᧖᧗᧘᧙᪀᪁᪂᪃᪄᪅᪆᪇᪈᪉᪐᪑᪒᪓᪔᪕᪖᪗᪘᪙᭐᭑᭒᭓᭔᭕᭖᭗᭘᭙᮰᮱᮲᮳᮴᮵᮶᮷᮸᮹᱀᱁᱂᱃᱄᱅᱆᱇᱈᱉᱐᱑᱒᱓᱔᱕᱖᱗᱘᱙꘠꘡꘢꘣꘤꘥꘦꘧꘨꘩꣐꣑꣒꣓꣔꣕꣖꣗꣘꣙꤀꤁꤂꤃꤄꤅꤆꤇꤈꤉꧐꧑꧒꧓꧔꧕꧖꧗꧘꧙꩐꩑꩒꩓꩔꩕꩖꩗꩘꩙꯰꯱꯲꯳꯴꯵꯶꯷꯸꯹0123456789𐒠𐒡𐒢𐒣𐒤𐒥𐒦𐒧𐒨𐒩𑁦𑁧𑁨𑁩𑁪𑁫𑁬𑁭𑁮𑁯𑃰𑃱𑃲𑃳𑃴𑃵𑃶𑃷𑃸𑃹𑄶𑄷𑄸𑄹𑄺𑄻𑄼𑄽𑄾𑄿𑇐𑇑𑇒𑇓𑇔𑇕𑇖𑇗𑇘𑇙𑛀𑛁𑛂𑛃𑛄𑛅𑛆𑛇𑛈𑛉 on your keyboard because they are all valid *as of now* inside the string you pass to float()?
I would like to invite those interested in this topic to comment on this issue: http://bugs.python.org/issue10581 On the topic at hand, I would be -1 to allow float('∞'). The case for this is weaker than he case for accepting non-ASCII digits because it is very easy to write a function to replace ∞ with inf before passing strings to float. On Jul 12, 2013, at 9:45 AM, Joshua Landau <joshua@landau.ws> wrote:
On 12 July 2013 14:09, Gerald Britton <gerald.britton@gmail.com> wrote:
On 12 July 2013 13:36, Zaur Shibzukhov <szport at gmail.com> wrote:
Hello!
Is it good idea to allow float('∞') to be float('inf') in python?
Why?
Because it obviously means infinity -- much more so than "inf" does :)
Do you have the infinity symbol on your keyboard? I don't! So, for me, should I ask for
Do you have any of:
٠١٢٣٤٥٦٧٨٩۰۱۲۳۴۵۶۷۸۹߀߁߂߃߄߅߆߇߈߉०१२३४५६७८९০১২৩৪৫৬৭৮৯੦੧੨੩੪੫੬੭੮੯૦૧૨૩૪૫૬૭૮૯୦୧୨୩୪୫୬୭୮୯௦௧௨௩௪௫௬௭௮௯౦౧౨౩౪౫౬౭౮౯೦೧೨೩೪೫೬೭೮೯൦൧൨൩൪൫൬൭൮൯๐๑๒๓๔๕๖๗๘๙໐໑໒໓໔໕໖໗໘໙༠༡༢༣༤༥༦༧༨༩၀၁၂၃၄၅၆၇၈၉႐႑႒႓႔႕႖႗႘႙០១២៣៤៥៦៧៨៩᠐᠑᠒᠓᠔᠕᠖᠗᠘᠙᥆᥇᥈᥉᥊᥋᥌᥍᥎᥏᧐᧑᧒᧓᧔᧕᧖᧗᧘᧙᪀᪁᪂᪃᪄᪅᪆᪇᪈᪉᪐᪑᪒᪓᪔᪕᪖᪗᪘᪙᭐᭑᭒᭓᭔᭕᭖᭗᭘᭙᮰᮱᮲᮳᮴᮵᮶᮷᮸᮹᱀᱁᱂᱃᱄᱅᱆᱇᱈᱉᱐᱑᱒᱓᱔᱕᱖᱗᱘᱙꘠꘡꘢꘣꘤꘥꘦꘧꘨꘩꣐꣑꣒꣓꣔꣕꣖꣗꣘꣙꤀꤁꤂꤃꤄꤅꤆꤇꤈꤉꧐꧑꧒꧓꧔꧕꧖꧗꧘꧙꩐꩑꩒꩓꩔꩕꩖꩗꩘꩙꯰꯱꯲꯳꯴꯵꯶꯷꯸꯹0123456789𐒠𐒡𐒢𐒣𐒤𐒥𐒦𐒧𐒨𐒩𑁦𑁧𑁨𑁩𑁪𑁫𑁬𑁭𑁮𑁯𑃰𑃱𑃲𑃳𑃴𑃵𑃶𑃷𑃸𑃹𑄶𑄷𑄸𑄹𑄺𑄻𑄼𑄽𑄾𑄿𑇐𑇑𑇒𑇓𑇔𑇕𑇖𑇗𑇘𑇙𑛀𑛁𑛂𑛃𑛄𑛅𑛆𑛇𑛈𑛉
on your keyboard because they are all valid *as of now* inside the string you pass to float()? _______________________________________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas
Joshua Landau writes:
Do you have any of:
٠١٢٣٤٥٦٧٨٩۰۱۲۳۴۵۶۷۸۹߀߁߂߃߄߅߆߇߈߉०१२३४५६७८९০১২৩৪৫৬৭৮৯੦੧੨੩੪੫੬੭੮੯૦૧૨૩૪૫૬૭૮૯୦୧୨୩୪୫୬୭୮୯௦௧௨௩௪௫௬௭௮௯౦౧౨౩౪౫౬౭౮౯೦೧೨೩೪೫೬೭೮೯൦൧൨൩൪൫൬൭൮൯๐๑๒๓๔๕๖๗๘๙໐໑໒໓໔໕໖໗໘໙༠༡༢༣༤༥༦༧༨༩၀၁၂၃၄၅၆၇၈၉႐႑႒႓႔႕႖႗႘႙០១២៣៤៥៦៧៨៩᠐᠑᠒᠓᠔᠕᠖᠗᠘᠙᥆᥇᥈᥉᥊᥋᥌᥍᥎᥏᧐᧑᧒᧓᧔᧕᧖᧗᧘᧙᪀᪁᪂᪃᪄᪅᪆᪇᪈᪉᪐᪑᪒᪓᪔᪕᪖᪗᪘᪙᭐᭑᭒᭓᭔᭕᭖᭗᭘᭙᮰᮱᮲᮳᮴᮵᮶᮷᮸᮹᱀᱁᱂᱃᱄᱅᱆᱇᱈᱉᱐᱑᱒᱓᱔᱕᱖᱗᱘᱙꘠꘡꘢꘣꘤꘥꘦꘧꘨꘩꣐꣑꣒꣓꣔꣕꣖꣗꣘꣙꤀꤁꤂꤃꤄꤅꤆꤇꤈꤉꧐꧑꧒꧓꧔꧕꧖꧗꧘꧙꩐꩑꩒꩓꩔꩕꩖꩗꩘꩙꯰꯱꯲꯳꯴꯵꯶꯷꯸꯹0123456789𐒠𐒡𐒢𐒣𐒤𐒥𐒦𐒧𐒨𐒩𑁦𑁧𑁨𑁩𑁪𑁫𑁬𑁭𑁮𑁯𑃰𑃱𑃲𑃳𑃴𑃵𑃶𑃷𑃸𑃹𑄶𑄷𑄸𑄹𑄺𑄻𑄼𑄽𑄾𑄿𑇐𑇑𑇒𑇓𑇔𑇕𑇖𑇗𑇘𑇙𑛀𑛁𑛂𑛃𑛄𑛅𑛆𑛇𑛈𑛉
on your keyboard because they are all valid *as of now* inside the string you pass to float()?
He has these: 123456789 (and 0) because Japanese input is necessarily context-dependent.
On 12/07/13 23:09, Gerald Britton wrote:
Do you have the infinity symbol on your keyboard? I don't!
Oh, you probably do. On Windows: Hold down ALT and type 236 on the numeric keypad. On Mac: Option-5 On Linux: Don't ask. It is possible, but only three men have ever understood how. One of them is now dead. The second is a German professor who has gone mad. And the third was me, but I have forgotten. (Apologies to Lord Palmertson.) Lack of keyboard support for non-ASCII characters is only a weak argument against. Firstly, nobody will be forced to type such non-ASCII characters. Alternatives include copy and paste, Character Map applications, or simply not using them at all. Secondly, if there is need for entering such characters, I am sure that people will develop ways to do so. After all, people manage to enter Japanese and Chinese, and program in APL. I do not believe that ∞ is an important enough value for most developers that Python should support it natively. If Python were *my* language, I would quite likely include ∞ as a built-in literal for infinity (but which one? float or Decimal?) but I recognise that is my personal quirk, a little like spelling "not equal" as != instead of <> as the FLUFL intended. [Aside: there's precedent for a programming language to understand ∞ directly. It has been many years since I last used it, but my recollection of Apple's HyperTalk was that ∞ was recognised as infinity. I may be confabulating this though.] If Python were more heavily oriented towards mathematics, then it would be arguable that ∞ should be a literal, or at least the '∞' be understood by float. But it's not, so although I personally would use float('∞') or even a literal ∞, I don't think it is useful enough to the average Python programmer to justify the added complexity to the language. As tiny as that added complexity is, the added benefit is even tinier. So although my personal preference is to say "F--- yeah!" to the idea, being responsible to the entire community, my vote goes to -1. Those who want to support ∞ can write code to support it. The same goes to suggestions that Python support Unicode numeric non-digits like Roman numerals, fractional forms, circled numbers, etc. If you need that, write a function. The benefit to the language is smaller than the increased complexity, so -1. -- Steven
Why not include physical constants as well? float('Å') = 1E-10 float('c') = 2.9979E8 float('R') = 8.314 -1 (if I have a vote) Sturla Den 12. juli 2013 kl. 15:09 skrev Gerald Britton <gerald.britton@gmail.com>:
On 12 July 2013 13:36, Zaur Shibzukhov <szport at gmail.com> wrote:
Hello!
Is it good idea to allow float('∞') to be float('inf') in python?
Why?
Because it obviously means infinity -- much more so than "inf" does :)
Do you have the infinity symbol on your keyboard? I don't! So, for me, should I ask for
float('oo')
??
-1
-- Gerald Britton _______________________________________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas
воскресенье, 14 июля 2013 г., 19:07:29 UTC+4 пользователь Sturla Molden написал:
Why not include physical constants as well?
float('Å') = 1E-10 float('c') = 2.9979E8 float('R') = 8.314
Because '±∞' isn't denote a constant but special value of float point
standard. Symbol ∞ naturally represent infinity and as I know it's unique in unicode standard.
_______________________________________________
Python-ideas mailing list Python...@python.org <javascript:> http://mail.python.org/mailman/listinfo/python-ideas
participants (8)
-
Alexander Belopolsky -
Gerald Britton -
Joshua Landau -
Laurens Van Houtven -
Stephen J. Turnbull -
Steven D'Aprano -
Sturla Molden -
Zaur Shibzukhov