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
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
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
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
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
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
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
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
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
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".
--
_
Change by Akuli :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue44021>
___
___
Python-bugs-list
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
Akuli added the comment:
Thanks! Works for me in browser now.
--
___
Python tracker
<https://bugs.python.org/issue45620>
___
___
Python-bugs-list mailin
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
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:
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)
Akuli added the comment:
I meant MutableSequence instead of MutableMapping. Oops.
--
___
Python tracker
<https://bugs.python.org/issue41409>
___
___
Python-bug
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
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
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
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
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
22 matches
Mail list logo