[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2022-01-24 Thread Steven Troxler
> It would be nice if someone did some work and collected a list of tutorials > about type annotations that exist (especially the ones that are discoverable > with a simple Bing query) and ranked them by quality. I went with Google rather than Bing but here's what I found:

[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2021-12-02 Thread Christopher Barker
On Thu, Dec 2, 2021 at 9:48 AM Eric Fahlgren wrote: > wait, what? It seems so clear to me that "PathLike" (as a type specifier) > would mean: anything that can be passed into os.fspath to give me a path. > (or, of course to the stdlib functions that take paths) >> >> >> Isn't the entire purpose

[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2021-12-02 Thread Brett Cannon
On Wed, Dec 1, 2021 at 10:40 PM Christopher Barker wrote: > I know this isn't really the place for this conversation, but: > > >> which is what `os.PathLike` represents, hence why `str` isn't covered by >> it); >> > > wait, what? It seems so clear to me that "PathLike" (as a type specifier) >

[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2021-12-02 Thread Eric Fahlgren
On Wed, Dec 1, 2021 at 10:50 PM Christopher Barker wrote: > I know this isn't really the place for this conversation, but: > > >> which is what `os.PathLike` represents, hence why `str` isn't covered by >> it); >> > > wait, what? It seems so clear to me that "PathLike" (as a type specifier) >

[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2021-12-01 Thread Christopher Barker
I know this isn't really the place for this conversation, but: > which is what `os.PathLike` represents, hence why `str` isn't covered by > it); > wait, what? It seems so clear to me that "PathLike" (as a type specifier) would mean: anything that can be passed into os.fspath to give me a path.

[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2021-12-01 Thread Brett Cannon
On Tue, Nov 30, 2021 at 1:34 PM Paul Moore wrote: > On Tue, 30 Nov 2021 at 19:07, Brett Cannon wrote: > > > > On Tue, Nov 30, 2021 at 9:09 AM Steven D'Aprano > wrote: > >> > >> On Tue, Nov 30, 2021 at 02:30:18PM +, Paul Moore wrote: > >> > >> > And to be clear, it's often very non-obvious

[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2021-11-30 Thread Christopher Barker
On Tue, Nov 30, 2021 at 3:31 PM Guido van Rossum wrote: > >> There is some discussion of the numeric tower in PEP 484 but the PEP says > you should just use 'int', 'float' and be happy. > Thanks -- I didn't think to look there. And this: "when an argument is annotated as having type float, an

[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2021-11-30 Thread Steve Dower
On 12/1/2021 12:47 AM, Oscar Benjamin wrote: On Tue, 30 Nov 2021 at 23:37, Guido van Rossum wrote: We should definitely push back on zealous new converts to typing who insist that everything should be annotated. But we should also recognize that even in their current, far from perfect

[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2021-11-30 Thread Guido van Rossum
On Tue, Nov 30, 2021 at 4:48 PM Oscar Benjamin wrote: > On Tue, 30 Nov 2021 at 23:37, Guido van Rossum wrote: > > > > We should definitely push back on zealous new converts to typing who > insist that everything should be annotated. But we should also recognize > that even in their current, far

[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2021-11-30 Thread Oscar Benjamin
On Tue, 30 Nov 2021 at 23:37, Guido van Rossum wrote: > > We should definitely push back on zealous new converts to typing who insist > that everything should be annotated. But we should also recognize that even > in their current, far from perfect state, type annotations can provide a lot >

[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2021-11-30 Thread Rob Cliffe via Python-Dev
Heh. We could update PEP 8 to ban type annotations, then watch as the people who over-zealously apply PEP 8 to everything AND over-zealously insist on adding type annotations to everything have their heads explode. -- Steve I love it! "Surtout, pas trop de

[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2021-11-30 Thread Guido van Rossum
On Tue, Nov 30, 2021 at 2:52 PM Christopher Barker wrote: > Another concern I have is the over specification of types. > > I have seen many examples of, e.g. > > func(x: int, y: float, stuff: List(int]): > > but very few of: > > func(x: SupportsInt, y: SupportsFloat, stuff:

[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2021-11-30 Thread Christopher Barker
Another concern I have is the over specification of types. I have seen many examples of, e.g. func(x: int, y: float, stuff: List(int]): but very few of: func(x: SupportsInt, y: SupportsFloat, stuff: Sequence[SupportsInt]): (or even Iterable[int]) Is that even the right thing to do to get

[Python-Dev] Re: Expectations of typing (was: The current state of typing PEPs)

2021-11-30 Thread Paul Moore
On Tue, 30 Nov 2021 at 19:07, Brett Cannon wrote: > > On Tue, Nov 30, 2021 at 9:09 AM Steven D'Aprano wrote: >> >> On Tue, Nov 30, 2021 at 02:30:18PM +, Paul Moore wrote: >> >> > And to be clear, it's often very non-obvious how to annotate something >> > - in