[issue42238] Deprecate suspicious.py?

2022-02-09 Thread Julien Palard
Julien Palard added the comment: New changeset b878b3af0b3a9e3ab3ffcaf90a4066dfb3bb7cac by Julien Palard in branch 'main': bpo-42238: [doc] moving from rstlint.py to sphinx-lint. (GH-31097) https://github.com/python/cpython/commit/b878b3af0b3a9e3ab3ffcaf90a4066dfb3bb7cac --

[issue45393] help() on operator precedence has confusing entries "await" "x" and "not" "x"

2022-02-09 Thread Zackery Spytz
Zackery Spytz added the comment: I have created a patch for this issue. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue45393] help() on operator precedence has confusing entries "await" "x" and "not" "x"

2022-02-09 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch nosy: +ZackerySpytz nosy_count: 5.0 -> 6.0 pull_requests: +29415 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31246 ___ Python tracker

Re: How to solve the given problem?

2022-02-09 Thread Christian Gollwitzer
Am 10.02.22 um 07:40 schrieb NArshad: Assume that there is a pattern of feeding for a special fish in a day (10 hours a day) as below: 150100303030202010 55 Today, the fish is fed in the second hour 60 unit instead of 100 unit

How to solve the given problem?

2022-02-09 Thread NArshad
Assume that there is a pattern of feeding for a special fish in a day (10 hours a day) as below: 150100303030202010 55 Today, the fish is fed in the second hour 60 unit instead of 100 unit Accidently. Implement some methods to

[issue21910] [doc] File protocol should document if writelines must handle generators sensibly

2022-02-09 Thread Stanley
Change by Stanley : -- keywords: +patch pull_requests: +29414 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/31245 ___ Python tracker

