[Python-ideas] Re: Support infinite temporal types

2020-06-16 Thread Serhiy Storchaka
16.06.20 13:54, Alexander Hill пише: I’d like to propose support for infinite dates, datetimes and timedeltas. They're very useful when you need to model ranges with one or both ends unbounded (e.g. “forever starting from June 15th 2020”). Without first-class infinite values, you can use None,

[Python-ideas] Re: json library: non-standards-compliant by default, and what to do about it.

2020-06-16 Thread Serhiy Storchaka
17.06.20 08:42, David Mertz пише: I think the argument 'allow_nan' is poorly spelled. Spelling it 'strict' would have been much better. Maybe 'conformant'. I'm not sure I hate the spelling enough to propose a change with depreciation period, but I certainly wouldn't oppose that. It is not onl

[Python-ideas] Re: json library: non-standards-compliant by default, and what to do about it.

2020-06-16 Thread Serhiy Storchaka
17.06.20 08:29, Steven D'Aprano пише: What exactly is getting in the way here? Standards do change. One standard (JSON) is not capable of representing all values from another standard (IEEE-754). Removing NANs and INFs would break floating point software everywhere, and a lot of hardware too. Add

[Python-ideas] Re: json library: non-standards-compliant by default, and what to do about it.

2020-06-16 Thread Steven D'Aprano
On Wed, Jun 17, 2020 at 10:58:38AM +1000, Chris Angelico wrote: > On Wed, Jun 17, 2020 at 10:43 AM Steven D'Aprano wrote: > > > > Please forgive the stupid question, but given that the JSON standard is > > so obviously broken (being unable to serialise valid values from a > > supported type, what

[Python-ideas] Re: json library: non-standards-compliant by default, and what to do about it.

2020-06-16 Thread David Mertz
On Wed, Jun 17, 2020, 1:30 AM Steven D'Aprano wrote: > What exactly is getting in the way here? Standards do change. One standard > (JSON) is not capable of representing all values from another standard > (IEEE-754). Removing NANs and INFs would break floating point software > everywhere, and a l

[Python-ideas] Re: json library: non-standards-compliant by default, and what to do about it.

2020-06-16 Thread Steven D'Aprano
On Tue, Jun 16, 2020 at 07:11:57PM -0700, Guido van Rossum wrote: > On Tue, Jun 16, 2020 at 5:45 PM Steven D'Aprano wrote: > > > Please forgive the stupid question, but given that the JSON standard is > > so obviously broken (being unable to serialise valid values from a > > supported type, what

[Python-ideas] Re: Support infinite temporal types

2020-06-16 Thread Steven D'Aprano
On Tue, Jun 16, 2020 at 06:54:49PM +0800, Alexander Hill wrote: > Hi all, > > I’d like to propose support for infinite dates, datetimes and timedeltas. Some languages (R comes to mind, if I recall correctly) also support a "Not A Date" special value. Boost includes a not-a-date-time value: http

[Python-ideas] Re: json library: non-standards-compliant by default, and what to do about it.

2020-06-16 Thread David Mertz
On Tue, Jun 16, 2020 at 11:55 PM Christopher Barker wrote: > Well, maybe not "Decimal", but it IS, in fact decimal -- i.e. base 10 -- > it can only exactly represent values that can be exactly represented in > base 10. > Which is why, performance aside, it would be better if a JSON number > mapp

[Python-ideas] Re: json library: non-standards-compliant by default, and what to do about it.

2020-06-16 Thread Christopher Barker
no, the json encoder shouldn't change. But a clear warning in the docs is a fine idea. On Tue, Jun 16, 2020 at 7:21 PM David Mertz wrote: > > However, I do want to note that JSON is not "broken." The data that gets > represented in JSON may have the type "Number" (RFC 7159). That is, there > is

[Python-ideas] Re: Support infinite temporal types

2020-06-16 Thread Christopher Barker
I think I recall that discussion -- but don't recall how it ended. Did it just peter out? Anyway, +1 form me -- I've actually got my own implementation as well. So it certainly has a use case, and it's really better to have one version in the stdlib. I haven't had a chance to review your implemen

[Python-ideas] Re: json library: non-standards-compliant by default, and what to do about it.

2020-06-16 Thread David Mertz
On Tue, Jun 16, 2020, 8:42 PM Steven D'Aprano wrote: > Please forgive the stupid question, but given that the JSON standard is so > obviously broken (being unable to serialise valid values from a supported > type, what on earth were they thinking???), wouldn't all this time and > energy be better

[Python-ideas] Re: Doc preview in Github PR

