Re: A technique from a chatbot

2024-04-05 Thread Mark Bourne via Python-list
Stefan Ram wrote: Mark Bourne wrote or quoted: I don't think there's a tuple being created. If you mean: ( word for word in list_ if word[ 0 ]== 'e' ) ...that's not creating a tuple. It's a generator expression, which generates the next value each time it's called for. If you only ever

Re: A technique from a chatbot

2024-04-05 Thread Mark Bourne via Python-list
avi.e.gr...@gmail.com wrote: That is an excellent point, Mark. Some of the proposed variants to the requested problem, including mine, do indeed find all instances only to return the first. This can use additional time and space but when done, some of the overhead is also gone. What I mean

Re: A technique from a chatbot

2024-04-04 Thread Mark Bourne via Python-list
o include an extra set of brackets when passing a generator a the only argument to a function). -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: A missing iterator on itertools module?

2024-04-01 Thread Mark Bourne via Python-list
etermine a module's public API. In that case, setting `__all__ = ["f"]` in `A` should prevent it from offering `math` as a completion (nor any other name that's not in the `__all__` list). -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: Using a background thread with asyncio/futures with flask

2024-03-22 Thread Mark Bourne via Python-list
ds still running. You can either send some sort of signal to the threads signal the threads to exit the loop and return cleanly (you'd also need a timeout on the queue `get()` calls). Or you can create the threads as "daemon" threads (as in the commented-out lines), in which case they'll be killed when all non-daemon threads have exited. Daemon threads don't get a chance to do any cleanup, close resources, etc. when they're killed, though, so aren't always appropriate. -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: Popping key causes dict derived from object to revert to object

2024-03-22 Thread Mark Bourne via Python-list
popping the value if you're not going to do anything with it - just delete the key from the dictionary) -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Attaching a mock function to another mock breaks reset_mock()

2023-06-19 Thread Mark Bourne via Python-list
I should report? Perhaps this is something that's not often done, so the issue hasn't been noticed before. Trying to search for information generally leads back to the unittest.mock documentation, and general tutorials on using create_autospec, attach_mock, etc. without anything specific about this

Re: f-string syntax deficiency?

2023-06-06 Thread Mark Bourne via Python-list
`, that has a similar argument, but `optparse` is deprecated so consider updating to `argparse`. (Recently there has been an effort to provide clearer and more useful error messages; this seems to be a case where there is still room for improvement: "SyntaxError: invalid syntax" doesn't immediately remind me of that fact that 'return' is a keyword and therefor can't be used as an attribute.) -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Fwd: Problems Installing and getting started.

2023-05-31 Thread Mark Bass
-- Forwarded message - From: Mark Bass Date: Wed, 31 May 2023 at 08:09 Subject: Problems Installing and getting started. To: Good morning, I installed python several hours ago (from python.org), I then installed the IDE PyCharm. I'm using AI to help with a project

Re: Question regarding unexpected behavior in using __enter__ method

2023-04-26 Thread Mark Bourne
first example (with `__enter__ = int`) that should be a bit more surprising. (I'm not sure there's much practical use for the original `__enter__ = int` either, but presumably that's just used as a cut-down demonstration). -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: Pycharm IDE

2023-04-19 Thread Mark Bourne
wrote:   print (f'"I am thinking of a number between 1 to {LIMIT}\n")I had the impression that the format specifier 'f' was necessary for the print function, but the double quotes are for the string printed to the user, as a prompt!The Pycharm IDE is showing that it expects a single

Re: Windows installer from python source code without access to source code

2023-04-07 Thread Mark Bourne
s! Ignore the admin address and password boxes, just fill in your email address in the box below those and click "Unsubscribe or edit options". -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

[Python-announce] Shed Skin 0.9.7 - native Windows support!

2023-04-01 Thread Mark Dufour
-python-to-c.html Project homepage: http://github.com/shedskin/shedskin Cheers, Mark. ___ Python-announce-list mailing list -- python-announce-list@python.org To unsubscribe send an email to python-announce-list-le...@python.org https://mail.python.org

[Python-announce] ANN: pvlib-0.9.5 released

2023-03-20 Thread Dr. Mark Alexander Mikofski PhD
mp; contribute:* * https://github.com/pvlib/pvlib-python *Community discussion & support:* * https://groups.google.com/g/pvlib-python * https://github.com/pvlib/pvlib-python/discussions *Thank you for using pvlib python!* -- Mark Mikofski, Ph

Re: Line continuation and comments

2023-02-24 Thread Mark Bourne
y. You could almost think of "\ (newline)" in a multiline string as being like an escape sequence meaning "don't actually put a newline character in the string here", in a similar way to "\n" meaning "put a newline character here" and "\t" meaning &

Re: Add angle brackets for required args in argparse

2023-02-20 Thread Mark Bourne
e `HelpFormatter` class, so might not work across all Python versions if the name or signature of that method changes (even if it does work with all current versions, it might break in future). -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: ChatGPT Generated news poster code

2023-02-13 Thread Mark Bourne
n, because the block size was reported differently.) -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: A Function's name during its definition

2023-02-07 Thread Mark Bourne
Stefan Ram wrote: Mark Bourne writes: In the second case, eval() only gets the globals and immediate locals, Yes, I think you are right. Curiously, the following program would mislead one to thing that eval /does/ see the intermediate names: main.py def f(): x = 22 def g

Re: A Function's name during its definition

2023-02-07 Thread Mark Bourne
rk: def g(): def f(): print(eval('g')) f() g() ...because in this case "g" is defined in the global scope, so the code in the eval call can see it. The following also works: def g(): def f(): pass print(eval('f')) g() ...because in this case, eval() is ca

[Python-announce] ANN: pvlib-0.9.4 released

2023-02-05 Thread Dr. Mark Alexander Mikofski PhD
ls.astm_e1036> for extracting the basic characteristics of an I-V curve. * There were several new contributors. *Thank you for using pvlib python!* -- Mark Mikofski, PhD (2005) *Fiat Lux* ___ Python-announce-list mailing list -- python-announce-list@

Re: evaluation question

2023-02-02 Thread Mark Bourne
. That's about an 11 year transition period, which is hardly sudden! Python 3 *was* the point at which the features deprecated in Python 2 were removed. The problem is, a lot seemed to ignore Python 3 for the first 12 years and then suddenly panic because Python 2 support had ended. -- Mark

Re: evaluation question

2023-01-31 Thread Mark Bourne
fect just return None. -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Mark Bourne
he same shell, so it seems *more* in scope for your application to document than using quotes around spaces. -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-29 Thread Mark Bourne
application, and other shells might behave differently. You probably don't want to go down the line of trying to document this kind of thing in your applications usage information, because it won't work like that for someone using e.g. the bash shell (which can be run on Windows). -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: evaluation question

2023-01-28 Thread Mark Bourne
123)"), which prints 123 and returns None. The P step doesn't print anything if the result is None. You'd still see that output if this was in a script. Using eval in those examples is pretty pointless, since: >>> 1+1 >>> print(123) would produce the same results - but of

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-28 Thread Mark Bourne
enclose that in 'single quotes' (can't even use "double quotes" for that one). You can't really expect to document all that sort of thing, because it depends on which shell the user happens to run your application from - you just have to trust the user to know or learn how to use their shell. -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: bool and int

2023-01-27 Thread Mark Bourne
to be made to deal with insane situations where False is 2! -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to make argparse accept "-4^2+5.3*abs(-2-1)/2" string argument?

2023-01-22 Thread Mark Bourne
inux shell / etc.): > ./convert_infix.py -- '-4^2+5.3*abs(-2-1)/2' (it's probably a good idea to quote the expression, in case it includes any characters which would be interpreted specially by the shell - e.g. "*" without quotes usually expands to all matching files in the current directory) -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: To clarify how Python handles two equal objects

2023-01-15 Thread Mark Bourne
ule me. I haven't done much with C extensions, but I don't think you'd need to do anything with "x" in that case. If something else is assigned to "y", "x" would still be a reference to the original object - why would it need to be "restored" to anything? Unless I've misunderstood what's going on here... -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

[Python-announce] ANN: Shed Skin 0.9.6 - adds Python 3 support!

2022-12-30 Thread Mark Dufour
://github.com/shedskin/shedskin Cheers, Mark. ___ Python-announce-list mailing list -- python-announce-list@python.org To unsubscribe send an email to python-announce-list-le...@python.org https://mail.python.org/mailman3/lists/python-announce

Re: How make your module substitute a python stdlib module.

2022-12-27 Thread Mark Bourne
e)s` in the log format string would use those attributes, without needing a custom formatter. That would allow both thread IDs to be logged, in case a mix of standard threads and your threads is used. -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to enter escape character in a positional string argument from the command line?

2022-12-19 Thread Mark Bourne
ollar sign before a single-quoted string which contains escape sequences) -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

