Automatic __str__ for classes
Project description
autostr
Небольшой модуль, который добавляет класс AutostrMixin
Вы можете наследоваться от данного класса и тогда вам не придётся писать __str__
Пример:
from autostr import AutostrMixin
class A(AutostrMixin):
b = 0
def __init__(self):
self.a = 1
t = A()
print(t)
Вывод:
Экземпляр класса: A
Атрибуты класса:
·b: 0
Атрибуты экземпляра:
·a: 1
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
autostr-2.0.tar.gz
(2.6 kB
view details)
File details
Details for the file autostr-2.0.tar.gz.
File metadata
- Download URL: autostr-2.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef1d5f190fba6198c17c95ed5fb3f25cef2fc20b441b05c2a5ab22925059b5aa
|
|
| MD5 |
c7cfc330ea2219b57c6465c070392ca6
|
|
| BLAKE2b-256 |
9bfcacfab01de33790c56a4d5fda8293800fff131acb8d22ee8587eb2886c74d
|