[issue42754] Unpacking of literals inside other literals should be optimised away by the compiler

2020-12-28 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- Removed message: https://bugs.python.org/msg383911 ___ Python tracker ___ ___ Python-bugs-list

[issue42754] Unpacking of literals inside other literals should be optimised away by the compiler

2020-12-28 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: We could possibly fold this at the AST optimizer, though I am not sure whether this worths anything as an optimization since it is a real obscure pattern. I've only found 2 occurrences (both from a test set on a relatively ~big dataset of source code.

[issue42770] Typo in email.headerregistry docs

2020-12-28 Thread bazwal
New submission from bazwal : The section for class email.headerregistry.ContentDispositionHeader has a typo in an attribute name: "content-disposition" should be corrected to "content_disposition". -- assignee: docs@python components: Documentation messages: 383910 nosy: bazwal,

[issue42765] Introduce new data model method __iter_items__

2020-12-28 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +bob.ippolito ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42765] Introduce new data model method __iter_items__

2020-12-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: This core of this idea is plausible. It is a common problem for people to want to teach a class how to convert itself to and from JSON. Altering the API for dicts is a major step, so you would need to take this to python-ideas to start getting buy-in.

[issue40077] Convert static types to heap types: use PyType_FromSpec()

2020-12-28 Thread miss-islington
miss-islington added the comment: New changeset bf108bb21e1d75e30bd17141cc531dd08a5e5d0c by Erlend Egeberg Aasland in branch 'master': bpo-40077: Fix typo in simplequeue_get_state_by_type() (GH-23975) https://github.com/python/cpython/commit/bf108bb21e1d75e30bd17141cc531dd08a5e5d0c

Re: Which method to check if string index is queal to character.

2020-12-28 Thread Marco Sulla
On Mon, 28 Dec 2020 at 17:37, Bischoop wrote: > > I'd like to check if there's "@" in a string and wondering if any method > is better/safer than others. I was told on one occasion that I should > use is than ==, so how would be on this example. > > s = 't...@mail.is' You could do simply if "@"

[issue42754] Unpacking of literals inside other literals should be optimised away by the compiler

2020-12-28 Thread Batuhan Taskaya
Change by Batuhan Taskaya : -- nosy: +BTaskaya ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42768] super().__new__() of list expands arguments

2020-12-28 Thread Richard Neumann
Richard Neumann added the comment: I could have sworn, that this worked before, but it was obviously me being tired at the end of the work day. Thanks for pointing this out and sorry for the noise. -- ___ Python tracker

[issue30963] xxlimited.c XxoObject_Check should be XxoObject_CheckExact

2020-12-28 Thread hai shi
hai shi added the comment: > #define XxoObject_CheckExact(v) (Py_TYPE(v) == _Type) `#define Xxo_CheckExact(obj) Py_IS_TYPE(obj, _Type)` would be better to hide details now. > #define XxoObject_Check(v) PyObject_TypeCheck(v, _Type) +1 I think the annotation will worth to be updaetd.

[issue40810] sqlite3 test CheckTraceCallbackContent fails for sqlite v3.7.3 through 3.7.14.1

2020-12-28 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42767] Review usage of atomic variables in signamodule.c

2020-12-28 Thread hai shi
Change by hai shi : -- nosy: +shihai1991 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42768] super().__new__() of list expands arguments

2020-12-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Your problem is with list.__init__ method. It expects at most one argument. tuple does not have specialized __init__ method, it inherits it from object. All work is done in tuple.__new__. list does not have specialized __new__ method, it inherits it from

[issue42068] For macOS, package the included Tcl and Tk frameworks in a rational way.

2020-12-28 Thread Marc Culler
Marc Culler added the comment: Hi Ned, I have a comment about the code signing issues that would arise if the Tcl and Tk frameworks were embedded as actual subframeworks inside the Python.framework, and a user later replaced those with newer versions. The answer is that no new issues arise.

[issue42769] concurrent.futures.ProcessPoolExecutor is unable to forward exceptions with state.

