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

2020-06-15 Thread Steve Barnes
-Original Message- From: Greg Ewing Sent: 15 June 2020 07:23 To: python-ideas@python.org Subject: [Python-ideas] Re: For quicker execution, don't refcount objects that can't be deleted On 15/06/20 5:11 pm, Steve Barnes wrote: > Of course if we had a NaN value for integers, int('NaN')

[Python-ideas] Keyword 'THIS'

2020-06-15 Thread M Bfmv
Hey all. Ever had some list comprehension hell in your code? Me neither *whistles 418 happly*... I was thinking about this idea and while `this` keyword is equalevant to `self` i have to explain myself. English is not my main language, sorry for that :' ) Here is my pseudo code. ``` if [i for i

[Python-ideas] Re: Keyword 'THIS'

2020-06-15 Thread Henk-Jaap Wagenaar
How about using the Walrus operator/assignment expression, since Python 3.8? if this := [i for i in range(10) if i == 5]: print(this) Evaluate: [5] On Mon, 15 Jun 2020 at 16:03, M Bfmv wrote: > Hey all. Ever had some list comprehension hell in your code? > Me neither *whistles 418 happly*...

[Python-ideas] Re: Keyword 'THIS'

2020-06-15 Thread Henk-Jaap Wagenaar
*available since Python 3.8. Link here: https://docs.python.org/3/whatsnew/3.8.html On Mon, 15 Jun 2020 at 16:06, Henk-Jaap Wagenaar wrote: > How about using the Walrus operator/assignment expression, since Python > 3.8? > > if this := [i for i in range(10) if i == 5]: > print(this) > > Evalu

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

2020-06-15 Thread Barry Scott
> On 14 Jun 2020, at 22:59, Ben Rudiak-Gould wrote: > > There isn't really any contention for these memory locations in > CPython as it stands because only one interpreter thread can run at a > time. The only time a cache handoff is needed is during a thread > switch when the new thread is sch

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

2020-06-15 Thread Christopher Barker
On Mon, Jun 15, 2020 at 9:21 AM Barry Scott wrote: > The problem is when you fork a python process. > > Each of the child processes you would hope shared the state of the > parent that is not being changed. But because of ref counting > even unchanging objects get modified by a ref count inc/dec

[Python-ideas] Python WebAssembly Support

2020-06-15 Thread redradist
Hi all, I love Python, but as soon as I need to do something in browser I have to use ugly JavaScript !! Is there any future plans support for compiling CPython to WebAssembly using Emscripten ? ___ Python-ideas mailing list -- python-ideas@python.org

[Python-ideas] Re: Python WebAssembly Support

2020-06-15 Thread Matthew Einhorn
On Mon, Jun 15, 2020 at 4:46 PM wrote: > Hi all, > > I love Python, but as soon as I need to do something in browser I have to > use ugly JavaScript !! > > Is there any future plans support for compiling CPython to WebAssembly > using Emscripten ? > There is already a project working on this: ht

[Python-ideas] Re: Python WebAssembly Support

2020-06-15 Thread redradist
Thanks, but I know about this implementation ... But my question is why not to apply all this patches to `CPython` to be able to compile `CPython` on the Web ? https://github.com/iodide-project/pyodide https://github.com/dgym/cpython-emscripten Patches to CPython seems pretty straightforward ...

[Python-ideas] Re: Python WebAssembly Support

2020-06-15 Thread Joao S. O. Bueno
Thre are already projects that build Python using Web Assembly - But as far as I know, these do not have a good interface with the document DOM. https://hacks.mozilla.org/2019/04/pyodide-bringing-the-scientific-python-stack-to-the-browser/ Maybe you'd like to take a look at Brython instead - it i

[Python-ideas] Re: Python WebAssembly Support

2020-06-15 Thread redradist
The question is why not to apply all this patches to CPython to be able to compile CPython on the Web ? ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3

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

2020-06-15 Thread Barry Scott
> On 15 Jun 2020, at 20:48, Christopher Barker wrote: > > On Mon, Jun 15, 2020 at 9:21 AM Barry Scott > wrote: > The problem is when you fork a python process. > > Each of the child processes you would hope shared the state of the > parent that is not being chan

[Python-ideas] Re: Python WebAssembly Support

2020-06-15 Thread Dan Sommers
On Monday, June 15, 2020, at 16:03 -0500, redrad...@gmail.com wrote: Thanks, but I know about this implementation ... But my question is why not to apply all this patches to `CPython` ... And my question is: are *you* prepared to develop, test, maintain, and support this for the next N