[Python-announce] ANN: pvlib-0.9.3 released

2022-10-13 Thread Dr. Mark Alexander Mikofski PhD
hosted by AWS. * There were four new first time contributors! Thank you! * There was a training using JupyterHub at PVPMC 2022 <https://pvsc-python-tutorials.github.io/PVPMC_2022>. Check it out! *Thank you for using pvlib python!* -- Mark Mikofski, PhD (2005) *Fiat Lux* __

[Python-announce] ANN: pvlib-0.9.2 released

2022-09-01 Thread Dr. Mark Alexander Mikofski PhD
5.0 * A new build system that conforms to PEP 517 & PEP518 * There were several new contributors. *Thank you for using pvlib python!* -- Mark Mikofski, PhD (2005) *Fiat Lux* ___ Python-announce-list mailing list -- python-announce-list@python.org

Re: How to make a variable's late binding crosses the module boundary?

2022-08-31 Thread Mark Bourne
Jach Feng wrote: Mark Bourne 在 2022年8月29日 星期一下午6:40:59 [UTC+8] 的信中寫道: Jach Feng wrote: Chris Angelico 在 2022年8月29日 星期一下午1:58:58 [UTC+8] 的信中寫道: On Mon, 29 Aug 2022 at 15:54, Jach Feng wrote: Richard Damon 在 2022年8月29日 星期一上午10:47:08 [UTC+8] 的信中寫道: On 8/27/22 7:42 AM, Mark Bourne wrote