[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Raymond Hettinger
Change by Raymond Hettinger : Added file: https://bugs.python.org/file50615/instrument_issubset.py ___ Python tracker ___ ___

[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Raymond Hettinger
Change by Raymond Hettinger : Removed file: https://bugs.python.org/file50614/instrument_issubset.py ___ Python tracker ___ ___

[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Raymond Hettinger
Change by Raymond Hettinger : Removed file: https://bugs.python.org/file50613/instrument_issubset.py ___ Python tracker ___ ___

[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: I've run a few more experiments and this looks like a net win more often than not. Go ahead and submit a PR so we can evaluate it further. -- Added file: https://bugs.python.org/file50614/instrument_issubset.py

[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: We care more about the running speed than the memory usage. Since sets only store pointers to data, they are typically smaller than the data they refer to. I've attached some instrumentation code for running experiments to verify the workload under

[issue45923] Improve performance of sys.settracing based tools.

2022-02-09 Thread Brandt Bucher
Change by Brandt Bucher : -- nosy: +brandtbucher nosy_count: 3.0 -> 4.0 pull_requests: +29413 pull_request: https://github.com/python/cpython/pull/31244 ___ Python tracker ___

[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Thanks Anthony for the report! -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 9b23f8f78fdb0d7eba016616ae7a97abbfc65aa6 by Pablo Galindo Salgado in branch '3.10': [3.10] bpo-46707: Avoid potential exponential backtracking in some syntax errors (GH-31241). (GH-31242)

[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Raymond Hettinger
Change by Raymond Hettinger : -- versions: -Python 3.10, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker ___ ___

[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +29412 pull_request: https://github.com/python/cpython/pull/31242 ___ Python tracker ___

[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset b71dc71905ab674ccaa4a56230d17a28f61c325c by Pablo Galindo Salgado in branch 'main': bpo-46707: Avoid potential exponential backtracking in some syntax errors (GH-31241)

[issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs

2022-02-09 Thread Gregory Beauregard
Gregory Beauregard added the comment: I wrote a PR that fixes the underlying issue here, but I'm leaving it as a draft while the discussion plays out. I think the stuff currently in the patch should be okay regardless of the discussion decision, because the underlying issue is that P.args

[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- keywords: +patch pull_requests: +29411 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31241 ___ Python tracker

[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread anthony shaw
Change by anthony shaw : -- versions: +Python 3.10, Python 3.11 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue46707] Parser hanging on stacked { tokens

2022-02-09 Thread anthony shaw
New submission from anthony shaw : Providing an (invalid) input to the parser causes an exponentially-slow DoS to the Python executable in 3.10. e.g. python3.10 -c "{:" takes ~2 seconds python3.10 -c ":" takes ~22 seconds Tested this all the

Re: C API PyObject_Call segfaults with string

2022-02-09 Thread MRAB
On 2022-02-10 01:37, Jen Kris via Python-list wrote: I'm using Python 3.8 so I tried your second choice: pSents = PyObject_CallFunctionObjArgs(pSentMod, pListItem); but pSents is 0x0.  pSentMod and pListItem are valid pointers. 'PyObject_CallFunction' looks like a good one to use:

[issue46704] Parser API not checking for null-terminator

2022-02-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: The contract of that interface is to receive null-terminated strings, so I am a bit clueless on how this could receive a non-null terminated string. Notice that calling PyRun_StringFlags with a non-null terminated string is out of contract.

[issue46704] Parser API not checking for null-terminator

2022-02-09 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- Removed message: https://bugs.python.org/msg412970 ___ Python tracker ___ ___ Python-bugs-list

[issue46704] Parser API not checking for null-terminator

2022-02-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: The contract of that interface is to receive null-terminated strings, so I am a bit clueless on how this could receive a non-null terminated string. Notice that calling CompileCode with a non-null terminated string is out of contract. --

[issue46704] Parser API not checking for null-terminator

2022-02-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Could you please provide an example input to reproduce this? -- ___ Python tracker ___

[issue46703] boolean operation issue (True == False == False)

2022-02-09 Thread Eryk Sun
Eryk Sun added the comment: > True == False == False is really True == False and False == False > wich is False and True which is False Moreover, since the left-hand comparison is `True == False`, which evaluates to False, the right-hand comparison doesn't even get evaluated. In the

Re: C API PyObject_Call segfaults with string

2022-02-09 Thread Jen Kris via Python-list
I'll do that and post back tomorrow.  The office is closing and I have to leave now (I'm in Seattle).  Thanks again for your help.  Feb 9, 2022, 17:40 by songofaca...@gmail.com: > On Thu, Feb 10, 2022 at 10:37 AM Jen Kris wrote: > >> >> I'm using Python 3.8 so I tried your second choice: >>

Re: Best way to check if there is internet?

2022-02-09 Thread Avi Gross via Python-list
Actually, you may want a dynamic page. Pages may sometimes be delivered from some cache along the way perhaps within your own company firewall if someone else recently accessed them. Consider a page that returns the current time or like the following asks for an arithmetical calculation to add

Re: C API PyObject_Call segfaults with string

2022-02-09 Thread Inada Naoki
On Thu, Feb 10, 2022 at 10:37 AM Jen Kris wrote: > > I'm using Python 3.8 so I tried your second choice: > > pSents = PyObject_CallFunctionObjArgs(pSentMod, pListItem); > > but pSents is 0x0. pSentMod and pListItem are valid pointers. > It means exception happened. If you are writing Python/C

[issue46706] AxelRacer

2022-02-09 Thread Dennis Sweeney
New submission from Dennis Sweeney : I'm closing this -- if you found a bug in Python, please be sure to describe thoroughly what bug you found, steps to reproduce the bug, and what behavior you expected. -- nosy: +Dennis Sweeney resolution: -> not a bug stage: -> resolved status:

Re: C API PyObject_Call segfaults with string

2022-02-09 Thread Jen Kris via Python-list
I'm using Python 3.8 so I tried your second choice: pSents = PyObject_CallFunctionObjArgs(pSentMod, pListItem); but pSents is 0x0.  pSentMod and pListItem are valid pointers.  Feb 9, 2022, 17:23 by songofaca...@gmail.com: > // https://docs.python.org/3/c-api/call.html#c.PyObject_CallNoArgs >

[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Dennis Sweeney
Change by Dennis Sweeney : -- nosy: +rhettinger, serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue46706] AxelRacer

2022-02-09 Thread claude-alexandre cabana
Change by claude-alexandre cabana : -- components: Build nosy: claudealexcabana priority: normal severity: normal status: open title: AxelRacer type: performance versions: Python 3.11 ___ Python tracker

Re: C API PyObject_Call segfaults with string

2022-02-09 Thread Inada Naoki
// https://docs.python.org/3/c-api/call.html#c.PyObject_CallNoArgs // This function is only for one arg. Python >= 3.9 is required. pSents = PyObject_CallOneArg(pSentMod, pListItem); Or // https://docs.python.org/3/c-api/call.html#c.PyObject_CallFunctionObjArgs // This function can call function

[issue46705] Memory optimization for set.issubset

2022-02-09 Thread Jack Nguyen
New submission from Jack Nguyen : I noticed that the set.issubset cpython implementation casts its iterable argument to a set. In some cases, casting the whole iterable to a set is unnecessary (see https://bugs.python.org/issue18032). Although the latter suggestion is to perform early

[issue46704] Parser API not checking for null-terminator

2022-02-09 Thread anthony shaw
New submission from anthony shaw : In tokenizer.c, the translate_newlines() function does a `strlen()` on the input string, if the string is not null-terminated, e.g. '\xbe' this leads to a heap-buffer-overflow. The overflow is not exploitable, but if there are further changes to the parser,

Re: C API PyObject_Call segfaults with string

2022-02-09 Thread Jen Kris via Python-list
Right you are.  In that case should I use Py_BuildValue and convert to tuple (because it won't return a tuple for a one-arg), or should I just convert pListStr to tuple?  Thanks for your help.  Feb 9, 2022, 17:08 by songofaca...@gmail.com: > On Thu, Feb 10, 2022 at 10:05 AM Jen Kris wrote:

Re: C API PyObject_Call segfaults with string

2022-02-09 Thread Inada Naoki
On Thu, Feb 10, 2022 at 10:05 AM Jen Kris wrote: > > Thanks for your reply. > > I eliminated the DECREF and now it doesn't segfault but it returns 0x0. Same > when I substitute pListStrE for pListStr. pListStr contains the string > representation of the fileid, so it seemed like the one to

[issue46703] boolean operation issue (True == False == False)

2022-02-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: This is not a bug. Please check the docs on the ternary operator: https://docs.python.org/3/reference/expressions.html#comparisons In particular: Comparisons can be chained arbitrarily, e.g., x < y <= z is equivalent to x < y and y <= z, except that

[issue46703] boolean operation issue (True == False == False)

2022-02-09 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- Removed message: https://bugs.python.org/msg412963 ___ Python tracker ___ ___ Python-bugs-list

[issue46703] boolean operation issue (True == False == False)

2022-02-09 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: This is not a bug. Please check the docs on the ternary operator: https://docs.python.org/3/reference/expressions.html#comparisons In particular: Comparisons can be chained arbitrarily, e.g., x < y <= z is equivalent to x < y and y <= z, except that

Re: C API PyObject_Call segfaults with string

2022-02-09 Thread Jen Kris via Python-list
Thanks for your reply.  I eliminated the DECREF and now it doesn't segfault but it returns 0x0.  Same when I substitute pListStrE for pListStr.  pListStr contains the string representation of the fileid, so it seemed like the one to use.  According to 

[issue46702] Specialize UNPACK_SEQUENCE

2022-02-09 Thread Brandt Bucher
Brandt Bucher added the comment: (I also plan on looking into an adaptive super-duper-instruction for UNPACK_SEQUENCE_TWO_TUPLE__STORE_FAST__STORE_FAST after the current PR has landed). -- ___ Python tracker

[issue46703] boolean operation issue (True == False == False)

2022-02-09 Thread jung mo sohn
New submission from jung mo sohn : In python 3.6.8, 3.7.3, 3.7.4, 3.7.5, 3.7.12, 3.8.8 versions, the output is False as shown below. Python 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 00:11:34) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more

Re: C API PyObject_Call segfaults with string

2022-02-09 Thread Inada Naoki
On Thu, Feb 10, 2022 at 9:42 AM Jen Kris via Python-list wrote: > > I have everything finished down to the last line (sentences = > gutenberg.sents(fileid)) where I use PyObject_Call to call gutenberg.sents, > but it segfaults. The fileid is a string -- the first fileid in this corpus > is

C API PyObject_Call segfaults with string

2022-02-09 Thread Jen Kris via Python-list
This is a follow-on to a question I asked yesterday, which was answered by MRAB.   I'm using the Python C API to load the Gutenberg corpus from the nltk library and iterate through the sentences.  The Python code I am trying to replicate is: from nltk.corpus import gutenberg for i, fileid in

[issue46702] Specialize UNPACK_SEQUENCE

2022-02-09 Thread Brandt Bucher
Change by Brandt Bucher : -- keywords: +patch pull_requests: +29410 pull_request: https://github.com/python/cpython/pull/31240 ___ Python tracker ___

[issue46702] Specialize UNPACK_SEQUENCE

2022-02-09 Thread Brandt Bucher
New submission from Brandt Bucher : UNPACK_SEQUENCE already has fast paths for tuples and lists, which make up (literally) 99% of unpackings in the benchmark suite. What's more, two-element tuples make up about two-thirds of all unpackings (though I actually suspect it's even higher, since

[issue46691] sysconfig.get_platform() raises ValueError on macOS if '-arch' is present in CFLAGS but doesn't refer to the '-arch' compiler flag

2022-02-09 Thread Ned Deily
Change by Ned Deily : -- Removed message: https://bugs.python.org/msg412958 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue46691] sysconfig.get_platform() raises ValueError on macOS if '-arch' is present in CFLAGS but doesn't refer to the '-arch' compiler flag

2022-02-09 Thread Ned Deily
Ned Deily added the comment: Thanks for the report; I don't recall this coming up before. Of course, the easy workaround is to avoid using "-arch" in CFLAGS paths and the like, but we should fix this. -- ___ Python tracker

[issue46691] sysconfig.get_platform() raises ValueError on macOS if '-arch' is present in CFLAGS but doesn't refer to the '-arch' compiler flag

2022-02-09 Thread Ned Deily
Ned Deily added the comment: Thanks for the report; I don't recall this coming up before. Of course, the easy workaround is to avoid using "arch" in CFLAGS paths and the like, but we should fix this. -- components: +macOS nosy: +ned.deily, ronaldoussoren type: crash -> compile error

[issue36876] [subinterpreters] Global C variables are a problem

2022-02-09 Thread Eric Snow
Eric Snow added the comment: New changeset cb68788dcadf43b47292bab7816a5ed9efa69730 by Eric Snow in branch 'main': bpo-36876: Minor cleanup to c-analyzer "ignored" data.' (gh-31239) https://github.com/python/cpython/commit/cb68788dcadf43b47292bab7816a5ed9efa69730 --

[issue40255] Fixing Copy on Writes from reference counting and immortal objects

2022-02-09 Thread Eric Snow
Eric Snow added the comment: @Eddie, what can I do to push this forward? FYI, in addition to the python-dev thread a few weeks back, I've brought the matter up with the steering council. [1] Also, if we can get back to performance-neutral (currently at about 4% slower) then there would be

[issue46701] cannot use typographical quotation marks in bug description

2022-02-09 Thread Eric V. Smith
Eric V. Smith added the comment: Please report bug tracker bugs at https://github.com/python/bugs.python.org Although to be honest I doubt this will be fixed, since we're moving to Github issues. -- nosy: +eric.smith resolution: -> third party stage: -> resolved status: open ->

[issue36876] [subinterpreters] Global C variables are a problem

2022-02-09 Thread Eric Snow
Change by Eric Snow : -- pull_requests: +29409 pull_request: https://github.com/python/cpython/pull/31239 ___ Python tracker ___

[issue46528] Simplify the VM's stack manipulations

2022-02-09 Thread Brandt Bucher
Change by Brandt Bucher : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue46528] Simplify the VM's stack manipulations

2022-02-09 Thread Brandt Bucher
Brandt Bucher added the comment: New changeset 78ae4cc6dc949e8bc39fab25fea5efe983dc0ad1 by Brandt Bucher in branch 'main': bpo-46528: Attempt SWAPs at compile-time (GH-30970) https://github.com/python/cpython/commit/78ae4cc6dc949e8bc39fab25fea5efe983dc0ad1 --

[issue46643] typing.Annotated cannot wrap typing.ParamSpec args/kwargs

2022-02-09 Thread Gregory Beauregard
Change by Gregory Beauregard : -- keywords: +patch pull_requests: +29408 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31238 ___ Python tracker

[issue46701] cannot use typographical quotation marks in bug description

2022-02-09 Thread mirabilos
New submission from mirabilos : When trying to use typographical quotation marks (U+201C, U+201D) in the Comment field trying to submit a bug here, I get a red-background error message saying: Error: 'utf8' codec can't decode bytes in position 198-199: invalid continuation byte --

[issue46700] wrong nomenclature (options vs. arguments) in argparse

2022-02-09 Thread mirabilos
New submission from mirabilos : The argparse documentation and tutorial as well as its default option groups speak of "positional arguments" and "optional arguments". These are not used correctly, though. Elements of the argument vector (past item #0) are distinguished as options and

[issue46693] dataclass generated __str__ does not use overridden member __str__

2022-02-09 Thread Eric V. Smith
Eric V. Smith added the comment: I'll close it. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

[issue46697] _ctypes_simple_instance returns inverted logic

2022-02-09 Thread Eryk Sun
Change by Eryk Sun : -- stage: -> patch review versions: -Python 3.7, Python 3.8 ___ Python tracker ___ ___ Python-bugs-list

[issue46697] _ctypes_simple_instance returns inverted logic

2022-02-09 Thread hydroflask
hydroflask added the comment: I place that patch into the public domain, I claim no ownership over that patch. The patch is attached purely for demonstration purposes. -- ___ Python tracker

[issue46697] _ctypes_simple_instance returns inverted logic

2022-02-09 Thread hydroflask
New submission from hydroflask : `_ctypes_simple_instance` in _ctypes.c returns the opposite logic of what its documentation claims. It is supposed to return true when the argument (a type object) is a direct subclass of `Simple_Type` (`_SimpleCData` in Python code). However it returns false

[issue43532] Add keyword-only fields to dataclasses

2022-02-09 Thread Eric V. Smith
Eric V. Smith added the comment: Thanks, Henry Schreiner! -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue46696] socketmodule add Linux SO_INCOMING_CPU constant

2022-02-09 Thread David CARLIER
New submission from David CARLIER : Adding Linux's SO_INCOMING_CPU constant for setsockopt. -- components: +Library (Lib) keywords: +patch message_count: None -> 1.0 pull_requests: +29407 stage: -> patch review title: socketmodule add Linux SO_INCOMING_CPU constasn -> socketmodule add

[issue46696] socketmodule add Linux SO_INCOMING_CPU constasn

2022-02-09 Thread David CARLIER
Change by David CARLIER : -- nosy: devnexen priority: normal severity: normal status: open title: socketmodule add Linux SO_INCOMING_CPU constasn ___ Python tracker ___

[issue43532] Add keyword-only fields to dataclasses

2022-02-09 Thread miss-islington
miss-islington added the comment: New changeset 7445949a4399ab19fbdd5a0b0aca53a690c3251b by Miss Islington (bot) in branch '3.10': bpo-43532: add version added to KW_ONLY (GH-31235) https://github.com/python/cpython/commit/7445949a4399ab19fbdd5a0b0aca53a690c3251b --

[issue43532] Add keyword-only fields to dataclasses

2022-02-09 Thread miss-islington
Change by miss-islington : -- pull_requests: +29406 pull_request: https://github.com/python/cpython/pull/31236 ___ Python tracker ___

[issue43532] Add keyword-only fields to dataclasses

2022-02-09 Thread miss-islington
miss-islington added the comment: New changeset 5a3f97291eea96037cceee097ebc00bba44bc9ed by Henry Schreiner in branch 'main': bpo-43532: add version added to KW_ONLY (GH-31235) https://github.com/python/cpython/commit/5a3f97291eea96037cceee097ebc00bba44bc9ed -- nosy:

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-09 Thread hydroflask
hydroflask added the comment: For reference, here are MSDN, Linux, OpenBSD, and GCC docs on alloca: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/alloca?view=msvc-170 https://www.man7.org/linux/man-pages/man3/alloca.3.html https://man.openbsd.org/alloca.3

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-09 Thread STINNER Victor
STINNER Victor added the comment: I failed to find the doc about alloca(0). It seems like the existing _ctypes_callproc() function *can* call alloca(0) if argtuple is empty and pIunk is 0 (pIunk is specific to Windows). -- ___ Python tracker

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-09 Thread hydroflask
hydroflask added the comment: @corona10 I really hope I am not being annoying at this point :) One final nit, in this line: https://github.com/python/cpython/pull/31224/files#diff-706e65ee28911740bf638707e19578b8182e57c6a8a9a4a91105d825f95a139dR168 You do not have to check if nargs > 0.

[issue43532] Add keyword-only fields to dataclasses

2022-02-09 Thread Henry Schreiner
Change by Henry Schreiner : -- nosy: +Henry Schreiner nosy_count: 9.0 -> 10.0 pull_requests: +29405 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31235 ___ Python tracker

Re: Unpacking lists in a f string

2022-02-09 Thread Kirill Ratkin
Hi. Try this: f"foo {','.join([f'{a} {b}' for a,b in list(zip(l1,l2))])} bar" 09.02.2022 21:13, Paulo da Silva пишет: Às 02:17 de 09/02/22, Paulo da Silva escreveu: Hi! Let's say I have two lists of equal length but with a variable number of elements. For ex.: l1=['a','b','c']

Re: How do you log in your projects?

2022-02-09 Thread Martin Di Paola
- On a line per line basis? on a function/method basis? In general I prefer logging line by line instead per function. It is easy to add a bunch of decorators to the functions and get the logs of all the program but I most of the time I end up with very confusing logs. There are

[issue46528] Simplify the VM's stack manipulations

2022-02-09 Thread Brandt Bucher
Brandt Bucher added the comment: New changeset 46328d8ae6529db916ccaabb9247fb0327ce0c1e by Brandt Bucher in branch 'main': bpo-46528: Check PyMem_Malloc for NULL (GH-30998) https://github.com/python/cpython/commit/46328d8ae6529db916ccaabb9247fb0327ce0c1e --

Re: PermissionError: [Errno 13] Permission denied: 'Abc.xlsx'

2022-02-09 Thread Dennis Lee Bieber
On Tue, 8 Feb 2022 23:46:15 -0800 (PST), NArshad declaimed the following: >When I enter data using Tkinter form in an Excel file when the excel file is >closed there is no error but when I enter data using Tkinter form when the >excel is already open following error comes: >

Re: Unpacking lists in a f string

2022-02-09 Thread Paulo da Silva
Às 02:17 de 09/02/22, Paulo da Silva escreveu: Hi! Let's say I have two lists of equal length but with a variable number of elements. For ex.: l1=['a','b','c'] l2=['j','k','l'] I want to build a string like this "foo a j, b k, c l bar" Is it possible to achieve this with f strings or any

Re: PermissionError: [Errno 13] Permission denied: 'Abc.xlsx'

2022-02-09 Thread MRAB
On 2022-02-09 12:45, Christian Gollwitzer wrote: Am 09.02.22 um 08:46 schrieb NArshad: When I enter data using Tkinter form in an Excel file when the excel file is closed there is no error but when I enter data using Tkinter form when the excel is already open following error comes:

[issue46694] isdigit/isnumeric vs int()

2022-02-09 Thread Mark Dickinson
Change by Mark Dickinson : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue46694] isdigit/isnumeric vs int()

2022-02-09 Thread Mark Dickinson
Mark Dickinson added the comment: This is by design: int looks for characters with the Unicode Decimal (De) numeric type, corresponding to str.isdecimal(), rather than for the Digit (Di) or Numeric (Nu) numeric types. >>> "²".isdecimal() False -- nosy: +mark.dickinson

[issue46072] Unify handling of stats in the CPython VM

2022-02-09 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +29404 pull_request: https://github.com/python/cpython/pull/31234 ___ Python tracker ___

[issue46430] intern strings in deepfrozen modules

2022-02-09 Thread Guido van Rossum
Guido van Rossum added the comment: We discussed that and found that a lot of errors are ignored during interning anyway. But it's not too late to change if you want to (sending a PR would probably be quicker than arguing :-). -- ___ Python

[issue46323] Use _PyObject_Vectorcall in Modules/_ctypes/callbacks.c

2022-02-09 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset d18120cd67b4297f78bfc9bf7b36774cf0bf15f2 by Dong-hee Na in branch 'main': bpo-46323: Reduce stack usage of ctypes python callback function. (GH-31224) https://github.com/python/cpython/commit/d18120cd67b4297f78bfc9bf7b36774cf0bf15f2 --

[issue46695] _io_TextIOWrapper_reconfigure_impl errors out too early

2022-02-09 Thread mirabilos
New submission from mirabilos : The following is not possible: with open('/tmp/x.ssv', 'r', newline='\n') as f: f.readline() # imagine a library call boundary here if hasattr(f, 'reconfigure'): f.reconfigure(newline='\n') The .reconfigure() call would not do anything, but

[issue46694] isdigit/isnumeric vs int()

2022-02-09 Thread Nonsense
New submission from Nonsense : When typing in "²".isdigit() or "²".isnumeric() it gives True but when typing in int("²") it errors out: ValueError: invalid literal for int() with base 10: '²' -- components: Interpreter Core messages: 412934 nosy: smtplukas.tanner.test priority: normal

[issue45413] Add install scheme for virtual environments

2022-02-09 Thread Filipe Laíns
Filipe Laíns added the comment: I don't think the proposal is incompatible with what I discussed. I haven't been super clear on my opinions on the implementation, so let me try to clarify them. - I think that we should use a static scheme, accessible on all platforms. - If this scheme needs

Re: Correct way to setup a package with both compiled C code and Python code?

2022-02-09 Thread Dieter Maurer
Christian Gollwitzer wrote at 2022-2-8 22:43 +0100: >Am 08.02.22 um 18:57 schrieb Dieter Maurer: >> Christian Gollwitzer wrote at 2022-2-7 20:33 +0100: >>> we've developed a Python pacakge which consists of both a compiled >>> extension module and some helper functions in Python. Is there a >>>

[issue45863] tarfile zeroes ustar header fields unnecessarily

2022-02-09 Thread STINNER Victor
STINNER Victor added the comment: Thanks Joshua Root for the bug report and the fix! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue45863] tarfile zeroes ustar header fields unnecessarily

2022-02-09 Thread miss-islington
miss-islington added the comment: New changeset b0517a12179a9fe444ca6ce1f31c307883e81c0c by Miss Islington (bot) in branch '3.9': bpo-45863: tarfile: don't zero out header fields unnecessarily (GH-29693) https://github.com/python/cpython/commit/b0517a12179a9fe444ca6ce1f31c307883e81c0c

[issue45863] tarfile zeroes ustar header fields unnecessarily

2022-02-09 Thread miss-islington
miss-islington added the comment: New changeset 42f87d435ebe4f2834c8fd0b4ce38f0b1627f3ed by Miss Islington (bot) in branch '3.10': bpo-45863: tarfile: don't zero out header fields unnecessarily (GH-29693) https://github.com/python/cpython/commit/42f87d435ebe4f2834c8fd0b4ce38f0b1627f3ed

[issue46693] dataclass generated __str__ does not use overridden member __str__

2022-02-09 Thread Bruce Eckel
Bruce Eckel added the comment: Oops. That does in fact work. How do I remove the bug report? *Bruce Eckel* HappyPathProgramming.com SummerTechForum.com MindViewLLC.com Blog: BruceEckel.com EvolveWork.co WinterTechForum.com OnJava8.com

Re: Best way to check if there is internet?

2022-02-09 Thread Abdur-Rahmaan Janhangeer
> This won't work if you're behind a captive portal: every URL you try to get will return successfully, but the content will be the captive portal page. Yes agree a pretty common scenario if you are moving around ... The solution is to test against a webpage you know the content will always be

Re: Best way to check if there is internet?

2022-02-09 Thread Abdur-Rahmaan Janhangeer
> Ah, but WHEN do those browsers report that? When attempting to connect to whatever the default "home" page has been set to? (Mine is configured to use https://www.google.com as the default page -- if my router is down, obviously the browser will time-out waiting for a response from Google, and

[issue46693] dataclass generated __str__ does not use overridden member __str__

2022-02-09 Thread Eric V. Smith
Eric V. Smith added the comment: I believe dataclasses uses repr() of the members, not str(). Can you try using specifying __repr__ in Teacup? Just __repr__ = __str__ should work. -- nosy: +eric.smith ___ Python tracker

[issue46693] dataclass generated __str__ does not use overridden member __str__

2022-02-09 Thread Eric V. Smith
Change by Eric V. Smith : -- assignee: -> eric.smith ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

  1   2   >