Re: [Python-ideas] Heap data type, the revival

2016-10-16 Thread Devin Jeanpierre
> As I said, it has been discussed and the consensus so far was: "not > everything needs to be a class if it does not provide substantial benefit" + > "functions are more flexible" + "if it's slower that the original it won't > happen". (These) functions are less flexible here. heapq forbids

Re: [Python-ideas] pdb to support running modules

2018-01-04 Thread Devin Jeanpierre
On Thu, Jan 4, 2018 at 1:56 PM, Mario Corchero wrote: > Since PEP 338 we can run python modules as a script via `python -m > module_name` but there is no way to run pdb on those (AFAIK). > > The proposal is to add a new argument "-m" to the pdb module to allow users > to run

Re: [Python-ideas] Add the imath module

2018-07-12 Thread Devin Jeanpierre
On Thu, Jul 12, 2018 at 5:20 AM Daniel Moisset wrote: > (I don't have a good name): something telling that an integer can be > represented exactly as a float One might also ask that question of e.g. decimal.Decimal, fractions.Fraction, so maybe it's better as a method or somewhere else. (Is

Re: [Python-ideas] Using sha512 instead of md5 on python.org/downloads

2018-12-07 Thread Devin Jeanpierre
On Fri, Dec 7, 2018 at 1:40 AM Antoine Pitrou wrote: > md5 is only used for a quick integrity check here (think of it as a > sophisticated checksum). For security you need to verify the > corresponding GPG signature. > More to the point: you're getting the hash from the same place as the

Re: [Python-ideas] Using sha512 instead of md5 on python.org/downloads

2018-12-07 Thread Devin Jeanpierre
On Fri, Dec 7, 2018 at 10:48 AM Antoine Pitrou wrote: > If the site is vulnerable to modifications, then TLS doesn't help. > Again: you must verify the GPG signatures (since they are produced by > the release manager's private key, which is *not* stored on the > python.org Web site). > This is

[Python-ideas] Re: Add Subscriptable ABC

2019-09-27 Thread Devin Jeanpierre
On Fri, Sep 27, 2019 at 9:14 AM Steven D'Aprano wrote: > But doing it correctly is too painful: > > if any(getattr(T, '__getitem__', None) is not None for T in > type(obj).mro()) > For what it's worth, walking the MRO isn't necessary, and the None trick is only necessary if you want to

[Python-ideas] Re: Make list.reverse() more flexible

2021-03-07 Thread Devin Jeanpierre
On Fri, Mar 5, 2021 at 3:23 PM Steven D'Aprano wrote: > On Fri, Mar 05, 2021 at 04:27:27PM -, Vincent Cheong wrote: > > > Currently, list.reverse() only works for an entire list. If one wants > > to reverse a section of it 'in-place', one needs to slicing which > > makes the space complexity

[Python-ideas] Re: Auto assignment of attributes

2022-05-01 Thread Devin Jeanpierre
On Sun, May 1, 2022 at 9:35 AM Ethan Furman wrote: > My own thoughts about the proposal: It seems interesting, and assigning > as-is arguments is a chore -- but I'm not sure > using up a token to help only one method per class is a good trade. > Is it unreasonable to instead suggest