Name | gqylpy-exception JSON |
Version |
3.0.1
JSON |
| download |
home_page | http://gqylpy.com |
Summary | Raise exceptions while creating exception classes on the fly, without the need to predefine them beforehand. |
upload_time | 2024-05-13 01:21:55 |
maintainer | None |
docs_url | None |
author | 竹永康 |
requires_python | >=3.8 |
license | Apache 2.0 |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[<img alt="LOGO" src="http://gqylpy.com/static/img/favicon.ico" height="21" width="21"/>](http://www.gqylpy.com)
[![Release](https://img.shields.io/github/release/gqylpy/gqylpy-exception.svg?style=flat-square")](https://github.com/gqylpy/gqylpy-exception/releases/latest)
[![Python Versions](https://img.shields.io/pypi/pyversions/gqylpy_exception)](https://pypi.org/project/gqylpy_exception)
[![License](https://img.shields.io/pypi/l/gqylpy_exception)](https://github.com/gqylpy/gqylpy-exception/blob/master/LICENSE)
[![Downloads](https://static.pepy.tech/badge/gqylpy_exception)](https://pepy.tech/project/gqylpy_exception)
# gqylpy-exception
English | [中文](https://github.com/gqylpy/gqylpy-exception/blob/master/README_CN.md)
Raise exceptions while creating exception classes on the fly, without the need to predefine them beforehand. For instance, if you want to raise an exception named `NotUnderstandError`, simply import `import gqylpy_exception as ge` and execute `raise ge.NotUnderstandError` directly for convenience and efficiency.
<kbd>pip3 install gqylpy_exception</kbd>
###### Using `gqylpy_exception` to Create Exception Classes
```python
import gqylpy_exception as ge
raise ge.AnError(...)
```
With `gqylpy_exception`, you can create exception classes with arbitrary names. `AnError` is not predefined in `gqylpy_exception`; it is dynamically created when your code executes `ge.` due to the magic method `__getattr__`.
Alternatively, you can also create exceptions upon import:
```python
from gqylpy_exception import AnError
raise AnError(...)
```
Lastly, `gqylpy_exception` avoids duplicate creation of exception classes. Once an exception class has been created, it is stored in the `ge.__history__` dictionary. When you attempt to create the same exception again, it will be retrieved from this dictionary.
Raw data
{
"_id": null,
"home_page": "http://gqylpy.com",
"name": "gqylpy-exception",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "\u7af9\u6c38\u5eb7",
"author_email": "<gqylpy@outlook.com>",
"download_url": "https://files.pythonhosted.org/packages/7e/72/b223229b95113cb254b52565d802df6368d5ceb22fc7b0dc17e4b14e87b6/gqylpy_exception-3.0.1.tar.gz",
"platform": null,
"description": "[<img alt=\"LOGO\" src=\"http://gqylpy.com/static/img/favicon.ico\" height=\"21\" width=\"21\"/>](http://www.gqylpy.com)\n[![Release](https://img.shields.io/github/release/gqylpy/gqylpy-exception.svg?style=flat-square\")](https://github.com/gqylpy/gqylpy-exception/releases/latest)\n[![Python Versions](https://img.shields.io/pypi/pyversions/gqylpy_exception)](https://pypi.org/project/gqylpy_exception)\n[![License](https://img.shields.io/pypi/l/gqylpy_exception)](https://github.com/gqylpy/gqylpy-exception/blob/master/LICENSE)\n[![Downloads](https://static.pepy.tech/badge/gqylpy_exception)](https://pepy.tech/project/gqylpy_exception)\n\n# gqylpy-exception\nEnglish | [\u4e2d\u6587](https://github.com/gqylpy/gqylpy-exception/blob/master/README_CN.md)\n\nRaise exceptions while creating exception classes on the fly, without the need to predefine them beforehand. For instance, if you want to raise an exception named `NotUnderstandError`, simply import `import gqylpy_exception as ge` and execute `raise ge.NotUnderstandError` directly for convenience and efficiency.\n\n<kbd>pip3 install gqylpy_exception</kbd>\n\n###### Using `gqylpy_exception` to Create Exception Classes\n\n```python\nimport gqylpy_exception as ge\n\nraise ge.AnError(...)\n```\n\nWith `gqylpy_exception`, you can create exception classes with arbitrary names. `AnError` is not predefined in `gqylpy_exception`; it is dynamically created when your code executes `ge.` due to the magic method `__getattr__`.\n\nAlternatively, you can also create exceptions upon import:\n\n```python\nfrom gqylpy_exception import AnError\n\nraise AnError(...)\n```\n\nLastly, `gqylpy_exception` avoids duplicate creation of exception classes. Once an exception class has been created, it is stored in the `ge.__history__` dictionary. When you attempt to create the same exception again, it will be retrieved from this dictionary.\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "Raise exceptions while creating exception classes on the fly, without the need to predefine them beforehand.",
"version": "3.0.1",
"project_urls": {
"Homepage": "http://gqylpy.com",
"Source": "https://github.com/gqylpy/gqylpy-exception"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "00dd6b75e9e4b739a550c45e96e8a5db01f66e0bc5519385cefb8b801cdfaa4b",
"md5": "e095148c5dcb801defdc4fcc95b81c3f",
"sha256": "3c52cbd6b41b4e2470d3a6e97aab38e6c820bf17d9f44c83b50e3e101447c788"
},
"downloads": -1,
"filename": "gqylpy_exception-3.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e095148c5dcb801defdc4fcc95b81c3f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 12501,
"upload_time": "2024-05-13T01:21:53",
"upload_time_iso_8601": "2024-05-13T01:21:53.861503Z",
"url": "https://files.pythonhosted.org/packages/00/dd/6b75e9e4b739a550c45e96e8a5db01f66e0bc5519385cefb8b801cdfaa4b/gqylpy_exception-3.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7e72b223229b95113cb254b52565d802df6368d5ceb22fc7b0dc17e4b14e87b6",
"md5": "2b78453f36f61ff95a142a357a5918e0",
"sha256": "a4ec777454dc547af0b44ed2c1b45674510f1868c7dc848919a1ef1592edc7da"
},
"downloads": -1,
"filename": "gqylpy_exception-3.0.1.tar.gz",
"has_sig": false,
"md5_digest": "2b78453f36f61ff95a142a357a5918e0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 11303,
"upload_time": "2024-05-13T01:21:55",
"upload_time_iso_8601": "2024-05-13T01:21:55.514126Z",
"url": "https://files.pythonhosted.org/packages/7e/72/b223229b95113cb254b52565d802df6368d5ceb22fc7b0dc17e4b14e87b6/gqylpy_exception-3.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-13 01:21:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gqylpy",
"github_project": "gqylpy-exception",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "gqylpy-exception"
}