2020-06-16 Thread Inada Naoki
It was suspended because of limitation of netlify. For now, you can download zipped HTML files from Github Action. For example, visit this page and click "Artifacts" in the right side. https://github.com/python/cpython/pull/20879/checks?check_run_id=771369070 Regards, On Wed, Jun 17, 2020 at 8:1

[Python-ideas] Re: json library: non-standards-compliant by default, and what to do about it.

2020-06-16 Thread Guido van Rossum
On Tue, Jun 16, 2020 at 5:45 PM Steven D'Aprano wrote: > Please forgive the stupid question, but given that the JSON standard is > so obviously broken (being unable to serialise valid values from a > supported type, what on earth were they thinking???), wouldn't all this > time and energy be bett

[Python-ideas] Re: approximate equality operator ("PEP 485 follow-up")

2020-06-16 Thread Steven D'Aprano
On Tue, Jun 16, 2020 at 11:14:24AM +0300, Paul Sokolovsky wrote: > There's a reason why even projects otherwise largely written in Python, > use a different language (like JavaScript) when they need > easy-for-users scripting capabilities. A random example is > https://github.com/frida/frida . Tha

[Python-ideas] Re: json library: non-standards-compliant by default, and what to do about it.

2020-06-16 Thread Chris Angelico
On Wed, Jun 17, 2020 at 10:43 AM Steven D'Aprano wrote: > > Please forgive the stupid question, but given that the JSON standard is > so obviously broken (being unable to serialise valid values from a > supported type, what on earth were they thinking???), wouldn't all this > time and energy be be

[Python-ideas] Re: json library: non-standards-compliant by default, and what to do about it.

2020-06-16 Thread Steven D'Aprano
Please forgive the stupid question, but given that the JSON standard is so obviously broken (being unable to serialise valid values from a supported type, what on earth were they thinking???), wouldn't all this time and energy be better aimed at fixing the standard rather than making Python's J

[Python-ideas] Re: EVENTFD(2) support

2020-06-16 Thread Kyle Stanley
> Instead of trying to fix the PyPi version, I can write a proof of concept of what I described above? That would definitely be useful, and would help us get a more solid idea of what exactly is being proposed. I also agree that a potential version contained in the select module should be as simpl

[Python-ideas] Re: Modularize Python library

2020-06-16 Thread Chris Angelico
On Wed, Jun 17, 2020 at 10:07 AM Steven D'Aprano wrote: > Some of the Linux distros already split the stdlib into pieces. This is > a real pain, especially for beginners. The process changes from: > > $ dnf install python3 > # or apt-get or whatever package manager you use > > and everythi

[Python-ideas] Re: Modularize Python library

2020-06-16 Thread Steven D'Aprano
On Tue, Jun 16, 2020 at 12:41:58PM -, redrad...@gmail.com wrote: > As long as I cannot update version of standard library package > separately from CPython version - No, they are not separate creatures > ;) Why would you want to? That just sounds like adding extra complexity and pain for

[Python-ideas] Doc preview in Github PR

2020-06-16 Thread remi . lapeyre
I think the possibility to have publish a preview when a PR changes the documentation was considered at one time but I can't find anything about this now. Has this been scraped? ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe sen

[Python-ideas] Re: EVENTFD(2) support

2020-06-16 Thread doodspav
I've looked over the PyPi version of `eventfd`, and I feel that it is trying to be more than just a thin wrapper. The attempt to make it cross platform has given it more fields than it requires, as has the attempt to wrap it as a semaphore, and with that comes added complexity. The `eventfd` th

[Python-ideas] Re: String module name

2020-06-16 Thread Brett Cannon
You can do this via a function call; it does not require syntax support. And Deno has specific needs as they also need to fetch type information, so being able to parse out the URLs systematically has special meaning to deno. On Tue, Jun 16, 2020 at 2:06 AM wrote: > Yeah, but it still desire to

[Python-ideas] json library: non-standards-compliant by default, and what to do about it.

2020-06-16 Thread Serge Bazanski
Hi list, as you might be aware, the json library is non standards-compliant [1] by default: when fed {NaN, Inf, -Inf} floating point values in the serialization input, it will output {Nan, Inf, -Inf} literals in serialized form, unless the keyward argument allow_nan is explicitly set to False - an

[Python-ideas] Re: For quicker execution, don't refcount objects that can't be deleted

2020-06-16 Thread Jonathan Fine
Guido wrote: > Did Larry Hastings ever publish his experience with separating the > refcount for his Gilectomy project? I believe he told us at a sprint or > language summit that he had this working, with much effort, but hadn't > managed to make it faster than the existing refcounting implementat

