PyClsProps 0.1.0__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.
- pyclsprops-0.1.0/PKG-INFO +25 -0
- pyclsprops-0.1.0/PyClsProps/__init__.py +11 -0
- pyclsprops-0.1.0/PyClsProps/py.typed +0 -0
- pyclsprops-0.1.0/PyClsProps.egg-info/PKG-INFO +25 -0
- pyclsprops-0.1.0/PyClsProps.egg-info/SOURCES.txt +9 -0
- pyclsprops-0.1.0/PyClsProps.egg-info/dependency_links.txt +1 -0
- pyclsprops-0.1.0/PyClsProps.egg-info/requires.txt +3 -0
- pyclsprops-0.1.0/PyClsProps.egg-info/top_level.txt +1 -0
- pyclsprops-0.1.0/README.md +16 -0
- pyclsprops-0.1.0/pyproject.toml +19 -0
- pyclsprops-0.1.0/setup.cfg +4 -0
|
@@ -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,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)
|
|
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 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
PyClsProps
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# The lightweight library for class properties in CPython
|
|
2
|
+
|
|
3
|
+
## Requirements:
|
|
4
|
+
|
|
5
|
+
- Python 3.11 or greater
|
|
6
|
+
|
|
7
|
+
## Example of using:
|
|
8
|
+
|
|
9
|
+
```python
|
|
10
|
+
from PyClsProps import classproperty
|
|
11
|
+
|
|
12
|
+
class MyClass:
|
|
13
|
+
@classproperty
|
|
14
|
+
def a(self) -> int:
|
|
15
|
+
return 42
|
|
16
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "PyClsProps"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Lightweight library for class properties in CPython"
|
|
9
|
+
requires-python = ">=3.11"
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
dependencies = []
|
|
12
|
+
|
|
13
|
+
[project.optional-dependencies]
|
|
14
|
+
dev = [
|
|
15
|
+
"pyright"
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
[tool.setuptools.package-data]
|
|
19
|
+
"PyClsProps" = ["py.typed"]
|