Re: What can I do about this?

2022-08-29 Thread Mark Bourne
gene heskett wrote: On 8/29/22 12:50, Mark Bourne wrote: Roel Schroeven wrote: Op 29/08/2022 om 2:55 schreef gene heskett: On 8/28/22 19:39, Peter J. Holzer wrote: On 2022-08-28 18:40:17 -0400, gene heskett wrote: Persuant to my claim the py3.10 is busted, here is a sample. This is me

Re: What can I do about this?

2022-08-29 Thread Mark Bourne
Roel Schroeven wrote: Op 29/08/2022 om 2:55 schreef gene heskett: On 8/28/22 19:39, Peter J. Holzer wrote: On 2022-08-28 18:40:17 -0400, gene heskett wrote: Persuant to my claim the py3.10 is busted, here is a sample. This is me, trying to make pronterface, inside a venv: When the package

Re: How to make a variable's late binding crosses the module boundary?

2022-08-29 Thread Mark Bourne
Jach Feng wrote: Chris Angelico 在 2022年8月29日 星期一下午1:58:58 [UTC+8] 的信中寫道: On Mon, 29 Aug 2022 at 15:54, Jach Feng wrote: Richard Damon 在 2022年8月29日 星期一上午10:47:08 [UTC+8] 的信中寫道: On 8/27/22 7:42 AM, Mark Bourne wrote: Jach Feng wrote: I have two files: test.py and test2.py --test.py-- x = 2

Re: How to make a variable's late binding crosses the module boundary?

