Re: Usenet vs. Mailing-list

2023-01-29 Thread Ben Bacarisse
Igor Berger writes: > On Saturday, January 28, 2023 at 10:02:57 PM UTC-5, Ben Bacarisse wrote: >> Jon Ribbens writes: >> >> > On 2023-01-29, Ben Bacarisse wrote: >> >> "Peter J. Holzer" writes: >> >> >> >

Re: Usenet vs. Mailing-list

2023-01-28 Thread Ben Bacarisse
Jon Ribbens writes: > On 2023-01-29, Ben Bacarisse wrote: >> "Peter J. Holzer" writes: >> >>> On 2023-01-27 21:04:58 +, Ben Bacarisse wrote: >>>> mutt...@dastardlyhq.com writes: >>>> >>>> > Hi >&g

Re: Usenet vs. Mailing-list

2023-01-28 Thread Ben Bacarisse
"Peter J. Holzer" writes: > On 2023-01-27 21:04:58 +, Ben Bacarisse wrote: >> mutt...@dastardlyhq.com writes: >> >> > Hi >> >> It looks like you posted this question via Usenet. comp.lang.python is >> essentially dead as a Usenet group

Re: evaluation question

2023-01-27 Thread Ben Bacarisse
sions? It handles only expressions, and "for i in range(1,10): i" is not an expression. You can use >>> exec("for i in range(1,10): i") or, to confirm that something is happening: >>> exec("for i in range(1,10): print(i)") 1 2 3 4 5 6 7 8 9 See: https://docs.python.org/3/library/functions.html?highlight=eval#eval and the immediately following entry. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: bool and int

2023-01-26 Thread Ben Bacarisse
x == 0. Of course these are not random choices, but it shows that Python's design is very far from universal. But then this is not a numbers game, anyway. A programmer need only to have used one or two languages that are rather more strict about types to find such a thing unsurprising in future. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Local variable definition in Python list comprehension

2022-09-01 Thread Ben Bacarisse
thwhile to add a new feature like this in Python? If so, how > can I propose this to PEP? To make any sort of case you'd need to give an example that does not have a clearer way to write it already. Your working version is, to me, clearer that the ones you want to be able to write. -- Ben.

Fwd: timedelta object recursion bug

2022-07-28 Thread Ben Hirsig
Hi, I noticed this when using the requests library in the response.elapsed object (type timedelta). Tested using the standard datetime library alone with the example displayed on https://docs.python.org/3/library/datetime.html#examples-of-usage-timedelta It appears as though the timedelta

[issue28584] ICC compiler check is too permissive

2022-03-22 Thread Ben Boeckel
Change by Ben Boeckel : -- nosy: +mathstuf ___ Python tracker <https://bugs.python.org/issue28584> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46824] use AI_NUMERICHOST | AI_NUMERICSERV to skip getaddrinfo thread in asyncio

2022-03-18 Thread Ben Darnell
Ben Darnell added the comment: On MacOS in 2015, getaddrinfo was found to be much slower than inet_pton. Unless that's changed, this patch would be a performance regression on that platform. Data and benchmark script in https://groups.google.com/g/python-tulip/c/-SFI8kkQEj4/m/m1-oCMSABgAJ

[issue46824] use AI_NUMERICHOST | AI_NUMERICSERV to skip getaddrinfo thread in asyncio

2022-03-18 Thread Ben Darnell
Ben Darnell added the comment: To summarize the justification, this patch does two things: it moves an optimization from create_connection to getaddrinfo, which makes it apply to more callers (including Tornado), and it makes the code simpler and less redundant (net reduction of 47 non-test

[issue46726] Thread spuriously marked dead after interrupting a join call

2022-02-11 Thread Ben
Change by Ben : -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue46726> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue46726] Thread spuriously marked dead after interrupting a join call

2022-02-11 Thread Ben
Ben added the comment: You are right, What one really needs here is a way to know *who* owns the lock, but threading.Lock does not provide that. The race on := is much smaller than the original race and I suspect in practice will be very hard to hit. As the original bpo notes, it may

