> 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:
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
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)
>
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)
>
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.
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
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
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
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
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
>
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
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:
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
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
14 matches
Mail list logo