2022-08-28 Thread Mark Bourne
test.x`, for example: import test test.x = 4 test.foo() -- Mark. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python installation

2022-07-04 Thread Mark Pawelek
I also have a windows installation issue on Windows 10: ISSUE: I cannot select a folder to install Python in. I want to put it under Program Files. The 'installer' only wants to put it in C:\users\Lenovo\AppData\local\Programs\Python\Python310 What do I do to alter the path to something like:

[issue47046] Add `f_state` attribute to FrameObjects.

2022-04-08 Thread Mark Shannon
Mark Shannon added the comment: Don't you need to know if a "call" event is a call or the resumption of a generator? -- ___ Python tracker <https://bugs.python.o

[issue40421] [C API] Add public getter functions for the internal PyFrameObject structure

2022-04-08 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +30439 pull_request: https://github.com/python/cpython/pull/32413 ___ Python tracker <https://bugs.python.org/issue40

[issue47257] add methods to get first and last elements of a range

2022-04-08 Thread Mark Dickinson
Mark Dickinson added the comment: > but it's messy and potentially tricky to get the actual first and last values > of the range Doesn't simple indexing already provide what you need here? >>> range(1, 5, 2)[0] # first element of range 1 >>> range(1, 5, 2)[-1] #

[issue47248] Possible slowdown of regex searching in 3.11

2022-04-07 Thread Mark Shannon
New submission from Mark Shannon : The 3 regular expression benchmarks in the pyperformance suite, regex_v8, regex_effbot and regex_dna show slowdowns between 3% and 10%. Looking at the stats, nothing seems wrong with specialization or the memory optimizations. Which strongly suggests

[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2022-04-05 Thread Mark Dickinson
Mark Dickinson added the comment: FWIW, I do consider this a bug, albeit a minor one. I may find time to fix it at some point (but it's fine to leave it closed until that time comes). -- ___ Python tracker <https://bugs.python.org/issue28

[issue47009] Streamline list.append for the common case

2022-04-05 Thread Mark Shannon
Mark Shannon added the comment: New changeset 6c6e0408a663c1f53dad403f54a18d444da39cb7 by Dennis Sweeney in branch 'main': bpo-47009: Let PRECALL_NO_KW_LIST_APPEND do its own POP_TOP (GH-32239) https://github.com/python/cpython/commit/6c6e0408a663c1f53dad403f54a18d444da39cb7

[issue45317] Document the removal the usage of the C stack in Python to Python calls

2022-04-04 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +30367 stage: -> patch review pull_request: https://github.com/python/cpython/pull/32304 ___ Python tracker <https://bugs.python.org/issu

[issue44800] Code readability: rename InterpreterFrame to `_Py_framedata`

2022-04-04 Thread Mark Shannon
Mark Shannon added the comment: New changeset 8a349eb30b54bab9a7146fc10e3379c3cacaa19e by Mark Shannon in branch 'main': Revert "bpo-44800: Document internal frame naming conventions (GH-32281)" (#32301) https://github.com/python/cpython/commit/8a349eb30b54bab9a7146fc10e3379

[issue47215] Add "unstable" frame stack api

2022-04-04 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +30366 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/32303 ___ Python tracker <https://bugs.python.org/issu

[issue47215] Add "unstable" frame stack api

2022-04-04 Thread Mark Shannon
New submission from Mark Shannon : We need to provide an API to create, swap and free frame stacks for greenlets. Since this is primarily for greenlets (and any other stackful coroutines libraries that want to use it) it will be "unstable". In this case, by "unstable&quo

[issue44800] Code readability: rename InterpreterFrame to `_Py_framedata`

2022-04-04 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +30363 pull_request: https://github.com/python/cpython/pull/32301 ___ Python tracker <https://bugs.python.org/issue44

[Python-announce] ANN: pvlib-0.9.1 released

2022-04-02 Thread Dr. Mark Alexander Mikofski PhD
nce/generated/pvlib.bifacial.infinite_sheds.get_irradiance.html#pvlib.bifacial.infinite_sheds.get_irradiance> to calculate the plane of array irradiance, all its components on both front and back sides, and the total from both sides. *The maintainers thank you for using pvlib python!* -- Mark Mikofski, PhD

[issue47172] Make virtual opcodes in the compiler negative and is_jump() identify only proper jumps

2022-04-01 Thread Mark Shannon
Mark Shannon added the comment: New changeset 997ba5d126f5040d5b7536f73bc89049e9f9421d by Irit Katriel in branch 'main': bpo-47172: Compiler enhancements (GH-32200) https://github.com/python/cpython/commit/997ba5d126f5040d5b7536f73bc89049e9f9421d -- nosy: +Mark.Shannon

[issue47186] split JUMP_IF_NOT_EXC/EG_MATCH into CHECK_EXC/EG_MATCH + jump

2022-04-01 Thread Mark Shannon
Mark Shannon added the comment: New changeset 04e07c258f4f2ac85e25355242a113f98a706f04 by Irit Katriel in branch 'main': bpo-47186: Replace JUMP_IF_NOT_EXC_MATCH by CHECK_EXC_MATCH + jump (GH-32231) https://github.com/python/cpython/commit/04e07c258f4f2ac85e25355242a113f98a706f04

[issue46841] Inline bytecode caches

2022-04-01 Thread Mark Shannon
Mark Shannon added the comment: New changeset ae9de82e321581e1906c6ef2a7ad83ab30ae3325 by Brandt Bucher in branch 'main': bpo-46841: Use a `bytes` object for `_co_code_adaptive` (GH-32205) https://github.com/python/cpython/commit/ae9de82e321581e1906c6ef2a7ad83ab30ae3325

[issue46841] Inline bytecode caches

2022-04-01 Thread Mark Shannon
Mark Shannon added the comment: New changeset bd2e47c8830d1b2869f2b4345945a5e0c3b4e3fb by Brandt Bucher in branch 'main': bpo-46841: Avoid unnecessary allocations in code object comparisons (GH-3) https://github.com/python/cpython/commit/bd2e47c8830d1b2869f2b4345945a5e0c3b4e3fb

[issue47009] Streamline list.append for the common case

2022-04-01 Thread Mark Shannon
Mark Shannon added the comment: New changeset a0ea7a116ce52a178c02d42b684089758bd7f355 by Dennis Sweeney in branch 'main': bpo-47009: Streamline list.append for the common case (GH-31864) https://github.com/python/cpython/commit/a0ea7a116ce52a178c02d42b684089758bd7f355 -- nosy

[issue44159] mimetypes - "strict" on Windows

2022-03-31 Thread Mark Dong
Mark Dong added the comment: Hi, I want to follow up on this: On Linux (Ubuntu 20.04.4 LTS), the module also loads everything it finds in the registries (a.k.a, entries in the "knownfiles" variable) in "strict" mode, even though some of them aren't registered in

[issue40421] [C API] Add public getter functions for the internal PyFrameObject structure

2022-03-31 Thread Mark Shannon
Mark Shannon added the comment: New changeset 74b95d86e0f14603f878c4df3133bc8a93f8f80a by Mark Shannon in branch 'main': bpo-40421: Add missing getters for frame object attributes to C-API. (GH-32114) https://github.com/python/cpython/commit/74b95d86e0f14603f878c4df3133bc8a93f8f80a

[issue47120] Make all jump opcodes relative

2022-03-31 Thread Mark Shannon
Mark Shannon added the comment: New changeset a00518d9ad9a8f408a9699191019d75dd8406c32 by Irit Katriel in branch 'main': bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD (GH-32115) https://github.com/python/cpython/commit/a00518d9ad9a8f408a9699191019d75dd8406c32

[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread Mark Shannon
Mark Shannon added the comment: The problem in the example you give is the need for the cast in the first place. If `func` were a `PyCFunctionObject *` instead of a `PyObject *`, then there would be no cast. Making the casts explicit serves as a reminder that a type check is needed

[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread Mark Shannon
Mark Shannon added the comment: I think that adding macros makes readability worse. The macro is only more readable if you already know what it does. If you don't, then you need to look up the macro, and understand the cast in the macro (which is harder than understanding the original cast

[issue47053] Reduce de-optimization in BINARY_OP_INPLACE_ADD_UNICODE

2022-03-25 Thread Mark Shannon
Mark Shannon added the comment: New changeset cca43b7d64f47ea921d0f7a347ae1a839c5463c3 by Dennis Sweeney in branch 'main': bpo-47053: Reduce deoptimization in BINARY_OP_INPLACE_ADD_UNICODE (GH-31318) https://github.com/python/cpython/commit/cca43b7d64f47ea921d0f7a347ae1a839c5463c3

[issue40421] [C API] Add public getter functions for the internal PyFrameObject structure

2022-03-25 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +30190 pull_request: https://github.com/python/cpython/pull/32114 ___ Python tracker <https://bugs.python.org/issue40

[issue42197] Disable automatic update of frame locals during tracing

2022-03-25 Thread Mark Shannon
Mark Shannon added the comment: New changeset d7163bb35d1ed46bde9affcd4eb267dfd0b703dd by Mark Shannon in branch 'main': bpo-42197: Don't create `f_locals` dictionary unless we actually need it. (GH-32055) https://github.com/python/cpython/commit/d7163bb35d1ed46bde9affcd4eb267dfd0b703dd

[issue42917] Block stack size for frame objects should be dynamically sizable

2022-03-25 Thread Mark Shannon
Mark Shannon added the comment: With the introduction of zero cost exceptions, there is no block stack. -- resolution: -> out of date stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue47114] random.choice and random.choices have different distributions

2022-03-24 Thread Mark Bell
Mark Bell added the comment: To give two more consequences of `random.choices` using floating point arithmetic: 1) When doing `random.choices([A, B, C], weights=[2**55, 1, 1])` the cumulative weight to bisect for is selected using `floor(random() * (2**55 + 1 + 1 + 0.0))`. Since

[issue47114] random.choice and random.choices have different distributions

2022-03-24 Thread Mark Bell
New submission from Mark Bell : The docstring for `random.choices` indicates that ``` import random random.choices(population, k=1) ``` should produce a list containing one item, where each item of `population` has equal likelihood of being selected. However `random.choices` draws elements

[issue42197] Disable automatic update of frame locals during tracing

2022-03-22 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +30147 pull_request: https://github.com/python/cpython/pull/32055 ___ Python tracker <https://bugs.python.org/issue42

[issue42917] Block stack size for frame objects should be dynamically sizable

2022-03-22 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +30145 pull_request: https://github.com/python/cpython/pull/32055 ___ Python tracker <https://bugs.python.org/issue42

[issue47092] [C API] Add PyFrame_GetVar(frame, name) function

2022-03-22 Thread Mark Shannon
Mark Shannon added the comment: I'm looking into adding two new APIs. One to round out the getters for FrameObject and one to introspect the internal frame stack. It would probably make more sense to add this capability to the frame stack API, as it would avoid creating the frame object

[issue46724] Odd Bytecode Generation in 3.10

2022-03-22 Thread Mark Shannon
Mark Shannon added the comment: I think this is fixed (for 3.11 at least) by https://github.com/python/cpython/pull/31888 -- ___ Python tracker <https://bugs.python.org/issue46

[issue47045] Remove the RESUME instruction

2022-03-22 Thread Mark Shannon
Mark Shannon added the comment: New changeset 49daf6dba8178c5ae5d4d65408b20566d39c36a8 by Mark Shannon in branch 'main': bpo-47045: Remove `f_state` field (GH-31963) https://github.com/python/cpython/commit/49daf6dba8178c5ae5d4d65408b20566d39c36a8

[issue47085] missing frame.f_lineno on JUMP_ABSOLUTE

2022-03-22 Thread Mark Shannon
Mark Shannon added the comment: The `JUMP_ABSOLUTE` doesn't have a line number, as it doesn't correspond to any source. The jump back to the top could follow either the `if i >= 0:` or the `pass`, so cannot have a line number. Don't expect every bytecode to map directly back to the sou

[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2022-03-22 Thread Mark Shannon
Mark Shannon added the comment: You are on own if you create code objects by calling `types.CodeType`. The docs could be a lot clearer about that, though. -- ___ Python tracker <https://bugs.python.org/issue45

[issue46841] Inline bytecode caches

2022-03-21 Thread Mark Shannon
Mark Shannon added the comment: New changeset 2bde6827ea4f136297b2d882480b981ff26262b6 by Brandt Bucher in branch 'main': bpo-46841: Quicken code in-place (GH-31888) https://github.com/python/cpython/commit/2bde6827ea4f136297b2d882480b981ff26262b6

[issue47045] Remove the RESUME instruction

2022-03-17 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +30052 stage: -> patch review pull_request: https://github.com/python/cpython/pull/31963 ___ Python tracker <https://bugs.python.org/issu

[issue47046] Add `f_state` attribute to FrameObjects.

2022-03-17 Thread Mark Shannon
New submission from Mark Shannon : When tracing, the event supplied is insufficient to determine what is actually happening. E.g. A "call" event could be a call to a function or resuming a generator or coroutine. Adding a state field to the FrameObject would allow t

[issue47045] Remove the RESUME instruction

2022-03-17 Thread Mark Shannon
New submission from Mark Shannon : The RESUME instruction was added to make resumption points explicit in the bytecode. This makes it easier to implement tracing, quickening, and interrupt checks as there is an explicit place to perform these checks. Unfortunately, it also has considerable

[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-03-17 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue38435] Start the deprecation cycle for subprocess preexec_fn

2022-03-16 Thread Mark Mentovai
Mark Mentovai added the comment: Another use case for preexec_fn: establishing a new controlling terminal, typically in conjunction with start_new_session=True. A preexec_fn may do something like os.close(os.open(os.ttyname(sys.stdin.fileno(), os.O_RDWR))) with discussion at https

[issue46329] Split up the CALL_NO_KW and CALL_KW instructions.

2022-03-16 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +30025 pull_request: https://github.com/python/cpython/pull/31933 ___ Python tracker <https://bugs.python.org/issue46

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

2022-03-15 Thread Mark Shannon
Mark Shannon added the comment: New changeset 099f75614100e88ed90b68d20a51a8d9c22f81a7 by Mark Shannon in branch 'main': bpo-45923: Decouple suspension of tracing from tracing flag. (GH-31908) https://github.com/python/cpython/commit/099f75614100e88ed90b68d20a51a8d9c22f81a7

[issue46817] Add a line-start table to the code object.

2022-03-15 Thread Mark Shannon
Mark Shannon added the comment: sys.settrace line events cannot use the co_lines table. They need additional state, as we don't want to trace the same line twice (unless there is a backwards jump). Using the start of a entry in `co_lines` doesn't work when some entries have no line number

[issue46896] add support for watching writes to selected dictionaries

2022-03-15 Thread Mark Shannon
Mark Shannon added the comment: Let me give you an example. #module eggs eggs_var = 0 # a variable, maybe a counter or similar EGGS_CONST # a constant #module spam import eggs spam_var # Another variable def foo(): use(eggs.EGGS_CONST) - We will want to treat

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

2022-03-15 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +30001 pull_request: https://github.com/python/cpython/pull/31908 ___ Python tracker <https://bugs.python.org/issue45

[issue46841] Inline bytecode caches

2022-03-15 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +29996 pull_request: https://github.com/python/cpython/pull/31901 ___ Python tracker <https://bugs.python.org/issue46

[issue45995] string formatting: normalize negative zero

2022-03-13 Thread Mark Dickinson
Mark Dickinson added the comment: I forgot to update here: > PEP at https://github.com/python/peps/pull/2295 For the record, PEP 682 has been accepted. -- ___ Python tracker <https://bugs.python.org/issu

[issue42560] Improve Tkinter Documentation

2022-03-11 Thread Mark Roseman
Mark Roseman added the comment: Just a note, that an (updated) version of the auto-generated API reference has been "officially" added to TkDocs ... see https://tkdocs.com/pyref/ Few more things I'd like to do with it in the short term, but it's a decent starting point. Let me k

[issue46971] python takes long time when return big data

2022-03-11 Thread Mark Dickinson
Mark Dickinson added the comment: > why it costs lots of time when del a large array? That's probably a question for the NumPy folks, or possibly for Stack Overflow or some other question-and-answer resource. It'll depend on how NumPy arrays are de-allocated. > Is there any way to p

[issue46944] Use FASTCALL calling convention in generator.throw

2022-03-11 Thread Mark Shannon
Mark Shannon added the comment: New changeset 304197b3820309e3ed695ff3e6a71461881a1728 by Kumar Aditya in branch 'main': bpo-46944: use FASTCALL calling convention in generator.throw (GH-31723) https://github.com/python/cpython/commit/304197b3820309e3ed695ff3e6a71461881a1728

[issue46896] add support for watching writes to selected dictionaries

2022-03-11 Thread Mark Shannon
Mark Shannon added the comment: Another use of this is to add watch points in debuggers. To that end, it would better if the callback were a Python object. The overhead is relatively small if using the vectorcall protocol. If the call overhead matters that much, there is something wrong

[issue46896] add support for watching writes to selected dictionaries

2022-03-11 Thread Mark Shannon
Mark Shannon added the comment: You might not like global variables, they may not show up much in benchmarks, but people do use them. I suspect a lot of jupyter notebooks have quite a few global variables. There should not be much of a slowdown for this code when watching `CONST`: CONST

[issue46841] Inline bytecode caches

2022-03-11 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +29915 pull_request: https://github.com/python/cpython/pull/31817 ___ Python tracker <https://bugs.python.org/issue46

[issue46971] python takes long time when return big data

2022-03-10 Thread Mark Dickinson
Mark Dickinson added the comment: This is expected. Your timing measures the time for garbage collection of the large arrays in addition to the time for the result to be returned. In the line `result = myfunc()`, the name `result` gets rebound to the value of `myfunc()`. That means

[issue46896] add support for watching writes to selected dictionaries

2022-03-10 Thread Mark Shannon
Mark Shannon added the comment: There are three kinds of changes that we might want to watch (that I can think of right now): 1. Any change. Rather coarse and potentially expensive. Used by Cinder. 2. A new key being added (or a change to the keys version as a proxy). Useful for detect

[issue46841] Inline bytecode caches

2022-03-08 Thread Mark Shannon
Mark Shannon added the comment: New changeset 5498a61c7c25db6f9e76032aa9c5153d79e09889 by Brandt Bucher in branch 'main': bpo-46841: Don't use an oparg counter for `STORE_SUBSCR` (GH-31742) https://github.com/python/cpython/commit/5498a61c7c25db6f9e76032aa9c5153d79e09889

[issue46953] use FASTCALL for __import__ builtin

2022-03-08 Thread Mark Shannon
Mark Shannon added the comment: Serhiy, what is the advantage of __import__ being slower? Not counting the argument clinic generated code, the PR doesn't add any code and improves the docstring. -- ___ Python tracker <https://bugs.python.

[issue45317] Document the removal the usage of the C stack in Python to Python calls

2022-03-07 Thread Mark Shannon
Mark Shannon added the comment: I don't think this needs to block the alpha release -- priority: release blocker -> deferred blocker ___ Python tracker <https://bugs.python.org/issu

[issue46903] Crash when setting attribute with string subclass as the name (--with-pydebug)

2022-03-06 Thread Mark Shannon
Mark Shannon added the comment: Ronald, does PR 31658 fix your issue? -- stage: patch review -> ___ Python tracker <https://bugs.python.org/issue46903> ___ _

  1   2   3   4   5   6   7   8   9   10   >