[Python-ideas] Re: For quicker execution, don't refcount objects that can't be deleted

2020-06-16 Thread Guido van Rossum
Did Larry Hastings ever publish his experience with separating the refcount for his Gilectomy project? I believe he told us at a sprint or language summit that he had this working, with much effort, but hadn't managed to make it faster than the existing refcounting implementation yet. On Tue, Jun

[Python-ideas] Re: EVENTFD(2) support

2020-06-16 Thread Jonathan Fine
Hi As said earlier, it's on PyPi: https://pypi.org/project/eventfd/ However, it's only at version 0.2 and hasn't been changed since 2016. Digging a bit deeper, there's an unresolved issue that suggests more work is required. Issue: Race condition in "set" can lead to a bad state https://github.c

[Python-ideas] Re: EVENTFD(2) support

2020-06-16 Thread Kyle Stanley
> It would only be available on the Linux platform, and one of the benefits would be the ability to create synchronisation primitives on said platform that can block on normal threads, and be awaited on in coroutines (without busy looping inside said coroutine). +1. Although it already exists as a

[Python-ideas] Re: the 'z' string escape

2020-06-16 Thread Soni L.
On 2020-06-16 2:37 a.m., Stephen J. Turnbull wrote: Soni L. writes: > so I propose a \z string escape which lets me write the above as shown > below: > >     """switches to toml config format. the old 'repos' \z >     table is preserved as 'repos_old'""" We

[Python-ideas] Re: EVENTFD(2) support

2020-06-16 Thread Rhodri James
On 16/06/2020 06:56, doods...@gmail.com wrote: Can we implement eventfd(2) as documented here ? EventFD is available on PyPI: https://pypi.org/project/eventfd/ -- Rhodri James *-* Kynesim Ltd ___

[Python-ideas] Re: Modularize Python library

2020-06-16 Thread redradist
Rhodri James wrote: > On 16/06/2020 10:23, redrad...@gmail.com wrote: > > I think it would be desired to modularize Python > > library and then to > > provide part of standard library through PyPi It will add possibility > > to evolve separately run-time and standard library > > Uh, aren't the runt

[Python-ideas] Re: Modularize Python library

2020-06-16 Thread redradist
Rhodri James wrote: > On 16/06/2020 10:23, redrad...@gmail.com wrote: > > I think it would be desired to modularize Python > > library and then to > > provide part of standard library through PyPi It will add possibility > > to evolve separately run-time and standard library > > Uh, aren't the runt

[Python-ideas] Support infinite temporal types

2020-06-16 Thread Alexander Hill
Hi all, I’d like to propose support for infinite dates, datetimes and timedeltas. They're very useful when you need to model ranges with one or both ends unbounded (e.g. “forever starting from June 15th 2020”). Without first-class infinite values, you can use None, or you can use the `min` and `m

[Python-ideas] EVENTFD(2) support

2020-06-16 Thread doodspav
Can we implement eventfd(2) as documented here ? It would only be available on the Linux platform, and one of the benefits would be the ability to create synchronisation primitives on said platform that can block on normal threads, and be aw

[Python-ideas] Re: Modularize Python library

2020-06-16 Thread redradist
I like what they `Pycopy` maintainers did !! I allow to evolve separately runt-time and standard library ;) Library maintainer could provide fixes to library faster than waiting one year release cycle of CPython ___ Python-ideas mailing list -- python-

[Python-ideas] Re: Modularize Python library

2020-06-16 Thread Paul Moore
On Tue, 16 Jun 2020 at 11:53, Stéfane Fermigier wrote: > the "batteries included" argument was a huge selling points years ago (when > Aaron Watters wrote "Internet Programming With Python", for instance) but I > think the situation has changed quite a bit since then. For some people/situations

[Python-ideas] Re: Modularize Python library

2020-06-16 Thread Paul Sokolovsky
Hello, On Tue, 16 Jun 2020 09:23:23 - redrad...@gmail.com wrote: > Hi all, me again ... ) > > I think it would be desired to modularize Python library and then to > provide part of standard library through PyPi It will add possibility > to evolve separately run-time and standard library Thi

[Python-ideas] Re: Modularize Python library

2020-06-16 Thread Edwin Zimmerman
This is still true.  There are some of us that will scream very very loud if the std lib disappears from Python installers.  However, I think there could easily be a way to satisfy both parties here.  How difficult would it be to release both full and minimal installers for every release?  That

[Python-ideas] Re: Modularize Python library