[issue46726] Thread spuriously marked dead after interrupting a join call

2022-02-11 Thread Ben
Change by Ben : -- nosy: +vstinner ___ Python tracker <https://bugs.python.org/issue46726> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue46726] Thread spuriously marked dead after interrupting a join call

2022-02-11 Thread Ben
Ben added the comment: This is a duplicate of https://bugs.python.org/issue45274 but the patch there did not fix it I've just added a PR there (or should it go here?) that (i think) fixes this. The issue is that the lock.locked() call just checks that *someone* has the lock

[issue45274] Race condition in Thread._wait_for_tstate_lock()

2022-02-11 Thread Ben
Change by Ben : -- nosy: +bjs nosy_count: 6.0 -> 7.0 pull_requests: +29450 pull_request: https://github.com/python/cpython/pull/31290 ___ Python tracker <https://bugs.python.org/issu

[issue39860] configparser - no support for cascading defaults (as defined by MySQL)

2022-02-09 Thread Ben Griffin
Ben Griffin added the comment: This is still being ignored. It's a bug, because it prevents the ini file from being used by other clients. -- versions: +Python 3.10, Python 3.11, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.

[issue41962] Make threading._register_atexit public?

2022-02-04 Thread Ben Darnell
Ben Darnell added the comment: > To be clear, by "cancel" you are not talking about Future.cancel(). Rather, > your handler causes all running tasks to finish (by sending a special message > on the socket corresponding to each running task). Is that right? Correct. My t

[issue46376] PyMapping_Check returns 1 for list

2022-01-25 Thread Ben Avrahami
Ben Avrahami added the comment: IMHO, I don't think any alternative to aviramha's solution addresses the issue, And I don't think the need is niche enough to be ignored. PyType_HasFeature excludes strings, bytes, and other esoteric types. PyMapping_Check includes mappings like dict

[issue46473] importlib.metadata does not honor .egg-link files

2022-01-23 Thread Ben
Ben added the comment: https://github.com/python/importlib_metadata/issues/364 -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue46473] importlib.metadata does not honor .egg-link files

2022-01-22 Thread Ben
Ben added the comment: yes, the latest version of pip creates an .egg-info metadata dir at the level of the package src dir and .egg-link and easy-install.pth stubs in the site-packages dir (the contents of which are paths to the package src dir). The intent is that these links would

[issue46473] importlib.metadata does not honor .egg-link files

2022-01-22 Thread Ben
Ben added the comment: I should also add that the easy-install.pth file, which similarly contains a link to the source dir containing the .egg-info metadata, is also not processed to locate the necessary metadata. -- ___ Python tracker <ht

[issue46473] importlib.metadata does not honor .egg-link files

2022-01-22 Thread Ben
New submission from Ben : When installing a package using --editable, pip creates a .egg-link file in your site-packages dir that points to the .egg-info metadata that by default exists along side the source that it was installed from. This worked just fine with the older pkg_resources

[issue46307] string.Template should allow inspection of identifiers

2022-01-09 Thread Ben Kehoe
Ben Kehoe added the comment: That doesn’t really seem like a Pythonic way of extracting that information? Nor does it seem like it would be an obvious trick for the average developer to come up with. A method that provides the information directly seems useful

[issue46307] string.Template should allow inspection of identifiers

2022-01-09 Thread Ben Kehoe
Ben Kehoe added the comment: The point is to be able to programmatically determine what is needed for a successful substitute() call. A basic use case for this is better error messages; calling substitute() with an incomplete mapping will tell you only the first missing identifier it encounters

[issue46307] string.Template should allow inspection of identifiers

2022-01-09 Thread Ben Kehoe
Ben Kehoe added the comment: Having slept on it, I realized that if I was presenting interactive prompts for a template, I would expect the prompts to be in order that the identifiers appear in the template. Accordingly, I've updated the PR to maintain ordering

[issue46307] string.Template should allow inspection of identifiers

2022-01-08 Thread Ben Kehoe
Ben Kehoe added the comment: I opened a PR. By default, it raises an exception if there's an invalid identifier; there's a keyword argument raise_on_invalid to control that. The implementation I have adds them to a set first, which means the order is not guaranteed. I'm of two minds about

