flintlib / python-flint

Python bindings for Flint and Arb
MIT License
130 stars 24 forks source link

E743 ambiguous function definition #210

Closed GiacomoPope closed 2 weeks ago

GiacomoPope commented 3 weeks ago
    def l(self, s):
        """
        Evaluates the Dirichlet L-function of this character at the given
        complex number s.

            >>> from flint import showgood
            >>> chi = dirichlet_char(1, 1)
            >>> showgood(lambda: chi.l(2), dps=25)
            1.644934066848226436472415
            >>> chi = dirichlet_char(7, 3)
            >>> showgood(lambda: chi.l(2+3j), dps=25)
            1.273313649440490751755284 - 0.07432329442559421607102118j

        """
        s = any_as_acb(s)
        cdef acb v
        v = acb.__new__(acb)
        acb_dirichlet_l((<acb>v).val, (<acb>s).val, self.G.val, self.val, getprec())
        return v

We currently have this function, which triggers the listing error E741 ambiguous variable name 'l'. I think we could probably call this dirichlet_l to match Flint, or l_function? I'm not sure what other people think so I've made this issue to discuss.

oscarbenjamin commented 3 weeks ago

Does cython-lint have a way to mark it as ignored like # lint: ignore?

Having a different name does not seem unreasonable if we don't like the current name. The old name should probably still be kept as an alias though since there is no strong reason to break compatibility.

GiacomoPope commented 3 weeks ago

yeah i think we can add a comment to ignore the warning, but if we allow l() here, should we just allow it wherever and maintain the ignore in the list?

I have no feelings about the current name really. I probably wouldnt call it l(s) but it's also probably fine.

oscarbenjamin commented 3 weeks ago

should we just allow it wherever and maintain the ignore in the list?

Yeah, I guess so.

What we should do though is add some comments to the ignore list to explain what is being ignored and why.