2020-06-16 Thread Stéfane Fermigier
Hi, the "batteries included" argument was a huge selling points years ago (when Aaron Watters wrote "Internet Programming With Python", for instance) but I think the situation has changed quite a bit since then. My own experience is that for most of the packages in the standard library, there exi

[Python-ideas] Re: Modularize Python library

2020-06-16 Thread Rhodri James
On 16/06/2020 10:23, redrad...@gmail.com wrote: I think it would be desired to modularize Python library and then to provide part of standard library through PyPi It will add possibility to evolve separately run-time and standard library Uh, aren't the runtime and standard library already separ

[Python-ideas] Re: For quicker execution, don't refcount objects that can't be deleted

2020-06-16 Thread Antoine Pitrou
On Tue, 16 Jun 2020 09:34:59 +0100 Jonathan Fine wrote: > > I've changed my opinion. I doubt that there's an easy win here. But I > suspect that there is a win that is worth having. I'll now go away and > think about things for a while. This is a good idea. An even better idea, for people who t

[Python-ideas] Modularize Python library

2020-06-16 Thread redradist
Hi all, me again ... ) I think it would be desired to modularize Python library and then to provide part of standard library through PyPi It will add possibility to evolve separately run-time and standard library I think standard library should be as small as needed and all other functionality

[Python-ideas] Re: approximate equality operator ("PEP 485 follow-up")

2020-06-16 Thread Chris Angelico
On Tue, Jun 16, 2020 at 6:16 PM Paul Sokolovsky wrote: > There's a reason why even projects otherwise largely written in Python, > use a different language (like JavaScript) when they need > easy-for-users scripting capabilities. A random example is > https://github.com/frida/frida . That's becaus

[Python-ideas] Re: String module name

2020-06-16 Thread redradist
Yeah, but it still desire to be solved ... One of the use-cases is if I want to use `Brython`, it will be usable to load the module or entire package from the internet and then to use it in my application ... Issue with the right to access some resources could be solve with flags as `Deno` did

[Python-ideas] Re: String module name

2020-06-16 Thread Dominik Vilsmeier
On 16.06.20 10:00, redrad...@gmail.com wrote: You cannot trust PyPi either ... I think user should decide if it allows code from arbitrary URL to access filesystem, network or anything else as `wasmtime` and `deno` did If you want to do this, you can still download the code and use `importli

[Python-ideas] Re: approximate equality operator ("PEP 485 follow-up")

2020-06-16 Thread Dominik Vilsmeier
On 14.06.20 17:52, David Mertz wrote: On Sun, Jun 14, 2020, 10:22 AM Greg Ewing mailto:greg.ew...@canterbury.ac.nz>> wrote: On 15/06/20 12:39 am, Sebastian M. Ernst wrote: > It's such a common problem when dealing with floating point numbers Is it really? I've done quite a lot of w

[Python-ideas] Re: For quicker execution, don't refcount objects that can't be deleted

2020-06-16 Thread Jonathan Fine
Many thanks to all for your useful and interesting contributions. They've helped me, and given me a lot to think about. It's clear that there are several related or overlapping issues. Here are some comments. 1. A major problem is to speed-up A, without slowing B. In other words, how to avoid ref

[Python-ideas] Re: approximate equality operator ("PEP 485 follow-up")

2020-06-16 Thread Paul Sokolovsky
Hello, On Tue, 16 Jun 2020 14:21:55 +0900 "Stephen J. Turnbull" wrote: > Paul Sokolovsky writes: > > > I'd encourage everyone who thinks "I need a very special operator > > just for me", > > I don't think anybody who posts here thinks that, though. Sure, everyone thinks that they invented

[Python-ideas] Re: Python WebAssembly Support

2020-06-16 Thread Kyle Stanley
> But my question is why not to apply all this patches to `CPython` to be able to compile `CPython` on the Web ? > Patches to CPython seems pretty straightforward ... In order for an existing project to even be considered as a patch for CPython as an addition to the standard library, it typically

[Python-ideas] Re: String module name

2020-06-16 Thread redradist
You cannot trust PyPi either ... I think user should decide if it allows code from arbitrary URL to access filesystem, network or anything else as `wasmtime` and `deno` did ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an

[Python-ideas] Re: the 'z' string escape

2020-06-16 Thread Dominik Vilsmeier
On 16.06.20 08:40, Paul Sokolovsky wrote: Hello, On Tue, 16 Jun 2020 14:37:39 +0900 "Stephen J. Turnbull" wrote: Soni L. writes: > so I propose a \z string escape which lets me write the above as > shown below: > >     """switches to toml config format. the old > 'rep