nya-scope (import name: nya_scope)
A small, but opinionated helper library for creating named scopes/inline modules Classes marked explicitly as scopes prevent their own intialization with a runtime error
Style Guide (optional)
You are free to adopt it in full, part, or not for your for your project, this is just what I found the most convenient for my projects for visual clarity & separation from other (regular) classes.
- Use
PascalCase(like PEP8 for classes), with a modificiation to append__after every name of classes that inherit fromScope:class ExampleScope__(Scope): # Easy to know at a glance that given identifier is of type `type[Scope]` example_field = 42
- Manually mark all methods as either
@staticmethodor@classmethod:class Outer__(Scope): class Inner__(Scope): value = 42 @classmethod # while there could've been also a mechanism to append those `@classmethod`s or `@staticmethod`s automatically at runtime, this was deemed infeasible due to 1. conflicts with other decorators (namely: order matters), 2. typing; therefore for now until a new solution is found, either @classmethod or @staticmethod is required to be specified manually, unless you don't care about typing. def class_method(here): # noqa: N804 <-- if using ruff, or disable this rule for projects using this package entirely if preferred # name your `cls`, `here` instead, it makes sense in this context print(here.value) @staticmethod def static_method(): print(Outer__.Inner__.value) # Inner__.value does not work
Metadata
Release files for nya-scope 0.3.1
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 | Actions |
|---|---|---|---|---|
| nya_scope-0.3.1.tar.gz | 16.4 kB | Without provenance | Details for nya_scope-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nya_scope-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for nya_scope-0.3.1-py3-none-any.whl |
Total release size: 21.9 kB
Release files / nya_scope-0.3.1.tar.gz
| Download URL | nya_scope-0.3.1.tar.gz |
|---|---|
| Size | 16.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac6b9425cf113382b1e67d52ba157095f21a59a4b2672ff45ae318a84be66f9c
|
|
BLAKE2b-256 checksum How to use checksums |
4f73c21b91da0d458e5c68b7b73515e7351c16b8b152d8e937bea78c74572ca6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / nya_scope-0.3.1-py3-none-any.whl
| Download URL | nya_scope-0.3.1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d9ca19cb923e5e07412ff68136b3d9f91a8a5d8083f3e50bbf6d16df459b329
|
|
BLAKE2b-256 checksum How to use checksums |
a63f342def8f5cb93d9127ea61bdd83e7046fca98bc959dcad28d9d5d26a43d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for nya-scope 0.3.1
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.