setdoc 1.3.4__tar.gz → 1.3.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {setdoc-1.3.4/src/setdoc.egg-info → setdoc-1.3.5}/PKG-INFO +1 -1
  2. {setdoc-1.3.4 → setdoc-1.3.5}/pyproject.toml +1 -1
  3. {setdoc-1.3.4 → setdoc-1.3.5}/src/setdoc/core/SetDoc.py +5 -3
  4. {setdoc-1.3.4 → setdoc-1.3.5}/src/setdoc/core/basic.py +5 -2
  5. setdoc-1.3.5/src/setdoc/typing/SupportsDoc.py +7 -0
  6. setdoc-1.3.5/src/setdoc/typing/SupportsDocAndName.py +7 -0
  7. setdoc-1.3.5/src/setdoc/typing/__init__.py +0 -0
  8. {setdoc-1.3.4 → setdoc-1.3.5/src/setdoc.egg-info}/PKG-INFO +1 -1
  9. {setdoc-1.3.4 → setdoc-1.3.5}/src/setdoc.egg-info/SOURCES.txt +4 -1
  10. {setdoc-1.3.4 → setdoc-1.3.5}/LICENSE.txt +0 -0
  11. {setdoc-1.3.4 → setdoc-1.3.5}/MANIFEST.in +0 -0
  12. {setdoc-1.3.4 → setdoc-1.3.5}/README.rst +0 -0
  13. {setdoc-1.3.4 → setdoc-1.3.5}/docs/v1.0.rst +0 -0
  14. {setdoc-1.3.4 → setdoc-1.3.5}/docs/v1.1.rst +0 -0
  15. {setdoc-1.3.4 → setdoc-1.3.5}/docs/v1.2.rst +0 -0
  16. {setdoc-1.3.4 → setdoc-1.3.5}/docs/v1.3.rst +0 -0
  17. {setdoc-1.3.4 → setdoc-1.3.5}/setup.cfg +0 -0
  18. {setdoc-1.3.4 → setdoc-1.3.5}/src/setdoc/__init__.py +0 -0
  19. {setdoc-1.3.4 → setdoc-1.3.5}/src/setdoc/_utils/__init__.py +0 -0
  20. {setdoc-1.3.4 → setdoc-1.3.5}/src/setdoc/_utils/cfg.toml +0 -0
  21. {setdoc-1.3.4 → setdoc-1.3.5}/src/setdoc/core/__init__.py +0 -0
  22. {setdoc-1.3.4 → setdoc-1.3.5}/src/setdoc/core/getbasicdoc.py +0 -0
  23. {setdoc-1.3.4 → setdoc-1.3.5}/src/setdoc/py.typed +0 -0
  24. {setdoc-1.3.4 → setdoc-1.3.5}/src/setdoc/tests/__init__.py +0 -0
  25. {setdoc-1.3.4 → setdoc-1.3.5}/src/setdoc/tests/test_core.py +0 -0
  26. {setdoc-1.3.4 → setdoc-1.3.5}/src/setdoc.egg-info/dependency_links.txt +0 -0
  27. {setdoc-1.3.4 → setdoc-1.3.5}/src/setdoc.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: setdoc
3
- Version: 1.3.4
3
+ Version: 1.3.5
4
4
  Summary: This project helps to set the doc string.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License-Expression: MIT
@@ -27,7 +27,7 @@ license-files = [
27
27
  name = "setdoc"
28
28
  readme = "README.rst"
29
29
  requires-python = ">=3.11"
30
- version = "1.3.4"
30
+ version = "1.3.5"
31
31
 
32
32
  [project.urls]
33
33
  Download = "https://pypi.org/project/setdoc/#files"
@@ -1,16 +1,18 @@
1
1
  import dataclasses
2
- from typing import Any, Self, TypeVar
2
+ from typing import Optional, Self, TypeVar
3
+
4
+ from setdoc.typing.SupportsDoc import SupportsDoc
3
5
 
4
6
  __all__ = ["SetDoc"]
5
7
 
6
- Target = TypeVar("Target")
8
+ Target = TypeVar("Target", bound=SupportsDoc)
7
9
 
8
10
 
9
11
  @dataclasses.dataclass
10
12
  class SetDoc:
11
13
  "This class helps to set doc strings."
12
14
 
13
- doc: Any
15
+ doc: Optional[str]
14
16
 
15
17
  def __call__(self: Self, target: Target) -> Target:
16
18
  "This magic method implements calling the current instance. It sets the doc string of the passed target to the value stored in the doc field of the setdoc object."
@@ -1,11 +1,14 @@
1
- import types
1
+ from typing import TypeVar
2
2
 
3
3
  from setdoc.core.getbasicdoc import getbasicdoc
4
+ from setdoc.typing.SupportsDocAndName import SupportsDocAndName
4
5
 
5
6
  __all__ = ["basic"]
6
7
 
8
+ Value = TypeVar("Value", bound=SupportsDocAndName)
7
9
 
8
- def basic(value: types.FunctionType) -> types.FunctionType:
10
+
11
+ def basic(value: Value) -> Value:
9
12
  "This decorator sets the docstring of the given value to what is suggested by its name."
10
13
  value.__doc__ = getbasicdoc(value.__name__)
11
14
  return value
@@ -0,0 +1,7 @@
1
+ from typing import Optional, Protocol
2
+
3
+ __all__ = ["SupportsDoc"]
4
+
5
+
6
+ class SupportsDoc(Protocol):
7
+ __doc__: Optional[str]
@@ -0,0 +1,7 @@
1
+ from .SupportsDoc import SupportsDoc
2
+
3
+ __all__ = ["SupportsDocAndName"]
4
+
5
+
6
+ class SupportsDocAndName(SupportsDoc):
7
+ __name__: str
File without changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: setdoc
3
- Version: 1.3.4
3
+ Version: 1.3.5
4
4
  Summary: This project helps to set the doc string.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License-Expression: MIT
@@ -20,4 +20,7 @@ src/setdoc/core/__init__.py
20
20
  src/setdoc/core/basic.py
21
21
  src/setdoc/core/getbasicdoc.py
22
22
  src/setdoc/tests/__init__.py
23
- src/setdoc/tests/test_core.py
23
+ src/setdoc/tests/test_core.py
24
+ src/setdoc/typing/SupportsDoc.py
25
+ src/setdoc/typing/SupportsDocAndName.py
26
+ src/setdoc/typing/__init__.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes