On Tue, Oct 19, 2021 at 8:54 PM Hongyi Zhao <hongyi.z...@gmail.com> wrote:

> On Wed, Oct 20, 2021 at 8:29 AM Robert Kern <robert.k...@gmail.com> wrote:
> >
> > On Tue, Oct 19, 2021 at 8:22 PM <hongyi.z...@gmail.com> 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 -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to