[Python-ideas] Re: Python WebAssembly Support

2020-06-15 Thread Eric V. Smith
On 6/15/2020 5:11 PM, redrad...@gmail.com wrote: The question is why not to apply all this patches to CPython to be able to compile CPython on the Web ? Because that will cause an ongoing support burden for an unknown value. What's wrong with keeping the patches separate? Eric __

[Python-ideas] Re: Keyword 'THIS'

2020-06-15 Thread Steven D'Aprano
On Mon, Jun 15, 2020 at 03:01:55PM +, M Bfmv wrote: > Hey all. Ever had some list comprehension hell in your code? > Me neither *whistles 418 happly*... If you are having list comprehension hell, you are doing too much in list comprehensions. They are a hammer. Not everything is a nail. > I

[Python-ideas] String module name

2020-06-15 Thread redradist
What if we introduce the string module: ```python from "https://python.org/some_module.py"; import name ... ``` It will add possibility to run code with complex name of module that cannot be presented as set of lexical items and also will allow to load the module from external location ___

[Python-ideas] Re: String module name

2020-06-15 Thread Steven D'Aprano
On Tue, Jun 16, 2020 at 12:19:00AM -, redrad...@gmail.com wrote: > from "https://python.org/some_module.py"; import name The last thing I want to see is modules start importing code from arbitrary, untrustworthy websites. > It will add possibility to run code with complex name of module W

[Python-ideas] the 'z' string escape

2020-06-15 Thread Soni L.
in Lua 5.2+, there's this string escape that allows you to put "whitespace" (in particular, including newlines) in a string literal, by skipping them entirely. now, unlike lua's long strings, python *does* have escapes in long strings. however, sometimes you have help text:     "sw

[Python-ideas] Re: Python WebAssembly Support

2020-06-15 Thread Wes Turner
conda-forge builds for ARM64 now ("miniforge"). Maybe someday conda-forge will build packages for WASM, too. The pyiodide work would probably translate well. There's a version of JupyterLab compiled to WASM w/ all of pyiodide called 'Jyve' that runs totally in the browser... Latest Chrome support

[Python-ideas] Re: Python WebAssembly Support

2020-06-15 Thread Wes Turner
Here are the conda-forge/python-feedstock CPython patches: https://github.com/conda-forge/python-feedstock/tree/master/recipe/patches They're specified in meta.yml: https://github.com/conda-forge/python-feedstock/blob/master/recipe/meta.yaml Patches could probably be included e.g. only for a WASM

[Python-ideas] Re: Bringing the print statement back

2020-06-15 Thread Rob Cliffe via Python-ideas
On 12/06/2020 00:17, MRAB wrote: On 2020-06-11 22:15, Ethan Furman wrote: On 06/11/2020 01:18 PM, Rob Cliffe via Python-ideas wrote: If the new super-duper all-singing-and-dancing-and-make-the-tea parser can cope with 'print' without parens, it can cope with print followed by nothing. Good

[Python-ideas] Re: Keyword 'THIS'

2020-06-15 Thread Rob Cliffe via Python-ideas
These examples would seem to be tailor-made for the walrus operator: On 15/06/2020 16:01, M Bfmv wrote: Hey all. Ever had some list comprehension hell in your code? Me neither *whistles 418 happly*... I was thinking about this idea and while `this` keyword is equalevant to `self` i have to expl

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

2020-06-15 Thread Stephen J. Turnbull
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. They think "wow, I could really use this, and I bet other people too." math.isclose probably tempts somebody somewhere in the wo

[Python-ideas] the 'z' string escape

2020-06-15 Thread Stephen J. Turnbull
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 already have that, if you don't care about left-alignment:

[Python-ideas] Keyword 'THIS'

2020-06-15 Thread Stephen J. Turnbull
M Bfmv writes: > ``` > if [i for i in range(10) if i == 11]: > print(this) > > Evaluate: [] > ``` This usage of 'this' in that code is called "anaphora". It's very useful in natural language and most (all? :-) natural languages have it, but in a programming language it requires a conv

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

2020-06-15 Thread Greg Ewing
On 16/06/20 4:16 am, Barry Scott wrote: even unchanging objects get modified by a ref count inc/dec cycle and then the page that the object is in is copy-on-write'ed. End result is that a children share no pages with the parent. I wonder if it's worth trying to do anything about that? Like may

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

2020-06-15 Thread Paul Sokolovsky
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 > > 'repos' \z table is preserved as 'repos_