[Python-ideas] Re: Adding syntax for the empty set

2021-04-10 Thread Serhiy Storchaka
09.04.21 19:42, Ricky Teachey пише: > On Fri, Apr 9, 2021 at 3:20 AM Serhiy Storchaka > > wrote: > You can now use `{*()}` as a syntax for empty set. > > Interestingly, Raymond Hettinger recently had a post on twitter > specifically deriding this usage as

[Python-ideas] Re: Adding syntax for the empty set

2021-04-10 Thread Serhiy Storchaka
09.04.21 19:08, micro codery пише: > > You can now use `{*()}` as a syntax for empty set. > > I saw that in the ast module and think it's clever, mainly in a good > way. I don't think it is the same as having dedicated syntax for the > empty set partly because I think it needs to be taught.

[Python-ideas] Re: Add an export keyword to better manage __all__

2021-04-10 Thread Joseph Martinot-Lagarde
Theia Vogel wrote: > Hi, > I was refactoring some code today and ran into an issue that always bugs me > with > Python modules. It bugged me enough this time that I spent an hour banging > out this > potential proposal to add a new contextual keyword. Let me know what you > think! > Theia I

[Python-ideas] Re: Python Idea - extension of 'with'

2021-04-10 Thread Serhiy Storchaka
09.04.21 21:02, Guido van Rossum пише: > But if there are two proposals with conflicting semantics for the same > syntax that kills both ideas, doesn’t it? Because apparently it’s not > clear what the syntax should mean. Maybe. But there was also different idea for the "with" statement (with

[Python-ideas] Re: Non-blocking concurrent.futures ThreadPoolExecutor

2021-04-10 Thread Brunoais
(I know this has some time but I think it makes sense in context) That is much easier said than done in real life when the whole project is doing by a team and you are stuck with whatever you all do in the group. Even then, I prefer making my own programs with a mix of daemon and non-daemon

[Python-ideas] Re: Add an export keyword to better manage __all__

2021-04-10 Thread Neil Girdhar
I like the idea of improving the way interfaces are exported in Python. I still don't know what the standard is today. Some of my favourite projects like Jax have started tucking their source in a _src directory: https://github.com/google/jax/tree/master/jax/_src, and then importing the

[Python-ideas] Re: Add an export keyword to better manage __all__

2021-04-10 Thread Guido van Rossum
On Sun, Mar 14, 2021 at 10:55 PM Ethan Furman wrote: > I completely agree with this. One of the hallmarks of Python is the > ability to query, introspect, and modify Python code. It helps with > debugging, with experimenting, with fixing. Indeed, one of the few > frustrating bits about Python

[Python-ideas] Re: Python Idea - extension of 'with'

2021-04-10 Thread Stephen J. Turnbull
Serhiy Storchaka writes: > A year or two ago I proposed the same syntax with different semantic: to > catch only exceptions in the context manager, not in the with > block. FWIW, this is the semantics I would expect, for the reason you give: > Exceptions in the with block you can catch by

[Python-ideas] Re: Adding syntax for the empty set

2021-04-10 Thread Stephen J. Turnbull
Chris Angelico writes: > Not to mention everyone's keyboards. Python != APL. Err, I mean, > Python ≠ APL. I am really tired of this argument. set() is not going to go away. And it's easy enough to install input methods (aka "keyboards") on any modern system that allow you to enter these if

[Python-ideas] Re: Add an export keyword to better manage __all__

2021-04-10 Thread Jonathan Crall
I'd like to give a shoutout to a package I wrote called mkinit, which helps autogenerate explicit `__init__.py` files to mitigate some of the issues you mentioned (especially with respect to `from blah import *`). https://github.com/Erotemic/mkinit On Sat, Apr 10, 2021 at 3:08 PM Guido van

[Python-ideas] Re: Adding syntax for the empty set

2021-04-10 Thread Guido van Rossum
Please. Use. set(). On Sat, Apr 10, 2021 at 02:03 Serhiy Storchaka wrote: > 09.04.21 19:08, micro codery пише: > > > > You can now use `{*()}` as a syntax for empty set. > > > > I saw that in the ast module and think it's clever, mainly in a good > > way. I don't think it is the same as