============
chibi_hybrid
============
.. image:: https://img.shields.io/pypi/v/chibi_hybrid.svg
:target: https://pypi.python.org/pypi/chibi_hybrid
.. image:: https://img.shields.io/travis/dem4ply/chibi_hybrid.svg
:target: https://travis-ci.org/dem4ply/chibi_hybrid
.. image:: https://readthedocs.org/projects/chibi-hybrid/badge/?version=latest
:target: https://chibi-hybrid.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
simple class for have hybrid class and instance methods
and add class properties
* Free software: WTFPL
* Documentation: https://chibi-hybrid.readthedocs.io.
Features
--------
.. code-block:: python
from chibi_hybrid.chibi_hybrid import Chibi_hybrid, Class_property
class Dump:
__bar = ''
def __init__( self, value ):
self.value = value
@Chibi_hybrid
def foo( cls ):
return cls( 'cls' )
@foo.instancemethod
def foo( self ):
return self.value
@Class_property
def bar( cls ):
return cls.__bar
@bar.setter
def bar( cls, value ):
cls.__bar = value
result = Dump.foo()
assert result == Dump
assert 'cls' == result.value
assert 'cls' == result.foo()
result = Dump( 'cosa' ).foo()
assert 'cosa' == result
assert Dump.bar == ''
Dump.bar = "cosa 2"
assert Dump.bar == 'cosa 2'
=======
History
=======
0.0.1 (2019-10-31)
------------------
* First release on PyPI.
Raw data
{
"_id": null,
"home_page": "https://github.com/dem4ply/chibi_hybrid",
"name": "chibi-hybrid",
"maintainer": null,
"docs_url": null,
"requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7",
"maintainer_email": null,
"keywords": "chibi_hybrid",
"author": "Dem4ply",
"author_email": "dem4ply@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/01/c4/8e0f531acc73c33fffc6cb8b831332c3ffaabd99450211992347624c63de/chibi_hybrid-1.2.1.tar.gz",
"platform": null,
"description": "============\nchibi_hybrid\n============\n\n\n.. image:: https://img.shields.io/pypi/v/chibi_hybrid.svg\n :target: https://pypi.python.org/pypi/chibi_hybrid\n\n.. image:: https://img.shields.io/travis/dem4ply/chibi_hybrid.svg\n :target: https://travis-ci.org/dem4ply/chibi_hybrid\n\n.. image:: https://readthedocs.org/projects/chibi-hybrid/badge/?version=latest\n :target: https://chibi-hybrid.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n\n\n\nsimple class for have hybrid class and instance methods\nand add class properties\n\n\n* Free software: WTFPL\n* Documentation: https://chibi-hybrid.readthedocs.io.\n\n\nFeatures\n--------\n\n\n.. code-block:: python\n\n\tfrom chibi_hybrid.chibi_hybrid import Chibi_hybrid, Class_property\n\n\n\tclass Dump:\n\t\t__bar = ''\n\n\t\tdef __init__( self, value ):\n\t\t\tself.value = value\n\n\t\t@Chibi_hybrid\n\t\tdef foo( cls ):\n\t\t\treturn cls( 'cls' )\n\n\t\t@foo.instancemethod\n\t\tdef foo( self ):\n\t\t\treturn self.value\n\n\t\t@Class_property\n\t\tdef bar( cls ):\n\t\t\treturn cls.__bar\n\n\t\t@bar.setter\n\t\tdef bar( cls, value ):\n\t\t\tcls.__bar = value\n\n\tresult = Dump.foo()\n\tassert result == Dump\n\tassert 'cls' == result.value\n\tassert 'cls' == result.foo()\n\n\tresult = Dump( 'cosa' ).foo()\n\tassert 'cosa' == result\n\n\tassert Dump.bar == ''\n\tDump.bar = \"cosa 2\"\n\tassert Dump.bar == 'cosa 2'\n\n\n=======\nHistory\n=======\n\n0.0.1 (2019-10-31)\n------------------\n\n* First release on PyPI.\n",
"bugtrack_url": null,
"license": null,
"summary": "simple class for have hybrid class and instance methods",
"version": "1.2.1",
"project_urls": {
"Homepage": "https://github.com/dem4ply/chibi_hybrid"
},
"split_keywords": [
"chibi_hybrid"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7f8914cf0f8295e339bb5e5b1909396895d001b2fc5e038d37e893d10c21e342",
"md5": "c1830476c4b16182465bfdfbc9cb8f18",
"sha256": "ebc360b25cc752d4626c6c00c6eec856f107b3c8899a0b7f5c02487818b6d00f"
},
"downloads": -1,
"filename": "chibi_hybrid-1.2.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "c1830476c4b16182465bfdfbc9cb8f18",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7",
"size": 3590,
"upload_time": "2024-10-25T04:04:37",
"upload_time_iso_8601": "2024-10-25T04:04:37.027109Z",
"url": "https://files.pythonhosted.org/packages/7f/89/14cf0f8295e339bb5e5b1909396895d001b2fc5e038d37e893d10c21e342/chibi_hybrid-1.2.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "01c48e0f531acc73c33fffc6cb8b831332c3ffaabd99450211992347624c63de",
"md5": "74c5b6ebd386b7cbe969a2b60632c2be",
"sha256": "9ec3a1c0b3ee0c3b8ab9940b251bd7ae57e8311d463abd4f71dbc6d85e0c2a71"
},
"downloads": -1,
"filename": "chibi_hybrid-1.2.1.tar.gz",
"has_sig": false,
"md5_digest": "74c5b6ebd386b7cbe969a2b60632c2be",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7",
"size": 9188,
"upload_time": "2024-10-25T04:04:38",
"upload_time_iso_8601": "2024-10-25T04:04:38.478585Z",
"url": "https://files.pythonhosted.org/packages/01/c4/8e0f531acc73c33fffc6cb8b831332c3ffaabd99450211992347624c63de/chibi_hybrid-1.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-25 04:04:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dem4ply",
"github_project": "chibi_hybrid",
"travis_ci": false,
"coveralls": true,
"github_actions": false,
"lcname": "chibi-hybrid"
}