Skip to content

Commit 80483de

Browse files
committed
docs: Add a few missing docstrings
1 parent c80653f commit 80483de

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/shmem4py/__init__.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ class Rc:
2121
initialize : bool
2222
Automatic initialization at import (default: True).
2323
threads : bool
24-
Request for thread support (default: False).
25-
thread_level : {'multiple', 'serialized', 'funneled', 'single'}
26-
Level of thread support to request (default: 'multiple').
24+
Request initialization with thread support (default: True).
25+
thread_level : {"multiple", "serialized", "funneled", "single"}
26+
Level of thread support to request (default: "multiple").
2727
finalize : None or bool
2828
Automatic finalization at exit (default: None).
2929
@@ -35,21 +35,25 @@ class Rc:
3535
finalize: Optional[bool] = None
3636

3737
def __init__(self, **kwargs: Any) -> None:
38+
"""Initialize options."""
3839
self(**kwargs)
3940

4041
def __setattr__(self, name: str, value: Any) -> None:
42+
"""Set option."""
4143
if not hasattr(self, name):
42-
raise TypeError(f"object has no attribute '{name}'")
44+
raise TypeError(f"object has no attribute {name!r}")
4345
super().__setattr__(name, value)
4446

4547
def __call__(self, **kwargs: Any) -> None:
48+
"""Update options."""
4649
for key in kwargs:
4750
if not hasattr(self, key):
48-
raise TypeError(f"unexpected argument '{key}'")
51+
raise TypeError(f"unexpected argument {key!r}")
4952
for key, value in kwargs.items():
5053
setattr(self, key, value)
5154

5255
def __repr__(self) -> str:
56+
"""Return repr(self)."""
5357
return f'<{__name__}.rc>'
5458

5559

0 commit comments

Comments
 (0)