Re: [Python-Dev] Symmetry arguments for API expansion

2018-03-20 Thread Steven D'Aprano
On Wed, Mar 21, 2018 at 12:32:11AM +, Chris Barker wrote: > Could float et al. add an __index__ method that would return a ValueError > if the value was not an integer? That would allow us to write things like: "abcdefgh"[5.0] which is one of the things __index__ was invented to prevent.

Re: [Python-Dev] Hello!

2018-03-20 Thread Agnostic Dev
Thank you, Ethan. It sounds like I landed in the right place. Thank you for the heads up. On Tue, Mar 20, 2018 at 11:20 AM, Ethan Furman wrote: > On 03/20/2018 04:15 AM, Agnostic Dev wrote: > > My name is Matt Eaton (Agnostic Dev) and I am just joining the mailing >> list so I wanted to reach o

Re: [Python-Dev] Symmetry arguments for API expansion

2018-03-20 Thread Guido van Rossum
No, the whole point of __index__ is that it refuses *all* floats -- otherwise people will do approximate computations that for their simple test inputs give whole numbers, use them as sequence indices, and then find their code broken only when the computation incurs some floating point approximatio

Re: [Python-Dev] Symmetry arguments for API expansion

2018-03-20 Thread Chris Barker
It seems .as_integer_ratio() has been resolved. what about the original .is_integer() request? (Or did I miss that somehow?) Anyway, it seems like __index__() should play a role here somehow... isn't that how you ask an object for the integer version of itself? Could float et al. add an __index_

Re: [Python-Dev] ttk.Treeview.insert() does not allow to insert item with iid=0

2018-03-20 Thread Chris Barker
On Fri, Mar 16, 2018 at 10:54 AM, Игорь Яковченко wrote: > I investigated problem and found that in ttk.py, Treeview.insert(... > iid=None, ...) in method's body has a check: > if iid: > res = self.tk.call(self._w, "insert", parent, index, > "-id", iid, *opts)

Re: [Python-Dev] Hello!

2018-03-20 Thread Ethan Furman
On 03/20/2018 04:15 AM, Agnostic Dev wrote: My name is Matt Eaton (Agnostic Dev) and I am just joining the mailing list so I wanted to reach out and say hello! Hello back! Welcome to the list! Just as a reminder, this list is for discussions of the development OF Python, or how to make Pyth

[Python-Dev] Hello!

2018-03-20 Thread Agnostic Dev
My name is Matt Eaton (Agnostic Dev) and I am just joining the mailing list so I wanted to reach out and say hello! ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org