This resolves #1589. It updates the MRO for PyProxy: now `proxy.destroy` always refers to the method PyProxy class method that destroys the proxy, `proxy.$destroy` refers to an attribute or method on the proxied Python object. Similarly, `proxy.get` refers to the `PyProxy.get` method if `type(proxy)` has a `__getitem__` method. Otherwise, it refers to an attribute or method on the proxied object. To unambigiously look up `get` on the proxied object, use `proxy.$get`.

The docs should be updated to explain this.
ENH Use leading $ to distinguish shadowed PyProxy methods. This resolves #1589. It updates the MRO for PyProxy: now `proxy.destroy` always refers to the method PyProxy class method that destroys the proxy, `proxy.$destroy` refers to an attribute or method on the proxied Python object. Similarly, `proxy.get` refers to the `PyProxy.get` method if `type(proxy)` has a `__getitem__` method. Otherwise, it refers to an attribute or method on the proxied object. To unambigiously look up `get` on the proxied object, use `proxy.$get`.

The docs should be updated to explain this.
from textwrap import dedent

from pyodide_build._f2c_fixes import fix_f2c_clapack_calls


def test_fix_f2c_clapack_calls(tmpdir):
    code = dedent(
        """
       #include "f2c.h"

       int sgemv_(char *trans, integer *m, integer *n, real *alpha)
       {
          return 0;
       }
       """
    )

    source_file = tmpdir / "sgemv.c"
    with open(source_file, "w") as fh:
        fh.write(code)

    fix_f2c_clapack_calls(str(source_file))

    with open(source_file, "r") as fh:
        code_fixed = fh.read()

    assert code_fixed == code.replace("sgemv_", "wsgemv_")

from textwrap import dedent

from pyodide_build._f2c_fixes import fix_f2c_clapack_calls


def test_fix_f2c_clapack_calls(tmpdir):
    code = dedent(
        """
       #include "f2c.h"

       int sgemv_(char *trans, integer *m, integer *n, real *alpha)
       {
          return 0;
       }
       """
    )

    source_file = tmpdir / "sgemv.c"
    with open(source_file, "w") as fh:
        fh.write(code)

    fix_f2c_clapack_calls(str(source_file))

    with open(source_file, "r") as fh:
        code_fixed = fh.read()

    assert code_fixed == code.replace("sgemv_", "wsgemv_")
