[issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers

2022-01-20 Thread Akuli
Akuli added the comment: > I also think that keeping a status quo (ignoring the mapping attribute in > typing) is the lesser evil. Can you clarify this? There are several things that typing could do, and I don't know which option you are referring to. I listed most of them belo

[issue46399] Addition of `mapping` attribute to dict views classes has inadvertently broken type-checkers

2022-01-21 Thread Akuli
Akuli added the comment: I now agree that `# type: ignore` in dict subclasses makes sense the most, and exposing the views doesn't solve practical problems. We talked more with the people who brought this up in typing. Turns out that the correct solution to their problems was to

[issue45620] A misleading url in 'Floating Point Arithmetic' page

2022-02-20 Thread Akuli
Akuli added the comment: If you still have the problem, can you show us what headers your browser sends to websites? You can see that by running in Python: import socket print(socket.create_server(('127.0.0.1', 12345)).accept()[0].recv(1024).decode()) and then goi

[issue44021] enum docs in 3.10: missing "New in version 3.10"

2021-05-03 Thread Akuli
New submission from Akuli : https://docs.python.org/3.10/library/enum.html says "New in version 3.10: StrEnum". That's true, but these are also new in 3.10: - property (I mean enum.property, not the built-in property) - global_enum - FlagBoundary - StrEnum - EnumType (does thi

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-09 Thread Akuli
New submission from Akuli : The purpose of focus_get() is to return the widget that currently has the focus. It tries to convert its result to a tkinter widget, which can fail, because not all Tk widgets are known to tkinter. Consider this, for example: import tkinter def

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-09 Thread Akuli
Akuli added the comment: Forgot to mention: The correct fix IMO would be to return None when a KeyError occurs. This way code like `focus_get() == some_tkinter_widget` would always do the right thing, for example. -- ___ Python tracker <ht

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-09 Thread Akuli
Akuli added the comment: I found issue734176 before I created this. It is NOT a duplicate. While issue734176 is about menus, this one is about focus_get(), and not necessarily related to menus. In fact, I initially noticed this with an "open file" dialog, not with a menu. I

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-09 Thread Akuli
Akuli added the comment: Unfortunately I don't know any real-world examples of this on Windows. The open file dialog works very differently on Windows: it uses the native Windows dialog, whereas on Linux, it's implemented in Tcl. Meanwhile, here's a platform-independ

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-17 Thread Akuli
Akuli added the comment: Here are the options: - Do nothing. My program will error in some corner cases. - Change it to return `None`, so `widget.focus_get() is not None` no longer means "this application doesn't have focus", but rather "this application doesn't

[issue44592] tkinter focus_get() with non-tkinter Tk widget

2021-07-17 Thread Akuli
Akuli added the comment: Typo in previous message: I meant `widget.focus_get() is None`. It currently means "this application doesn't have focus", while `is not None` currently means "this application has focus". -- _

[issue44021] enum docs in 3.10: missing "New in version 3.10"

2021-07-27 Thread Akuli
Change by Akuli : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue44021> ___ ___ Python-bugs-list

[issue45620] A misleading url in 'Floating Point Arithmetic' page

2021-12-06 Thread Akuli
Akuli added the comment: To me, it redirects or doesn't redirect to the drugs site, depending on what Accept-Language header your browser sends. And when the redirecting happens, the site is in chinese. (I don't speak chinese, and I don't know why my browser is sending

[issue45620] A misleading url in 'Floating Point Arithmetic' page

2021-12-07 Thread Akuli
Akuli added the comment: Thanks! Works for me in browser now. -- ___ Python tracker <https://bugs.python.org/issue45620> ___ ___ Python-bugs-list mailin

[issue43018] unwanted label showing up in ttk.LabeledScale

2021-01-24 Thread Akuli
New submission from Akuli : import tkinter from tkinter import ttk root = tkinter.Tk() ttk.LabeledScale(root).pack() root.mainloop() Run this code and move the slider to center. You see something in front of the number. The problem is this line in ttk.py: tmp = Label(self).pack(side

[issue41384] tkinter raises TypeError when it's supposed to raise TclError

2020-07-24 Thread Akuli
New submission from Akuli : from Lib:tkinter/__init__.py: raise TclError('unknown option -'+kwargs.keys()[0]) This is no longer valid in Python 3. -- components: Tkinter messages: 374188 nosy: Akuli priority: normal pull_requests: 20748 severity: normal status:

[issue41409] deque.pop(index) is not supported

2020-07-27 Thread Akuli
New submission from Akuli : The pop method of collections.deque can't be used like deque.pop(index), even though `del deque[index]` or deque.pop() without an argument works. This breaks the Liskov substitution principle because collections.abc.MutableMapping supports the .pop(index)

[issue41409] deque.pop(index) is not supported

2020-07-27 Thread Akuli
Akuli added the comment: I meant MutableSequence instead of MutableMapping. Oops. -- ___ Python tracker <https://bugs.python.org/issue41409> ___ ___ Python-bug

[issue41409] deque.pop(index) is not supported

2020-07-28 Thread Akuli
Akuli added the comment: I don't think it's very common to write code that needs to work with any MutableSequence but not with any Sequence. I think that's the only situation where missing support for deque.pop(index) is a problem. Maybe deque should be a Sequence but not a

[issue40666] TarFile.add does not support pathlib.Path as a value to first argument.

2020-07-31 Thread Akuli
New submission from Akuli : TarFile.add seems to support pathlib.Path objects (and other PathLike string paths) starting at Python 3.6, for both name and arcname. The paths go to `os.path` functions that return strings. Recently typeshed was updated to support passing pathlib.Paths in

[issue30978] str.format_map() silences exceptions in __getitem__

2017-07-20 Thread Akuli
New submission from Akuli: Example: class BrokenMapping: def __getitem__(self, key): 1/0 # this silences the ZeroDivisionError and raises KeyError('world') 'hello {world}'.format_map(BrokenMapping()) I have tried this on several differ

[issue30978] str.format_map() silences exceptions in __getitem__

2017-07-21 Thread Akuli
Akuli added the comment: I think all exceptions should be passed through. Things like dict.__contains__ don't selectively turn some errors to KeyError either; if something is not hashable it's a TypeError, not a KeyError. >>> [] in {} Traceback (most recent cal

[issue30978] str.format_map() silences exceptions in __getitem__

2017-07-21 Thread Akuli
Akuli added the comment: Oops, I forgot to mention that I have no thoughts about backporting this. It would be nice to see this fixed in 3.7 though :) -- ___ Python tracker <http://bugs.python.org/issue30