[issue46307] string.Template should allow inspection of identifiers

2022-01-08 Thread Ben Kehoe
Change by Ben Kehoe : -- keywords: +patch pull_requests: +28698 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30493 ___ Python tracker <https://bugs.python.org/issu

[issue46307] string.Template should allow inspection of identifiers

2022-01-08 Thread Ben Kehoe
Ben Kehoe added the comment: Happy to make a PR! In my mind I had been thinking it would be the get_identifiers() method with the implementation above, returning a list. As for __iter__, I'm less clear on what that would look like: t = string.Template(...) for identifier in t: # what

[issue46307] string.Template should allow inspection of identifiers

2022-01-08 Thread Ben Kehoe
New submission from Ben Kehoe : Currently, the only thing that can be done with a string.Template instance and a mapping is either attempt to substitute with substitute() and catch a KeyError if some identifier has not been provided in the mapping, or substitute with safe_substitute

[issue46070] broken subinterpreters

2021-12-15 Thread Ben Steffensmeier
Ben Steffensmeier added the comment: We have been seeing intermittent crashes on jep that we tracked down to the same change (d0d29655ff). I have created a sample program using _testcapi that crashes about 50% of the time when run on Windows with Python 3.9.9. We have not been able

[issue46017] Tutorial incorrectly refers to skits rather than sketches.

2021-12-08 Thread Ben Ricketts
New submission from Ben Ricketts : https://docs.python.org/3/tutorial/appetite.html 4th paragraph from bottom refers to "skits" where as Monty Python in fact perform sketch comedy.It is a minor but important differentiation. -- assignee: docs@python components: Documentatio

[issue39529] Deprecate get_event_loop()

2021-12-03 Thread Ben Darnell
Ben Darnell added the comment: > In IPython, I think you could use new_event_loop() for getting a new loop > instance. > Then, save the loop reference somewhere as a direct attribute, > threading.local or ContextVar. > Calling loop.run_until_complete() looks pretty normal in

[issue45951] Debugger cannot be resolved

2021-12-01 Thread Ben
Change by Ben : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue45951> ___ ___ P

[issue45951] Debugger cannot be resolved

2021-12-01 Thread Ben
New submission from Ben : First, I am not a programmer by any stretch of the imagination, and I am just trying to get this error solved. I attempted to highlight and comment out a section of code, maybe 20 lines, and the program froze, greyed out, and gave me a spinning wheel mouse. I

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-20 Thread Ben Bacarisse
Grant Edwards writes: > On 2021-11-20, Ben Bacarisse wrote: > >> You seem to be agreeing with me. It's the floating point part that is >> the issue, not the base itself. > > No, it's the base. Floating point can't represent 3/10 _because_ it's > base 2 floating point

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-20 Thread Ben Bacarisse
Chris Angelico writes: > On Sat, Nov 20, 2021 at 3:41 PM Ben Bacarisse wrote: >> >> Chris Angelico writes: >> >> > On Sat, Nov 20, 2021 at 12:43 PM Ben Bacarisse >> > wrote: >> >> >> >> Chris Angelico writes: >> >

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-19 Thread Ben Bacarisse
Chris Angelico writes: > On Sat, Nov 20, 2021 at 12:43 PM Ben Bacarisse wrote: >> >> Chris Angelico writes: >> >> > On Sat, Nov 20, 2021 at 9:07 AM Ben Bacarisse wrote: >> >> >> >> Chris Angelico writes: >> >> >> >&g

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-19 Thread Ben Bacarisse
Chris Angelico writes: > On Sat, Nov 20, 2021 at 9:07 AM Ben Bacarisse wrote: >> >> Chris Angelico writes: >> >> > On Sat, Nov 20, 2021 at 5:08 AM ast wrote: >> >> >> >>> 0.3 + 0.3 + 0.3 == 0.9 >> >> False >> > >

Re: Unexpected behaviour of math.floor, round and int functions (rounding)