2020-12-28 Thread Damien Levac
New submission from Damien Levac : When running tasks on a `ProcessPoolExecutor`, exceptions raised by the dispatched function should be pickled and accessible to the parent process through the `Future.exception` method. On Python 3.9.1 (Linux ryzen3950x 5.4.0-58-generic #64-Ubuntu SMP Wed

Which method to check if string index is queal to character.

2020-12-28 Thread Bischoop
I'd like to check if there's "@" in a string and wondering if any method is better/safer than others. I was told on one occasion that I should use is than ==, so how would be on this example. s = 't...@mail.is' I want check if string is a valid email address. code ''' import time email =

[issue42768] super().__new__() of list expands arguments

2020-12-28 Thread Richard Neumann
New submission from Richard Neumann : When sublassing the built-in list, the invocation of super().__new__ will unexpectedly expand the passed arguments: class MyTuple(tuple): def __new__(cls, *items): print(cls, items) return super().__new__(cls, items) class

[issue42767] Review usage of atomic variables in signamodule.c

2020-12-28 Thread Dong-hee Na
Change by Dong-hee Na : -- nosy: +corona10 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42767] Review usage of atomic variables in signamodule.c

2020-12-28 Thread STINNER Victor
New submission from STINNER Victor : In bpo-41713, I ported the _signal module to the multi-phase initialization API. I tried to move the signal state into a structure to cleanup the code, but I was scared by the following atomic variables: --- static volatile struct {

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: PR 23976 should make _PyInterpreterState_GET() more efficient, and it prepares the code base for one GIL per interpreter (which is purpose of this issue ;-)). -- ___ Python tracker

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: PR 23976 stores the currrent interpreter and the current Python thread state into a Thread Local Storage (TLS) using GCC/clang __thread keyword. On x86-64 using LTO and GCC -O3, _PyThreadState_GET() and _PyInterpreterState_GET() become a single MOV.

[issue42766] urllib.request.HTTPPasswordMgr uses commonprefix instead of commonpath

2020-12-28 Thread Donát Nagy
New submission from Donát Nagy : The is_suburi(self, base, test) method of HTTPPasswordMgr in the urllib.request module tries to "Check if test is below base in a URI tree", but it uses the posixpath.commonprefix() function. This is problematic because commonprefix ignores the path structure

[issue42765] Introduce new data model method __iter_items__

2020-12-28 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +22821 pull_request: https://github.com/python/cpython/pull/23976 ___ Python tracker ___

[issue42765] Introduce new data model method __iter_items__

2020-12-28 Thread Richard Neumann
New submission from Richard Neumann : I have use cases in which I use named tuples to represent data sets, e.g: class BasicStats(NamedTuple): """Basic statistics response packet.""" type: Type session_id: BigEndianSignedInt32 motd: str game_type: str map: str

[issue42764] HTMLParser close() issue

2020-12-28 Thread Anthony Hodson
New submission from Anthony Hodson : HTMLParser close() does not seem to dispose of previous HTML analyses. I an sending a simple test to demonstrate this, complete with functions that are part of a set of testing facilities. The problem is present for more complex HTML. --

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: >_PyInterpreterState_GET(): > movrax,QWORD PTR [rip+0x22a7dd]# 0x743118 <_PyRuntime+568> > movrax,QWORD PTR [rax+0x10] While working on bpo-39465, I wrote PR 20767 to optimize _PyInterpreterState_GET(): single instruction instead of two:

[issue40522] [subinterpreters] Get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: There are many ways to get the current interpreter (interp) and the current Python thread state (tstate). Public C API, opaque function call: * PyInterpreterState_Get() (new in Python 3.9) * PyThreadState_Get() Internal C API, static inline functions: *

[issue42738] subprocess: don't close all file descriptors by default (close_fds=False)

2020-12-28 Thread Eryk Sun
Eryk Sun added the comment: > Python 3.7 added the support for the PROC_THREAD_ATTRIBUTE_HANDLE_LIST > in subprocess.STARTUPINFO: lpAttributeList['handle_list'] parameter. The motivating reason to add support for the WinAPI handle list was to allow changing the default to close_fds=True

[issue27640] add the '--disable-test-suite' option to configure

2020-12-28 Thread Peixing Xin
Change by Peixing Xin : -- nosy: +pxinwr nosy_count: 6.0 -> 7.0 pull_requests: +22820 pull_request: https://github.com/python/cpython/pull/23886 ___ Python tracker ___

[issue42257] platform.libc_ver() doesn't consider in case of executable is empty string

2020-12-28 Thread STINNER Victor
STINNER Victor added the comment: > Currently, `platform.libc_ver()` doesn't consider in case of `executable` > variable is an empty string. I'm curious. In which case sys.executable is an empty string? Do you embed Python in an application. If Python is embedded, would it be possible to

[issue42257] platform.libc_ver() doesn't consider in case of executable is empty string

2020-12-28 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Reviewed. Please check on the PR for comments. -- ___ Python tracker ___ ___

[issue42750] tkinter.Variable equality inconsistency

2020-12-28 Thread Ivo Shipkaliev
Ivo Shipkaliev added the comment: Yes, I get it now. I've missed the idea. You can do: > age = tk.IntVar(value=38, name="mine") > age_str = tk.StringVar(name="mine") > is_alive = tk.BooleanVar(name="mine") > is_alive.get() True Maybe not the best example, but still, it was a

kivy,,, assigning global variable

2020-12-28 Thread Sadaka Technology
class main(..): def init.: super. button = Button(on_release=self.on_click) def on_click(self,screen,*args) self.clear_widgets() if screen == '2nd': float = 2nd() elif screen == '1st': float = 1st()

[issue40077] Convert static types to heap types: use PyType_FromSpec()

2020-12-28 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- pull_requests: +22819 pull_request: https://github.com/python/cpython/pull/23975 ___ Python tracker ___

[issue32825] warn user of creation of multiple Tk instances

2020-12-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue42690] Aiohttp fails when using intel ax200 wireless card

2020-12-28 Thread Ronald Oussoren
Ronald Oussoren added the comment: What's the script used, is it the script in the reddit thread? The reddit thread mentions a change to the script that might help: return [await r.json() for r in responses] To: return await asyncio.gather(*(r.json() for r in responses)) Does

[issue42733] io's r+ mode truncate(0)

2020-12-28 Thread 施文峰
施文峰 added the comment: hi Terry you are right i download python version 3.0.1 to check this case ''' Python 3.0.1 (r301:69556, Dec 28 2020, 14:14:02) [GCC 7.5.0] on linux5 Type "help", "copyright", "credits" or "license" for more information. >>> from test_case import test [43552 refs] >>>

[issue42758] pathlib.Path to support the "in" operator (x in y)

2020-12-28 Thread Eric V. Smith
Eric V. Smith added the comment: I don't think there's any chance we'd add "in" as an alias for "is_relative_to()", so I'm going to close this. If you disagree, you could try and get support on python-ideas, and then we can re-open this. Thanks! -- resolution: -> rejected stage:

[issue42758] pathlib.Path to support the "in" operator (x in y)

2020-12-28 Thread Anton Hvornum
Anton Hvornum added the comment: Missed that function, but they would behave the same without explicitly use the function call. -- ___ Python tracker ___

<    1   2