[Python-ideas] Re: Thoughts about Fast Python Engine and Python EveryWhere

2020-07-16 Thread David Mertz
On Thu, Jul 16, 2020, 2:57 PM wrote: > I know, I know that PyPy is fast as V8 but PyPy implement the whole > library inside and it is not easy to embed it somewhere > I have no idea what you mean by that. PyPy doesn't need its standard library to run. Just like in CPython, those are just a

[Python-ideas] Re: Thoughts about Fast Python Engine and Python EveryWhere

2020-07-16 Thread redradist
I know, I know that PyPy is fast as V8 but PyPy implement the whole library inside and it is not easy to embed it somewhere ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org

[Python-ideas] Re: Thoughts about Fast Python Engine and Python EveryWhere

2020-07-16 Thread redradist
My main point is that it would be nice to have just very fast execute engine and all library as integration layer ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org

[Python-ideas] Re: Thoughts about Fast Python Engine and Python EveryWhere

2020-07-16 Thread redradist
CPython is portable but due to integrated standard library (builtin functionality) it is hard to evolve it, for examle to add JIT, anyway it is just my thoughts ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to

[Python-ideas] Re: Allowing -b (BytesWarning) to be activated in other ways

2020-07-16 Thread Christian Heimes
On 16/07/2020 16.38, Shai Berger wrote: > Hi Pythonistas, > > The -b flag, which turns on checks which emit BytesWarnings on > operations mixing bytes and str objects, is very useful. > > However, the only way to set this flag is via the Python invocation. > This limits its usability in contexts

[Python-ideas] Re: Allowing -b (BytesWarning) to be activated in other ways

2020-07-16 Thread Serhiy Storchaka
16.07.20 20:05, Brett Cannon пише: I honestly wouldn't expect that flag to last forever because it exists purely to help with Python 2 -> 3 transitions. Since it fundamentally changes how things like comparison and `str()` work it isn't something to flip on needlessly and you would be better

[Python-ideas] Re: Thoughts about Fast Python Engine and Python EveryWhere

2020-07-16 Thread Chris Angelico
On Fri, Jul 17, 2020 at 2:59 AM wrote: > > Recently I have been thinking about why `JavaScript` with it's horrible type > system and lots of edge cases has supported so many platform and is very fast > ... > > First answer is simple, because big companies such as Google, Facebook and so > on

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-07-16 Thread Guido van Rossum
I think it’s a reasonable idea and encourage you to start working on a design for the API and then a PRP. It would help if someone looked into a prototype implementation as well (once a design has been settled on). On Thu, Jul 16, 2020 at 03:31 Steven D'Aprano wrote: > On Wed, Jul 15, 2020 at

[Python-ideas] Re: Thoughts about Fast Python Engine and Python EveryWhere

2020-07-16 Thread David Mertz
On Thu, Jul 16, 2020 at 12:59 PM wrote: > Recently I have been thinking about why `JavaScript` with it's horrible > type system and lots of edge cases has supported so many platform and is > very fast ... > First answer is simple, because big companies such as Google, Facebook and > so on evolve

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-07-16 Thread Todd
On Fri, Jul 10, 2020, 12:44 Steven D'Aprano wrote: > On Fri, Jul 10, 2020 at 02:48:31PM +0200, Alex Hall wrote: > > > I believe he was saying it would be weird if `d[1, 2]` called > > `d.__getitem__((1, 2))` but `d[1, 2, x=3]` called `d.__getitem__(1, 2, > > x=3)`. More generally, if

[Python-ideas] Re: Thoughts about Fast Python Engine and Python EveryWhere

2020-07-16 Thread Rhodri James
On 16/07/2020 17:59, redrad...@gmail.com wrote: Recently I have been thinking about why `JavaScript` with it's horrible type system and lots of edge cases has supported so many platform and is very fast ... First answer is simple, because big companies such as Google, Facebook and so on

[Python-ideas] Re: Allowing -b (BytesWarning) to be activated in other ways

2020-07-16 Thread Brett Cannon
I honestly wouldn't expect that flag to last forever because it exists purely to help with Python 2 -> 3 transitions. Since it fundamentally changes how things like comparison and `str()` work it isn't something to flip on needlessly and you would be better off using a type checker or linter to

[Python-ideas] Re: Thoughts about Fast Python Engine and Python EveryWhere

2020-07-16 Thread Brett Cannon
CPython is already very portable thanks to it being implemented in C. I don't see, though, how a lack of stdlib for JavaScript makes it fast? Unless you're saying the Python core team should drop the stdlib so it has more time to focus on the CPython interpreter itself? On Thu, Jul 16, 2020 at

[Python-ideas] Thoughts about Fast Python Engine and Python EveryWhere

2020-07-16 Thread redradist
Recently I have been thinking about why `JavaScript` with it's horrible type system and lots of edge cases has supported so many platform and is very fast ... First answer is simple, because big companies such as Google, Facebook and so on evolve this language and run-time for it ... But it

