Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions pandas/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def set_function_name(f: F, name: str, cls: type) -> F:
Bind the name/qualname attributes of the function.
"""
f.__name__ = name
f.__qualname__ = f"{cls.__name__}.{name}"
# Use str.__format__ instead of f-string for marginal performance gain
f.__qualname__ = "{}.{}".format(cls.__name__, name)
f.__module__ = cls.__module__
return f

Expand Down Expand Up @@ -107,9 +108,8 @@ def is_platform_arm() -> bool:
bool
True if the running platform uses ARM architecture.
"""
return platform.machine() in ("arm64", "aarch64") or platform.machine().startswith(
"armv"
)
mach = platform.machine()
return mach in ("arm64", "aarch64") or mach.startswith("armv")


def is_platform_power() -> bool:
Expand Down Expand Up @@ -150,6 +150,13 @@ def is_ci_environment() -> bool:


__all__ = [
"HAS_PYARROW",
"IS64",
"ISMUSL",
"PY311",
"PY312",
"PYPY",
"WASM",
"is_numpy_dev",
"pa_version_under10p1",
"pa_version_under11p0",
Expand All @@ -159,11 +166,4 @@ def is_ci_environment() -> bool:
"pa_version_under16p0",
"pa_version_under17p0",
"pa_version_under18p0",
"HAS_PYARROW",
"IS64",
"ISMUSL",
"PY311",
"PY312",
"PYPY",
"WASM",
]