2021-11-19 Thread Ben Bacarisse
ome with a warning that 0.3 can not be represented exactly as a floating point value. To avoid the warning, the programmer would write ~0.3 meaning, exactly, the binary (or whatever the base really is) floating point number closest to 0.3. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

[issue45435] delete misleading faq entry about atomic operations

2021-10-12 Thread Ben
Ben added the comment: The problem with the FAQs is that it's over-simplifying things to the point where it can sometimes mislead. Notably, it says the GIL protects these operations; but as Antoine points out, many operations on datatypes drop back into Python (including potential decrefs

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-06 Thread Ben
Ben added the comment: This seems to be present in both the Python implementation as well as the accelerated C _asyncio module. It looks like that when a Task awaits a cancelled future, the task itself is cancelled but the cancellation message is not propagated to the task. https

[issue45278] RuntimeError on race on weakset concurrent iteration

2021-09-24 Thread Ben
New submission from Ben : This is a very subtle race WeakSet uses _weakrefset.py's _IterationGuard structure to protect against the case where the elements the WeakSet refers to get cleaned up while a thread is iterating over the WeakSet. It defers the actual removal of any elements which

[issue45239] email.utils.parsedate_tz raises UnboundLocalError if time has more than 2 dots in it

2021-09-18 Thread Ben Hoyt
Change by Ben Hoyt : -- keywords: +patch pull_requests: +26853 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28452 ___ Python tracker <https://bugs.python.org/issu

[issue45239] email.utils.parsedate_tz raises UnboundLocalError if time has more than 2 dots in it

2021-09-18 Thread Ben Hoyt
Ben Hoyt added the comment: For reference, here's a repro case: $ python3.10 -c 'import email.utils; \ email.utils.parsedate_tz("Wed, 3 Apr 2002 12.34.56.78+0800")' Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.10/emai

[issue45239] email.utils.parsedate_tz raises UnboundLocalError if time has more than 2 dots in it