[Python-ideas] Re: Pickle security improvements

2020-07-16 Thread Wes Turner
On Thu, Jul 16, 2020, 2:30 AM Stephen J. Turnbull < turnbull.stephen...@u.tsukuba.ac.jp> wrote: > [...] > > > How do I use JSON to serialise an arbitrary instance of some class? > > Ask Wes Turner about semantic JSON or whatever it is he frequently > advocates for providing more type information

[Python-ideas] Allowing -b (BytesWarning) to be activated in other ways

2020-07-16 Thread Shai Berger
Hi Pythonistas, The -b flag, which turns on checks which emit BytesWarnings on operations mixing bytes and str objects, is very useful. However, the only way to set this flag is via the Python invocation. This limits its usability in contexts where the user's control of the Python invocation is

[Python-ideas] Re: Missing link to git repo on the “Source code” page

2020-07-16 Thread Guido van Rossum
Hello Hans, This list is more for ideas related to Python the language. For the website, each page on python.org has a link at the bottom to the tracker where you can submit requests for improvements and PRs for the website itself. —Guido On Thu, Jul 16, 2020 at 04:31 Hans Ginzel wrote: >

[Python-ideas] Re: Pickle security improvements

2020-07-16 Thread Random832
On Thu, Jul 16, 2020, at 02:36, Stephen J. Turnbull wrote: > Random832 writes: > > > I was asking for the current Unpickler class, which currently has a > > whitelist hook for loading globals, > > Callables are globals in this sense. not all callables are globals, as has been pointed out

[Python-ideas] Re: Missing link to git repo on the “Source code” page

2020-07-16 Thread Hans Ginzel
there are links to each releases on the “Source code” page, https://www.python.org/downloads/source/. Even for documentation. Each page should contain link to its source in git repo to easily correct typos via pull requests. E.g., where does source of the Glossary page live,

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-07-16 Thread Steven D'Aprano
On Wed, Jul 15, 2020 at 11:09:42PM -0700, Caleb Donovick wrote: > I have wanted this and suggested it before for use with typing. Was Guido interested or did he reject the idea? -- Steven ___ Python-ideas mailing list -- python-ideas@python.org To

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-07-16 Thread Paul Sokolovsky
Hello, On Wed, 15 Jul 2020 23:09:42 -0700 Caleb Donovick wrote: > I have wanted this and suggested it before for use with typing. > > Defining protocols is obnoxiously verbose for "struct" like data and > keyword > arguments to subscript could help alleviate that. > I often want to write type

[Python-ideas] Missing link to git repo on the “Source code” page

2020-07-16 Thread Hans Ginzel
Hello, there are links to each releases on the “Source code” page, https://www.python.org/downloads/source/. But I am missing a ling to the (official) git repository, e.g. https://github.com/python or which one is it. Thank you in advance, Hans ___

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-07-16 Thread Jonathan Fine
Hi Caleb You wrote (call it FUTURE) > def foo(x: Protocol[id=int, name=str]): > bar(x) > baz(x) > As you know, at present this causes a SyntaxError. However (call it NOW) def foo(x: Protocol[o(id=int, name=str])): bar(x) baz(x) has no syntax error. I'll

[Python-ideas] Re: add !p to pprint.pformat() in str.format() an f-strings

2020-07-16 Thread Alex Hall
+1. I imagine I would use this fairly often, particularly in debugging or interactive sessions. It goes well with the magic `=` in f-strings, e.g. `print(f"{d=!p}")`. It's more useful than the others because the manual way requires an import. It's easy to learn, easy to remember, and fits

[Python-ideas] Re: PEP 472 -- Support for indexing with keyword arguments

2020-07-16 Thread Caleb Donovick
I have wanted this and suggested it before for use with typing. Defining protocols is obnoxiously verbose for "struct" like data and keyword arguments to subscript could help alleviate that. I often want to write type hint like this: ``` def foo(x: Protocol[id=int, name=str]): bar(x)

[Python-ideas] Re: Pickle security improvements

2020-07-16 Thread Stephen J. Turnbull
Random832 writes: > I was asking for the current Unpickler class, which currently has a > whitelist hook for loading globals, Callables are globals in this sense. So overriding Unpickler.find_class will allow you to restrict to specified callables. It's not clear to me why you would want

[Python-ideas] Re: Pickle security improvements

2020-07-16 Thread Stephen J. Turnbull
Steven D'Aprano writes: > But if I'm distributing my code to others, the responsible thing to do > is to think of the potential security risks about using pickle in my > app, or library. What if they use it in ways that I didn't foresee, ways > which *ought to be* safe except for my choice

[Python-ideas] encode/decode for all objects

2020-07-16 Thread Stephen J. Turnbull
Michael A. Smith writes: > It seems to me that obj.encode("json") and str.decode("json"), for example, > would be a powerful feature, This idea comes up a lot in various forms. The most popular lately is an optional __json__ dunder, which really would avoid the complication of working with