PyClsProps 0.1.0__py3-none-any.whl

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.
PyClsProps/__init__.py ADDED
@@ -0,0 +1,11 @@
1
+ from collections.abc import Callable
2
+ from typing import Any, Generic, TypeVar
3
+
4
+ T = TypeVar("T")
5
+
6
+ class classproperty(Generic[T]):
7
+ def __init__(self, fget: Callable[[type[Any]], T]) -> None:
8
+ self.fget = fget
9
+
10
+ def __get__(self, obj: Any, owner: type[Any]) -> T:
11
+ return self.fget(owner)
PyClsProps/py.typed ADDED
File without changes
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyClsProps
3
+ Version: 0.1.0
4
+ Summary: Lightweight library for class properties in CPython
5
+ Requires-Python: >=3.11
6
+ Description-Content-Type: text/markdown
7
+ Provides-Extra: dev
8
+ Requires-Dist: pyright; extra == "dev"
9
+
10
+ # The lightweight library for class properties in CPython
11
+
12
+ ## Requirements:
13
+
14
+ - Python 3.11 or greater
15
+
16
+ ## Example of using:
17
+
18
+ ```python
19
+ from PyClsProps import classproperty
20
+
21
+ class MyClass:
22
+ @classproperty
23
+ def a(self) -> int:
24
+ return 42
25
+ ```
@@ -0,0 +1,6 @@
1
+ PyClsProps/__init__.py,sha256=9170DmV-Iz_o0EHX7O9WiFIjRZP9pYIzXdk1axQKor8,317
2
+ PyClsProps/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ pyclsprops-0.1.0.dist-info/METADATA,sha256=9OBTSgsVDi2WF4jQvuQBvnWk031wHDr0FenNu4byCPU,517
4
+ pyclsprops-0.1.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
5
+ pyclsprops-0.1.0.dist-info/top_level.txt,sha256=Y4vOCYNtK3Nz017AnhwkJHWnaDUBrw-of2Mtu-Ihjcs,11
6
+ pyclsprops-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ PyClsProps