[Python-ideas] Re: Add _KB, _MB, _GB to numeric literals

2020-10-14 Thread Ma Lin
Thanks for your replies, your objections are convincing. ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archive

[Python-ideas] Re: Add _KB, _MB, _GB to numeric literals

2020-10-14 Thread Ma Lin
> Second, why use bytes units? Not every integer value measures the amount of > memory. If you multiply 2 bytes by 3 bytes, do you get 6 square bytes? If a code executes m_bytes * n_bytes, it's probably a logic error. If all values have a unit in a programming language, it might help us to check

[Python-ideas] Re: Add _KB, _MB, _GB to numeric literals

2020-10-14 Thread Chris Angelico
On Wed, Oct 14, 2020 at 6:56 PM Ma Lin wrote: > > > Second, why use bytes units? Not every integer value measures the amount of > > memory. If you multiply 2 bytes by 3 bytes, do you get 6 square bytes? > > If a code executes m_bytes * n_bytes, it's probably a logic error. > > If all values have

[Python-ideas] Re: New feature

2020-10-14 Thread M.-A. Lemburg
On 14.10.2020 00:35, Guido van Rossum wrote: > Can one of the educators on the list explain why this is such a commonly > required feature? I literally never feel the need to clear my screen -- but > I've > seen this requested quite a few times in various forms, often as a bug report > "IDLE does

[Python-ideas] Re: New feature

2020-10-14 Thread ankith abhayan
The 2nd one. Regards On Wed, 14 Oct 2020, 5:47 am Steven D'Aprano, wrote: > Hello Ankith, > > > On Tue, Oct 13, 2020 at 11:37:25AM +0530, ankith abhayan wrote: > > Hi, > > I would like to request a new feature that allows you to clear the > console > > screen. > > Like in c++, the CLS function >

[Python-ideas] Re: Add the brotli & zstandard compression algorithms as modules

2020-10-14 Thread Ma Lin
> but Python isn't trying to have the "optimal cutting-edge" thing in its > standard library. More like "the well-established, widely-used" thing. I also agree with this. At present, I have confidence in zstd. There seems to be a trend that some programmer users are switching to zstd. Don't k

[Python-ideas] Re: Add _KB, _MB, _GB to numeric literals

2020-10-14 Thread Ma Lin
I can't remember unit systems for Python, do you mean third party module? ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org

[Python-ideas] Re: Add the brotli & zstandard compression algorithms as modules

2020-10-14 Thread Antoine Pitrou
On Tue, 13 Oct 2020 05:58:45 - "Ma Lin" wrote: > > I heard in data science domain, the data is often huge, such as hundreds of > GB or more. If people can make full use of multi-core CPU to compress, the > experience will be much better than zlib. This is true, but in data science it is ex

[Python-ideas] Re: Add _KB, _MB, _GB to numeric literals

2020-10-14 Thread python
Sorry for the late response on this. I tried to respond earlier but was stymied by issues with the mailing list server. The last time this was discussed I was the one to raise the suggestion. You can find the start of the thread: 25 Aug 2016: SI scale factors in Python https://mail.pyth

[Python-ideas] Re: Exact decimal multiplication and division operations

2020-10-14 Thread Random832
On Fri, Oct 9, 2020, at 17:38, Tim Peters wrote: > [Random832 ] > > My suggestion was for a way to make it so that if an exact result is > > exactly representable at any precision you get that result, with > > rounding only applied for results that cannot be represented exactly > > regardless of pr

[Python-ideas] Re: Exceptions as function calls to kill boilerplate

2020-10-14 Thread Random832
On Mon, Oct 12, 2020, at 17:16, jmwar...@gmail.com wrote: > Instead of needing a whole new class definition, wouldn't it be nice to > just have something like: > > > #notice there isn't a boilerplate custom class created! > try: > if some_test_that_fails(variables): > #I still have a b

[Python-ideas] Re: Exact decimal multiplication and division operations

2020-10-14 Thread Tim Peters
[Random832 ] [various bits of pushback, which all basically boil down to this one:} > ... > That is nonsense. "exactly representable" is a plain english phrase and > has a clear meaning that only involves the actual data format, not the > context. The `decimal` module implements a very exacting s

[Python-ideas] Re: Exact decimal multiplication and division operations

2020-10-14 Thread Steven D'Aprano
On Wed, Oct 14, 2020 at 03:33:22PM -0400, Random832 wrote: > That is nonsense. "exactly representable" is a plain english phrase > and has a clear meaning that only involves the actual data format, not > the context. Perhaps your understanding of plain English is radically different from mine,

[Python-ideas] Re: Exact decimal multiplication and division operations

2020-10-14 Thread Chris Angelico
On Thu, Oct 15, 2020 at 11:18 AM Steven D'Aprano wrote: > > On Wed, Oct 14, 2020 at 03:33:22PM -0400, Random832 wrote: > > > That is nonsense. "exactly representable" is a plain english phrase > > and has a clear meaning that only involves the actual data format, not > > the context. > > Perhaps y

[Python-ideas] Re: Exact decimal multiplication and division operations

2020-10-14 Thread Tim Peters
[Steven D'Aprano ] > ... > (To be honest, I was surprised to learn that the context precision is > ignored when creating a Decimal from a string. I still find it a bit odd > that if I set the precision to 3, I can still create a Decimal with > twelve digits.) You're not alone ;-) In the original

[Python-ideas] Re: Exact decimal multiplication and division operations

2020-10-14 Thread Steven D'Aprano
On Thu, Oct 15, 2020 at 11:28:36AM +1100, Chris Angelico wrote: > Neither 1/3 nor sqrt(2) can be *exactly represented* as a decimal > fraction. Indeed, I am very aware of that, and in fact they were precisely the examples I gave to question Random's assertion that inexact rounding is something

[Python-ideas] Re: Exact decimal multiplication and division operations

2020-10-14 Thread Guido van Rossum
This all seems a pretty artificial argument. In plain English, "1/3" is not exactly representable in decimal form, but something like 0. * 0.22 *is* (assuming the inputs are what they appear). Since the spec clearly means to say "exactly represe

[Python-ideas] Re: Exact decimal multiplication and division operations

2020-10-14 Thread Greg Ewing
On 15/10/20 1:59 pm, Tim Peters wrote: I suggested following the standards' rules (the constructor works the same way as everything else - it rounds) for Python's module too, but Mike Cowlishaw (the decimal spec's primary driver) overruled me on that. Did he offer a rationale for that? -- Greg