[Python-ideas] Re: Using explicit parenthesization to convey aspects of semantic meaning?

2020-12-13 Thread David Mertz
On Sun, Dec 13, 2020, 5:11 PM Paul Sokolovsky d > a + b + c vs a + (b + c) > > Here, there's even no guarantee of the same result, if we have user > objects with weirdly overloaded __add__(). > 0.1 + 0.2 + 0.3 != 0.1 + (0.2 + 0.3) > ___

[Python-ideas] Re: Using explicit parenthesization to convey aspects of semantic meaning?

2020-12-13 Thread Chris Angelico
On Mon, Dec 14, 2020 at 5:57 PM Paul Sokolovsky wrote: > > But that's what the question was about, and why there was the intro! > Let's please go over it again. Do you agree with the following: > > a + (b + c) <=> t = b + c; a + t > > ? > > Where "<=>" is the equivalence operator. I do hope you

[Python-ideas] Re: Using explicit parenthesization to convey aspects of semantic meaning?

2020-12-13 Thread Paul Sokolovsky
Hello, On Mon, 14 Dec 2020 09:37:42 +1100 Chris Angelico wrote: > > 2 8 LOAD_NAME0 (obj) > > 10 LOAD_METHOD 1 (meth) ... > > > > 3 16 LOAD_NAME0 (obj) > > 18 LOAD_ATTR1 (meth) ... >

[Python-ideas] Re: Using explicit parenthesization to convey aspects of semantic meaning?

2020-12-13 Thread Chris Angelico
On Mon, Dec 14, 2020 at 9:11 AM Paul Sokolovsky wrote: > What would be the explanation for all that? > > > For reference, the disassembly of the 3 lines with CPython3.7 is > provided: > > 1 0 LOAD_NAME0 (obj) > 2 LOAD_METHOD 1 (meth) >

[Python-ideas] Using explicit parenthesization to convey aspects of semantic meaning?

2020-12-13 Thread Paul Sokolovsky
Hello, How would you feel if explicit parens were used to convey additional semantic meaning? That seems like a pretty dumb question, because, well, parens *are* used to convey additional semantic meaning. E.g.: 1 + 2 + 3 vs 1 + (2 + 3) The result is the same, but somehow I wanted to

[Python-ideas] Re: a new data type: NamedValue -- similar to Enum

2020-12-13 Thread Ethan Furman
On 12/12/20 7:25 PM, Steven D'Aprano wrote: > On Sat, Dec 12, 2020 at 06:00:17PM -0800, Ethan Furman wrote: >> Enum is great! Okay, okay, my opinion might be biased. ;) >> >> There is one area where Enum is not great -- for a bunch of unrelated >> values. > > I don't know how to interpret

[Python-ideas] Re: tkinter Variable implementation

2020-12-13 Thread Ivo Shipkaliev
Yes, will do. Regards Ivo Shipkaliev On Sun, 13 Dec 2020 at 15:40, Ronald Oussoren wrote: > Could you file an issue about this on bugs.python.org? > > Ronald > > — > > Twitter / micro.blog: @ronaldoussoren > Blog: https://blog.ronaldoussoren.net/ > > On 13 Dec 2020, at 03:16, Ivo Shipkaliev

[Python-ideas] Re: tkinter Variable implementation

2020-12-13 Thread Ronald Oussoren via Python-ideas
Could you file an issue about this on bugs.python.org ? Ronald — Twitter / micro.blog: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/ > On 13 Dec 2020, at 03:16, Ivo Shipkaliev wrote: > > Hiya :) > > I'm recently working with tkinter and I noticed that: > >

[Python-ideas] Re: tkinter Variable implementation

2020-12-13 Thread Ivo Shipkaliev
Thank you! On Sun, 13 Dec 2020 at 03:57, William Pickard wrote: > Actually, the error message should read something like this: A valid > instance of Tk is required. > ___ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an

[Python-ideas] Re: [RFC] "Strict execution mode" (TL;DR version)

2020-12-13 Thread Paul Sokolovsky
Hello, On Sun, 6 Dec 2020 00:37:15 -0500 Ricky Teachey wrote: [] > From another who like CHB is just random person on this list (but > probably even more "random"), interested enough to have read the > entire thread and the other thread, but not knowledgeable or > competent enough to offer

[Python-ideas] Re: [RFC] "Strict execution mode" (TL;DR version)

2020-12-13 Thread Paul Sokolovsky
Hello, On Sat, 5 Dec 2020 12:02:52 -0800 Christopher Barker wrote: > just one more note: > > > > things like you are proposing with an eye to performance is not > > > really where the Python community wants to go. > > > > I never met a Python user who said something like "I want Python to >

[Python-ideas] Re: a new data type: NamedValue -- similar to Enum

2020-12-13 Thread Steven D'Aprano
On Sun, Dec 13, 2020 at 12:34:27AM -0800, Ethan Furman wrote: [me] > class MyValue(int, Enum): > >... ONE = 1 > >... TWO = 2 > >... > MyValue.TWO + 3 > >5 > > It certainly can be abused for that, but the intended purpose of IntEnum is > not to support math operations, but rather

[Python-ideas] Re: a new data type: NamedValue -- similar to Enum

2020-12-13 Thread Ethan Furman
On 12/12/20 7:52 PM, Steven D'Aprano wrote: On Sat, Dec 12, 2020 at 07:01:55PM -0800, Ethan Furman wrote: That's invalid. Duplicates allowed means: ``` class K( NamedValue): A = 1 B = 1 ``` B is not an alias for A. Presumably one has the same number with different meaning.