2021-09-18 Thread Ben Hoyt
New submission from Ben Hoyt : In going through some standard library code, I found that the email.utils.parsedate_tz() function (https://docs.python.org/3/library/email.utils.html#email.utils.parsedate_tz) has a bug if the time value is in dotted format and has more than 2 dots

[issue44962] asyncio.create_task weakrefset race condition

2021-08-20 Thread Ben
Ben added the comment: I can reproduce on 3.9.6 A little digging and it seems asyncio imports Task from _asyncio and _asyncio's implementation (in asynciomodule.c) of Task has an __init__ which adds the task to the `all_tasks` weakref.WeakSet which appears to be implemented in Python (in Lib

[issue44832] Compiler detection is not strict enough

2021-08-04 Thread Ben Boeckel
New submission from Ben Boeckel : Generally, the `configure.ac` script tries to detect compilers based on the path to the compiler. This is mostly fine, but trips up when using `mpicc` as the compiler. Even if the underlying compiler is `gcc`, this gets detected as `icc` in various

[issue44695] asdict use deep copy to dataclass instances

2021-07-21 Thread Ben Avrahami
Change by Ben Avrahami : -- nosy: +avrahami.ben ___ Python tracker <https://bugs.python.org/issue44695> ___ ___ Python-bugs-list mailing list Unsubscribe:

Re: Help with gaussian filter from scipy

2021-07-07 Thread Ben Bacarisse
Arak Rachael writes: > On Wednesday, 7 July 2021 at 12:47:40 UTC+2, Arak Rachael wrote: >> On Wednesday, 7 July 2021 at 12:41:44 UTC+2, Ben Bacarisse wrote: >> > Arak Rachael writes: >> > >> > > this time I am stuck on gaussian_filter scipy returns none

Re: Help with gaussian filter from scipy

2021-07-07 Thread Ben Bacarisse
ink to the code itself so people can look at it without having to load up a project. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

[issue39529] Deprecate get_event_loop()

2021-05-29 Thread Ben Darnell
Ben Darnell added the comment: > The maintenance burden of the introduced deprecation should be pretty low. This is going to cause an unpleasant amount of churn in the Tornado community. It's been idiomatic (going back 12 years now) to do all your setup in synchronous code before start

[issue37373] Configuration of windows event loop for libraries

2021-05-15 Thread Ben Darnell
Ben Darnell added the comment: > It's even slightly easier for tornado, which can reasonably set the > proactor-wrapper policy at IOLoop start time, which means > `asyncio.get_event_loop()` returns a loop with add_reader. But pyzmq doesn't > get invoked until an event loo

[issue32958] socket module calls with long host names can fail with idna codec error

2021-05-09 Thread Ben Darnell
Ben Darnell added the comment: [I'm coming here from https://github.com/tornadoweb/tornado/pull/3010) UnicodeError is a subclass of ValueError, so I don't see what value that change would provide. The thing that's surprising to me is that it's not a `socket.herror` (or `gaierror

[issue40894] asyncio.gather() cancelled() always False

2021-03-20 Thread Ben Buchwald
Ben Buchwald added the comment: Hopefully I'm not too late to comment on this. I also just hit this issue, but I do not agree with the proposed PR. Only modifying _GatheringFuture.cancelled() just fixes one of the side-effects of the problem. The state of the future is still FINISHED

[issue26362] Approved API for creating a temporary file path

2021-03-12 Thread Ben Finney
Ben Finney added the comment: > tempfile.mktemp() still exists and works without raising a deprecation > warning. Of course it's still marked as deprecated in the docs. Right. So, the issue is not resolved: Functionality to create a temporary file path is maintained in the standard l

Re: neonumeric - C++ arbitrary precision arithmetic library

2021-03-06 Thread Ben Bacarisse
tumped others, nothing but what appears to be a false claim about neos can do. If you want this project to be taken seriously, you are going about it the wrong way. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: New Python implementation

2021-02-16 Thread Ben Bacarisse
hink there is anything to see here. If the author had come up with some new ways to tackle any of the problems, he would be telling people about these, not saying "be patient" (and bad-mouthing CPython). -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Mr. Flibble

2021-02-15 Thread Ben Bacarisse
Ethan Furman writes: > On 2/15/21 2:02 PM, Grant Edwards wrote: >> On 2021-02-15, Ben Bacarisse wrote: >> >>> You said you used Usenet (and your reply here was via Usenet). >>> Usenet posts to comp.lang.python don't go to the mailing list (the >>> &

Re: Mr. Flibble

2021-02-15 Thread Ben Bacarisse
used Usenet (and your reply here was via Usenet). Usenet posts to comp.lang.python don't go to the mailing list (the "here" that Ethan is talking about). Mails to the list /are/ sent here, but it's one-way traffic. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

[issue36517] typing.NamedTuple does not support mixins

2021-02-09 Thread Ben Avrahami
Ben Avrahami added the comment: The patch PR blocks out a useful idiom: generic Nametuple >>> class LLNode(NamedTuple, Generic[T]): ... value :T ... next: Optional[LLNode[T]] I put forward that, at the least, NamedTuple should accept do-nothing bases like Generic. --

[issue41962] Make threading._register_atexit public?

2021-01-25 Thread Ben Darnell
Ben Darnell added the comment: I have resolved my issue here by moving from ThreadPoolExecutor to a plain threading.Thread that I manage by hand (https://github.com/tornadoweb/tornado/commit/15832bc423c33c9280564770046dd6918f3a31b4). Therefore I no longer need this for myself and I leave

[issue41962] Make threading._register_atexit public?

2021-01-24 Thread Ben Darnell
Ben Darnell added the comment: > IMO, a better practice would be providing those potentially infinite running > tasks a direct method of escape and invoking it before calling > executor.shutdown(), it would be a more reliable approach. Agreed, but the problem is that I'm in a libr

Re: sqlite3 cannot detect the version of compiled sqlite version at some point in runtime.

2021-01-20 Thread Ben Bacarisse
s issue? thanks. Sorry, no, but I can add a data point. It works for me on my Ubuntu system with these versions: $ python3 Python 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more info

Re: Find word by given characters

2020-11-03 Thread Ben Bacarisse
Python, this is what I'd do on the command line. For example $ grep -P '(?=.*t.*t)(?=.*a)' word-list | wc -l 45677 $ grep 't.*t' word-list | grep a | wc -l 45677 -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

[issue42228] Activate.ps1 clears PYTHONHOME

2020-11-02 Thread Ben Boeckel
Ben Boeckel added the comment: We build our own applications which run Python interpreters internally, so the auto-discovery won't work. It also doesn't seem to work for venvs either since the venv's `python.exe` is under `Scripts` which makes it not able to find things either on its own

[issue42228] Activate.ps1 clears PYTHONHOME

2020-11-01 Thread Ben Boeckel
New submission from Ben Boeckel : On Windows, we are extracting a tarball of a Python installation for CI (to avoid needing to juggle umpteen Python installs on umpteen machines). This requires `PYTHONHOME` to be set to use properly since there is no registry entry for the "install

[issue27495] Pretty printing sorting for set and frozenset instances

2020-10-25 Thread Ben Bonenfant
Change by Ben Bonenfant : -- nosy: +bbonenfant nosy_count: 6.0 -> 7.0 pull_requests: +21894 pull_request: https://github.com/python/cpython/pull/22977 ___ Python tracker <https://bugs.python.org/issu

[issue42088] types.SimpleNamespace.__repr__ documentation inconsistency

2020-10-19 Thread Ben Avrahami
New submission from Ben Avrahami : According to the documentation for types.SimpleNamespace, `repr(SimpleNamespace())` should return `"SimpleNamespace()"`, but in actuality returns `"namespace()"`. This is because SimpleNamespace is an alias for the C implemented type

[issue41962] Make threading._register_atexit public?

2020-10-06 Thread Ben Darnell
New submission from Ben Darnell : I'm dealing with a subtle deadlock involving concurrent.futures.ThreadPoolExecutor, and my solution that worked in Python 3.8 broke with 3.9. I'm running some long-running (possibly infinite) tasks in the thread pool, and I cancel them in an `atexit

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-04 Thread Ben Avrahami
Ben Avrahami added the comment: > Adding a function to recalculate will require everyone to use it I'd argue that this is akin to `functools.update_wrapper`. It too is a function that must be called in virtually every function decorator (the only function decorators that don't/needn't c

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-04 Thread Ben Avrahami
Ben Avrahami added the comment: Implementing this behavior automatically would be more complicated since you would also have to take subclasses into account. Current implementation enforces that the class is unused (as much as can be reasonably done) when its abstraction status is re

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-03 Thread Ben Avrahami
Ben Avrahami added the comment: > Maybe you misunderstand what I tried to say? Possibly, right now, total_ordering avoids overriding any method that is declared, either in the class or its superclasses (except for object), regardless of whether or not it is abstract. For it to be ABC-aw

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-03 Thread Ben Avrahami
Ben Avrahami added the comment: > I would prefer the isinstance(cls, ABCMeta) check to be inside that helper I had a little debate about this in my mind, I'll change it. > it's totally clear to me what @total_ordering should do -- it should define > __le__, __gt__ and __ge__

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-02 Thread Ben Avrahami
Ben Avrahami added the comment: This is a behavior that the PR changes. total_ordering should be able to override/implement abstract methods (in my opinion). If this ends up a strickling point then we can exclude total_ordering from this issue. Regardless, I think that this behavior

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-02 Thread Ben Avrahami
Ben Avrahami added the comment: Good points all, that I will try to address one by one: Firstly, this function is by no means mandatory for "post-creation mixins". Such tools can still be used without calling it (and remain ABC unaware), with absolutely no change in functionali

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-01 Thread Ben Avrahami
Ben Avrahami added the comment: for the functionality to work, `total_ordering` needs to change to also override abstract methods. I believe this is an OK change since total_ordering implicitly dictates that the comparison methods are interchangable. Thus, implementing some comparison

[issue41905] add update_abstractmethods function to update an ABC's abstract methods

2020-10-01 Thread Ben Avrahami
New submission from Ben Avrahami : python-ideas discussion: https://mail.python.org/archives/list/python-id...@python.org/thread/6BNJ3YSEBPHEPGXSAZGBW3TJ64ZGZIHE/ In order to allow "decorator mixins" (most notably dataclass and total_ordering) to implement ABCs, new functionality is

[issue41893] remove() method is not working as expected(Hard to explain)

2020-09-30 Thread Ben
Ben added the comment: See the note in https://docs.python.org/3.7/reference/compound_stmts.html#the-for-statement "There is a subtlety when the sequence is being modified by the loop ..." Since your code is mutating the all_fields list as you iterate it, you get the &

[issue41880] Get Python include directories from sysconfigdata

2020-09-28 Thread Ben Wolsieffer
Change by Ben Wolsieffer : -- keywords: +patch pull_requests: +21469 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22440 ___ Python tracker <https://bugs.python.org/issu

[issue41880] Get Python include directories from sysconfigdata

2020-09-28 Thread Ben Wolsieffer
New submission from Ben Wolsieffer : The distutils.sysconfig.get_python_inc() function finds headers relative to sys.base_prefix or sys.base_exec_prefix. This causes problems when cross-compiling extension modules because Python's headers are not platform independent. Instead

[issue41852] Inconsistent errors for JSON-encoding NaNs with allow_nan=False

2020-09-24 Thread Ben Kurtovic
New submission from Ben Kurtovic : json.dump vs. json.dumps have inconsistent error messages when encoding NaN with allow_nan=False: >>> json.dumps(float('nan'), allow_nan=False) ValueError: Out of range float values are not JSON compliant >>> json.dump(float('nan'), sys

Re: musings on static variables

2020-09-16 Thread Ben Bacarisse
gt; > transcript > > 0 > 1 > 2 def f(i = [0]): i[0] += 1 return i[0] print(f()) print(f()) print(f()) maybe? More than a bit yucky, though. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

[issue39010] ProactorEventLoop raises unhandled ConnectionResetError

2020-09-02 Thread Ben Darnell
Ben Darnell added the comment: I've fixed the test and added some commentary about the different levels of clean shutdown we must do to quiet all the warnings: https://github.com/python/cpython/pull/22066 -- ___ Python tracker <ht

[issue39010] ProactorEventLoop raises unhandled ConnectionResetError

2020-09-02 Thread Ben Darnell
Change by Ben Darnell : -- pull_requests: +21156 pull_request: https://github.com/python/cpython/pull/22066 ___ Python tracker <https://bugs.python.org/issue39

[issue39010] ProactorEventLoop raises unhandled ConnectionResetError

2020-09-01 Thread Ben Darnell
Ben Darnell added the comment: I can confirm that those warnings appear to be coming from the test I added here. I'm not sure how to interpret them, though - what does it mean for the main thread to be dangling? -- ___ Python tracker <ht

[issue41676] asyncio.Event.wait broken link from asyncio.Event

2020-08-31 Thread Ben
Ben added the comment: looking at the source https://raw.githubusercontent.com/python/cpython/3.8/Doc/library/asyncio-sync.rst it says :meth:`wait` just like the surrounding methods and surrounding types, which all work. Maybe :meth:`Event.wait` would fix? But why :meth:`wait` didn't

[issue41676] asyncio.Event.wait broken link from asyncio.Event

2020-08-31 Thread Ben
Change by Ben : -- nosy: +bjs, vstinner ___ Python tracker <https://bugs.python.org/issue41676> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39010] ProactorEventLoop raises unhandled ConnectionResetError

2020-08-30 Thread Ben Darnell
Ben Darnell added the comment: I've posted a pull request with a test and fix: https://github.com/python/cpython/pull/22017. It's a more targeted fix than cmeyer's PR (which I didn't even notice until now due to unfamiliarity with the BPO UI

[issue39010] ProactorEventLoop raises unhandled ConnectionResetError

2020-08-30 Thread Ben Darnell
Change by Ben Darnell : -- pull_requests: +21117 pull_request: https://github.com/python/cpython/pull/22017 ___ Python tracker <https://bugs.python.org/issue39

Re: Didn't understand the output of the following Python 3 code with reduce function?

2020-08-28 Thread Ben Bacarisse
) > > output: 9 Hint: reduce(f, [e1, e2]) is f(e1, e2) reduce(f, [e1, e2, e3]) is f(f(e1, e2), e3) reduce(f, [e1, e2, e3, e4]) is f(f(f(e1, e2), e3), e4) Replace f with a function that adds one to its first argument. Does that help? -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

[issue41423] `multiprocessing.Array` and `multiprocessing.managers.SyncManager.Array` APIs are similar but not the same

2020-07-28 Thread Ben
Change by Ben : -- nosy: +bjs ___ Python tracker <https://bugs.python.org/issue41423> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue39017] Infinite loop in the tarfile module

2020-07-08 Thread Ben Caller
Ben Caller added the comment: A smaller bug: If instead of 0 you use a large number (> 2^63) e.g. 999 you get `OverflowError: Python int too large to convert to C ssize_t` rather than the expected `tarfile.ReadError` regardless of errorle

[issue39017] Infinite loop in the tarfile module

2020-07-08 Thread Ben Caller
Ben Caller added the comment: I've attached a minimal tar file which reproduces this. I think the minimum length is 516 bytes. We need a 512 byte PAX format header block as normal. Then we need a pax header which matches the regex in https://github.com/python/cpython/blob

[issue41212] Emoji Unicode failing in standard release of Python 3.8.3 / tkinter 8.6.8

2020-07-06 Thread Ben Griffin
Ben Griffin added the comment: Wow, well if you are right, then TCL/TK is a showstopper for us, and we will have to consider an alternative to tkinter. Frankly, I am aghast that any active software would be limited to fixed width characters. We moved our languages over to multiwidth (utf-8

[issue41212] Emoji Unicode failing in standard release of Python 3.8.3 / tkinter 8.6.8

2020-07-05 Thread Ben Griffin
Ben Griffin added the comment: Erm, I don’t rightly know how to parse epaine’s comment, as it seems to relate to a version of Unicode from over a decade ago, and a wiki page that was written 12 years ago. IIRC Python 3 was (IMO rightly) developed to default to UTF-8, and according to a much

[issue41212] Emoji Unicode failing in standard release of Python 3.8.3 / tkinter 8.6.8

2020-07-05 Thread Ben Griffin
New submission from Ben Griffin : https://stackoverflow.com/questions/62713741/tkinter-and-32-bit-unicode-duplicating-any-fix Emoji are doubling up when using canvas.create_text() This is reported to work on tcl/tk 8.6.10 but there’s no. Way to upgrade tcl/tk using the standard installs from

[issue40973] platform.platform() in Python 3.8 does not report detailed Linux platform information

2020-06-13 Thread Ben Du
New submission from Ben Du : The function platform.platform() does not report detailed Linux platform information (Ubuntu, Debain, CentOS, etc). This information is reported in Python 3.7 and earlier. -- components: Library (Lib) messages: 371488 nosy: legendu priority: normal

[issue40945] TKinter.Tk.geometry(Tk.winfo_geometry()) should be idempotent

2020-06-12 Thread Ben Li-Sauerwine
Ben Li-Sauerwine added the comment: Thanks for clarifying. Using Tk.geometry() instead of Tk.winfo_geometry() does indeed resolve the issue on Linux. Weird that using Tk.winfo_geometry() is idempotent under Windows, though. -- ___ Python tracker

[issue40945] TKinter.Tk.geometry(Tk.winfo_geometry()) should be idempotent

2020-06-10 Thread Ben Li-Sauerwine
Change by Ben Li-Sauerwine : -- type: -> behavior ___ Python tracker <https://bugs.python.org/issue40945> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue40945] TKinter.Tk.geometry(Tk.winfo_geometry()) should be idempotent

2020-06-10 Thread Ben Li-Sauerwine
New submission from Ben Li-Sauerwine : One would expect that calling TKinter.Tk.geometry(tk.winfo_geometry()) would be idempotent. However, based on the system window frame, it is not and doing so moves the window down the screen. Running the example below reproduces the issue

  1   2   3   4   5   6   7   8   9   10   >