auto_self_params
A python package to automatically assign parameters to self. This enables replacing code such as:
class A:
""" Typical Code. """
def __init__(self, param1, param2, kwparam1=0, kwparam2=0):
""" Create Example Class."""
self.param1 = param1
self.param2 = param2
self.kwparam1 = kwparam1
self.kwparam2 = kwparam2
# etc.
With code more like:
from auto_self_params import auto_self_params
class A:
""" Revised Code. """
def __init__(self, param1, param2, kwparam1=0, kwparam2=0):
""" Create Example Class."""
auto_self_params.auto_self_params(locals()) # Assign all parameters to self
# etc.
Only use this package if you need the paramters passed to __init__ to
produce matching names in self when called.
You can, however, create a dictionary with locals and remove unwanted
paramters before passing it to auto_self_params so as to exclude unwanted
parameters.
If you would like to use the:
def __init__(self, *args, **kwargs):
format then you may wish to use a pattern such as:
from auto_self_params import auto_self_params
class A:
""" Revised Code. """
def __init__(self, *args, **kwargs):
""" Create Example Class."""
param_dict = {'self': self, 'args': args, **kwargs}
auto_self_params.auto_self_params(param_dict) # Assign parameters to self
# etc.
Metadata
Release files for auto-self-params 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| auto_self_params-0.0.2.tar.gz | 2.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| auto_self_params-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.2 kB
Release files / auto_self_params-0.0.2.tar.gz
| Download URL | auto_self_params-0.0.2.tar.gz |
|---|---|
| Size | 2.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6a52f68dddea4261b019f7f7b3599381baa8d1cb1a82f164b3ffcdf0be0a306
|
|
BLAKE2b-256 checksum How to use checksums |
e0deb73f3cbe7936fd4eb9c041c84c9e1add72e132d5abb4bfb9dd8b8c2ba7bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
|
Release files / auto_self_params-0.0.2-py3-none-any.whl
| Download URL | auto_self_params-0.0.2-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
28f77a1cb5b505123dcd45bb4a429921646a27b1358e581bbe9bdbe01e0fbfb2
|
|
BLAKE2b-256 checksum How to use checksums |
d557dfc61eb1167b2e1d4f513715652263e6ebf0650b29fa09c0af34d9e9775e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2
|
Security for auto-self-params 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.