Skip to content

Commit

Permalink
Handle Index without arguments, subclassing DataFrame and registe…
Browse files Browse the repository at this point in the history
…r accessor arguments (#1091)

* maybe keep these

* keep PandasDelegate
  • Loading branch information
Dr-Irv authored Jan 10, 2025
1 parent dc636d8 commit 1ba4965
Show file tree
Hide file tree
Showing 6 changed files with 189 additions and 176 deletions.
1 change: 1 addition & 0 deletions pandas-stubs/_typing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ T = TypeVar("T")
P = ParamSpec("P")
FuncType: TypeAlias = Callable[..., Any]
F = TypeVar("F", bound=FuncType)
TypeT = TypeVar("TypeT", bound=type)
HashableT = TypeVar("HashableT", bound=Hashable)
HashableT1 = TypeVar("HashableT1", bound=Hashable)
HashableT2 = TypeVar("HashableT2", bound=Hashable)
Expand Down
18 changes: 6 additions & 12 deletions pandas-stubs/core/accessor.pyi
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
from typing import Any
from typing import Callable

class PandasDelegate: ...

def delegate_names(
delegate: Any, accessors: Any, typ: str, overwrite: bool = ...
) -> Any: ...
from pandas._typing import TypeT

class CachedAccessor:
def __init__(self, name: str, accessor: Any) -> None: ...
def __get__(self, obj: Any, cls: Any): ...
class PandasDelegate: ...

def register_dataframe_accessor(name: Any): ...
def register_series_accessor(name: Any): ...
def register_index_accessor(name: Any): ...
def register_dataframe_accessor(name: str) -> Callable[[TypeT], TypeT]: ...
def register_series_accessor(name: str) -> Callable[[TypeT], TypeT]: ...
def register_index_accessor(name: str) -> Callable[[TypeT], TypeT]: ...
Loading

0 comments on commit 1ba4965

Please sign in to comment.