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.1.tar.gz
(3.0 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.1.tar.gz.
File metadata
- Download URL: python_nameof-1.1.1.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a15a34497b2ebae9c477680d01281b6c3f20a91245c988feae621dbc939500b8
|
|
| MD5 |
70d5da2ce531c85de27b6d335c54bca4
|
|
| BLAKE2b-256 |
0c1a2fa3f616733b4c1fbadb5ff0ea5645d72d53d536591b289de3239c7b4795
|
File details
Details for the file python_nameof-1.1.1-py3-none-any.whl.
File metadata
- Download URL: python_nameof-1.1.1-py3-none-any.whl
- Upload date:
- Size: 3.1 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 |
e621b41a96c90f88b5ee9b1d336def83cf361de892a89fcc2bcc3d89485ea72d
|
|
| MD5 |
e3a2756920aec6704e79955783103b3e
|
|
| BLAKE2b-256 |
bff6cf0b256c667870ac0e48eaf75705522b3e166d23c3e1859fcf220f6d8b50
|