Skip to content

Commit

Permalink
REF: Remove __slots__ as Python has gotten leaner
Browse files Browse the repository at this point in the history
Refs #336
  • Loading branch information
kernc committed Feb 6, 2025
1 parent 0e17bd1 commit da45e73
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions pdoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,6 @@ class Doc:
also correspond to unexported members of the module, particularly in
a class's ancestor list.)
"""
__slots__ = ('module', 'name', 'obj', 'docstring', 'inherits')

def __init__(self, name: str, module, obj, docstring: str = ''):
"""
Expand Down Expand Up @@ -649,9 +648,6 @@ class Module(Doc):
it was imported from. It is always an absolute import path.
"""

__slots__ = ('supermodule', 'doc', '_context', '_is_inheritance_linked',
'_skipped_submodules')

def __init__(self, module: Union[ModuleType, str], *,
docfilter: Optional[Callable[[Doc], bool]] = None,
supermodule: Optional['Module'] = None,
Expand Down Expand Up @@ -1035,8 +1031,6 @@ class Class(Doc):
"""
Representation of a class' documentation.
"""
__slots__ = ('doc', '_super_members')

def __init__(self, name: str, module: Module, obj, *, docstring: Optional[str] = None):
assert inspect.isclass(obj)

Expand Down Expand Up @@ -1375,8 +1369,6 @@ class Function(Doc):
"""
Representation of documentation for a function or method.
"""
__slots__ = ('cls',)

def __init__(self, name: str, module: Module, obj, *, cls: Optional[Class] = None):
"""
Same as `pdoc.Doc`, except `obj` must be a
Expand Down Expand Up @@ -1648,8 +1640,6 @@ class Variable(Doc):
Representation of a variable's documentation. This includes
module, class, and instance variables.
"""
__slots__ = ('cls', 'instance_var', 'kind')

def __init__(self, name: str, module: Module, docstring, *,
obj=None, cls: Optional[Class] = None, instance_var: bool = False,
kind: Literal["prop", "var"] = 'var'):
Expand Down

0 comments on commit da45e73

Please sign in to comment.