[Python-ideas] Re: dunder methods for encoding & prettiness aware formal & informal representations

2020-03-21 Thread Andrew Barnert via Python-ideas
On Mar 20, 2020, at 19:32, Christopher Barker wrote: > > It’s a bit ironic: if you have a nifty idea for Python, you are often told to > try it out on your own. And if you expect it to maybe make its way into > Python, you’d want to use a dunder... > > But then, dunders are reserved for the st

[Python-ideas] Re: Add the imath module

2020-03-21 Thread Steven D'Aprano
On Sat, Mar 21, 2020 at 04:18:32PM +, Jonathan Fine wrote: > Hi > > In https://bugs.python.org/issue40028 , > Ross Rhodes suggested adding to the standard library a function that finds > the prime factors of a non-negative integer. So far as I know, any gen

[Python-ideas] Re: Add the imath module

2020-03-21 Thread Jonathan Fine
Hi In https://bugs.python.org/issue40028 , Ross Rhodes suggested adding to the standard library a function that finds the prime factors of a non-negative integer. So far as I know, any general algorithm for doing this requires a list of prime numbers. To this

[Python-ideas] Re: dunder methods for encoding & prettiness aware formal & informal representations

2020-03-21 Thread Stephen J. Turnbull
Samuel Colvin writes: > > I'd be interested to see the "display utility" point of view expanded. > > For me there are two use cases: These both seem to be what I would consider "debugging" use cases, ie, displaying whole objects to users who have some understanding of the internals. My under

[Python-ideas] Re: Add the imath module

2020-03-21 Thread Ross
Hello Serhiy, I support this proposal, thanks for sharing this thread in my enhancement proposal (issue #40028). I would be more than happy to help you where time permits in implementing this module if approval is granted. Ross ___ Python-ideas mailin

[Python-ideas] Re: dunder methods for encoding & prettiness aware formal & informal representations

2020-03-21 Thread Samuel Colvin
> I'd be interested to see the "display utility" point of view expanded. For me there are two use cases: I use devtool's debug() command instead of print() ALL THE TIME when debugging, so does the rest of my office and others who I've demonstrated its merits to. I use this sitecustomize trick

[Python-ideas] Re: Add the imath module

2020-03-21 Thread Ross
I support this proposal. This would fit nicely with my recent enhancement proposal raised to introduce a method for finding prime factors of non-negative integer n. ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to

[Python-ideas] Re: dunder methods for encoding & prettiness aware formal & informal representations

2020-03-21 Thread Stephen J. Turnbull
Steven D'Aprano writes: > Oh, that's interesting. I mostly think of pretty-printing as a display > utility aimed at end users. Well, I'm mostly the only end-user of my code, so there's definitely a bias here. I'd be interested to see the "display utility" point of view expanded. Steve __

[Python-ideas] Re: dunder methods for encoding & prettiness aware formal & informal representations

2020-03-21 Thread Paul Moore
On Sat, 21 Mar 2020 at 06:42, Steven D'Aprano wrote: > > On Sat, Mar 21, 2020 at 12:16:29PM +0900, Stephen J. Turnbull wrote: > > > The way I think of pprint (FWIW, YMMV) is as a debug utility. > > Oh, that's interesting. I mostly think of pretty-printing as a display > utility aimed at end users.

[Python-ideas] Re: New explicit methods to trim strings

2020-03-21 Thread Rob Cliffe via Python-ideas
Well, str.replace has a count parameter.  Presumably people use it (even if by accidentally discovering that without it, it replaces all occurrences when they only wanted one replaced). On 18/03/2020 18:44, Alex Hall wrote: Just the first occurrence. The vast majority of the time, that's what