Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #11936

Merged
merged 3 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions sphinx/ext/autodoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2540,7 +2540,7 @@ def is_uninitialized_instance_attribute(self, parent: Any) -> bool:
return self.objpath[-1] in annotations

def import_object(self, raiseerror: bool = False) -> bool:
"""Check the exisitence of uninitialized instance attribute when failed to import
"""Check the existence of uninitialized instance attribute when failed to import
the attribute.
"""
try:
Expand Down Expand Up @@ -2761,7 +2761,7 @@ def can_document_member(
return False

def import_object(self, raiseerror: bool = False) -> bool:
"""Check the exisitence of uninitialized instance attribute when failed to import
"""Check the existence of uninitialized instance attribute when failed to import
the attribute.
"""
ret = super().import_object(raiseerror)
Expand Down Expand Up @@ -2834,7 +2834,7 @@ def _get_property_getter(self) -> Callable | None:

def autodoc_attrgetter(app: Sphinx, obj: Any, name: str, *defargs: Any) -> Any:
"""Alternative getattr() for types"""
for typ, func in app.registry.autodoc_attrgettrs.items():
for typ, func in app.registry.autodoc_attrgetters.items():
if isinstance(obj, typ):
return func(obj, name, *defargs)

Expand Down
6 changes: 3 additions & 3 deletions sphinx/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
class SphinxComponentRegistry:
def __init__(self) -> None:
#: special attrgetter for autodoc; class object -> attrgetter
self.autodoc_attrgettrs: dict[type, Callable[[Any, str, Any], Any]] = {}
self.autodoc_attrgetters: dict[type, Callable[[Any, str, Any], Any]] = {}
AA-Turner marked this conversation as resolved.
Show resolved Hide resolved

#: builders; a dict of builder name -> builder class
self.builders: dict[str, type[Builder]] = {}
Expand Down Expand Up @@ -117,7 +117,7 @@ def __init__(self) -> None:
#: post transforms; list of transforms
self.post_transforms: list[type[Transform]] = []

#: source paresrs; file type -> parser class
#: source parsers; file type -> parser class
self.source_parsers: dict[str, type[Parser]] = {}

#: source suffix: suffix -> file type
Expand Down Expand Up @@ -381,7 +381,7 @@ def add_documenter(self, objtype: str, documenter: type[Documenter]) -> None:

def add_autodoc_attrgetter(self, typ: type,
attrgetter: Callable[[Any, str, Any], Any]) -> None:
self.autodoc_attrgettrs[typ] = attrgetter
self.autodoc_attrgetters[typ] = attrgetter

def add_css_files(self, filename: str, **attributes: Any) -> None:
self.css_files.append((filename, attributes))
Expand Down