A Python implementation of the C# nameof operator.
Project description
Python implementation of the C# nameof operator
python-nameof
A Python utility that mimics the C# nameof operator, allowing you to get variable or attribute names as strings.
Installation
pip install python-nameof
Usage
from nameof import nameof
foo = 123
print(nameof(foo)) # Output: 'foo'
class Bar:
attr = 99
bar = Bar()
print(nameof("bar.attr")) # Output: 'attr'
License
MIT
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
python_nameof-1.1.0.tar.gz
(3.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_nameof-1.1.0.tar.gz.
File metadata
- Download URL: python_nameof-1.1.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32ddabfc5ca3da02cc020a09de9533e6a4cbe75046236fa089d5a6511531b651
|
|
| MD5 |
7f446c90cda142095171e63ba58cfd4a
|
|
| BLAKE2b-256 |
fb911edaa66c9e443efd1f4bbb3def055d28f5a2ccf63c045c7b801442a1b02a
|
File details
Details for the file python_nameof-1.1.0-py3-none-any.whl.
File metadata
- Download URL: python_nameof-1.1.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
742b3af7d8f430f709b12cb776c5701f408e9a131b257c5ad03617ccba780f18
|
|
| MD5 |
bfb026adb0d5dcf962edff085cca1e74
|
|
| BLAKE2b-256 |
bf6b33f2fa0f8c0187f04ea518bd31c8e5a0f25b754533cd9b51a8bc8f82de6a
|