On Tue, Oct 19, 2021 at 8:54 PM Hongyi Zhao <[email protected]> wrote:

> On Wed, Oct 20, 2021 at 8:29 AM Robert Kern <[email protected]> wrote:
> >
> > On Tue, Oct 19, 2021 at 8:22 PM <[email protected]> wrote:
> >>
> >> Do I have to use it this way?
> >
> >
> > Nothing is forcing you to, but everyone else will write it as
> `dtype=bool`, not `dtype=(bool)`. `dtype=(bool)` is perfectly
> syntactically-valid Python. It's just not idiomatic, so readers of your
> code will wonder why you wrote it that way and if you meant something else
> and will have trouble reading your code.
>
> I use Emacs, and find that python-lsp-server will give the dtype=() as
> the completion result, see here [1] for more detailed discussion.
>
> [1] https://github.com/python-lsp/python-lsp-server/issues/98


Well, that's not helpful of python-lsp-server. Is it looking at our type
annotations? The annotations for `dtype=` arguments are likely quite
complicated because we accept so many different types here, but `()` is not
a great completion.

-- 
Robert Kern
_______________________________________________
NumPy-Discussion mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: [email protected]

Reply via email to