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.0.1.tar.gz
(2.9 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.0.1.tar.gz.
File metadata
- Download URL: python_nameof-1.0.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e9e56518f9ae7e7961b2b35581dcf086b05925fb19e6b2847ee567539362e5c
|
|
| MD5 |
cfbe64cecade6d75aa20650e669724b6
|
|
| BLAKE2b-256 |
a99066a79dd500f008264af5a9b1c260b6f69318f63d8802440ac6bdea36ca64
|
File details
Details for the file python_nameof-1.0.1-py3-none-any.whl.
File metadata
- Download URL: python_nameof-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.0 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 |
e1bcc4231a9074374d91f2268770d5edd88c5656b798f18b8bc0b100cc552aaa
|
|
| MD5 |
99a29cc3a816fa38774ab7dbfbc20b25
|
|
| BLAKE2b-256 |
8487c6d1f82e567446d347d4747e4a6322bc4c12f77b665eff5e66fcce7c49cf
|