[Python-Dev] Re: Suggestion: a little language for type definitions

2022-01-09 Thread Steven D'Aprano
On Sun, Jan 09, 2022 at 08:42:14AM -0800, Christopher Barker wrote: > Perhaps it's worth remembering that this thread spun off one about adding > syntax to Python because the current syntax isn't capable of easily > expressing an important type hinting concept (i.e. Callable). I shall quote the

[Python-Dev] Re: Suggestion: a little language for type definitions

2022-01-09 Thread Chris Angelico
On Mon, Jan 10, 2022 at 12:05 PM Steven D'Aprano wrote: > > On Mon, Jan 10, 2022 at 05:39:42AM +1100, Chris Angelico wrote: > > > From my understanding, "x->y" would create a Callable if given two > > *types*, but its meaning if given two other objects is still > > undefined. > > The PEP requires

[Python-Dev] Re: Suggestion: a little language for type definitions

2022-01-09 Thread Steven D'Aprano
On Mon, Jan 10, 2022 at 05:39:42AM +1100, Chris Angelico wrote: > From my understanding, "x->y" would create a Callable if given two > *types*, but its meaning if given two other objects is still > undefined. The PEP requires parentheses around the argument list, so that would be a SyntaxError.

[Python-Dev] PEP 679 – Allow parentheses in assert statements

2022-01-09 Thread Pablo Galindo Salgado
Hi everyone, I would like to start a discussion about a small PEP proposal to allow parentheses in assert statements to fix a common gotcha with assert statements. Link to the PEP: https://www.python.org/dev/peps/pep-0679/ *Please, redirect all discussions to: *

[Python-Dev] Re: Suggestion: a little language for type definitions

2022-01-09 Thread Jelle Zijlstra
El dom, 9 ene 2022 a las 10:50, Chris Angelico () escribió: > On Mon, Jan 10, 2022 at 3:49 AM Christopher Barker > wrote: > > > If "x->y" is syntactically valid anywhere in Python code, it's not a > > problem that there are no core data types for which it's meaningful.) > > > > Here's where I'm

[Python-Dev] Re: Suggestion: a little language for type definitions

2022-01-09 Thread Stéfane Fermigier
On 9 Jan 2022 at 02:22:31, Steven D'Aprano wrote: > On Sat, Jan 08, 2022 at 12:59:38AM +0100, jack.jan...@cwi.nl wrote: > > I posted this suggestion earlier in the callable type syntax discussion, > at which point it was completely ignored. Possibly because it’s a really > stupid idea, but let

[Python-Dev] Re: Suggestion: a little language for type definitions

2022-01-09 Thread Chris Angelico
On Mon, Jan 10, 2022 at 3:49 AM Christopher Barker wrote: > > If "x->y" is syntactically valid anywhere in Python code, it's not a > problem that there are no core data types for which it's meaningful.) > > Here's where I'm not so sure -- this looks a lot like a binary operator, but > it behaves

[Python-Dev] [PSA] OpenSSL 3.0 support is preliminary and experimental

2022-01-09 Thread Christian Heimes
Hi, I would like to remind everybody that Python's support for OpenSSL 3.0 is preliminary [1]. Python compiles with OpenSSL 3.0.0 and simple code kinda works. However there are known performance regressions, missing features (e.g. usedforsecurity flag), and potential bugs cause by API

[Python-Dev] Re: Suggestion: a little language for type definitions

2022-01-09 Thread Christopher Barker
Perhaps it's worth remembering that this thread spun off one about adding syntax to Python because the current syntax isn't capable of easily expressing an important type hinting concept (i.e. Callable). So arguing that Python is completely readable for type hints is a bit off-mark, isn't it? The

[Python-Dev] Re: Suggestion: a little language for type definitions

2022-01-09 Thread Skip Montanaro
> Here is the type hint for `len`, taken from the stub file in typeshed: > > def len(__obj: Sized) -> int: ... > > Putting the mysterious double underscore naming convention aside, I do > not find it credible that anyone capable of programming Python beyond a > beginner level can find that

[Python-Dev] Re: About vulnerabilities in Cpython native code

2022-01-09 Thread Chris Angelico
On Sun, Jan 9, 2022 at 7:35 PM Stephen J. Turnbull wrote: > > Chris Angelico writes: > > > Not completely, just very minorly. I'm distinguishing between attacks > > that can be triggered remotely, and those which require the attacker > > to run specific Python code. For example, using ctypes >

[Python-Dev] Re: About vulnerabilities in Cpython native code

2022-01-09 Thread Stephen J. Turnbull
Chris Angelico writes: > Not completely, just very minorly. I'm distinguishing between attacks > that can be triggered remotely, and those which require the attacker > to run specific Python code. For example, using ctypes OK. AFAICT that was a red herring introduced to the thread solely to