operatorlookup


Nameoperatorlookup JSON
Version 0.10 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/operatorlookup
SummaryAccess intrinsic operators through a lookup dict
upload_time2023-02-07 22:12:24
maintainer
docs_urlNone
authorJohannes Fischer
requires_python
licenseMIT
keywords operator
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
### Access intrinsic operators through a lookup dict



#### More information: https://docs.python.org/3/library/operator.html



```python

from operatorlookup import doops

print('-------------------------')

print(doops("==", 10, 20))

print(doops("+", 10, 20))

print(doops("-", 10, 20))

print('-------------------------')

defli = list(range(10))

print(defli)

_ = [(doops("=", defli, x, x * 10)) for x in range(10)]

print(defli)

print('-------------------------')

defli = list(range(10))

print(defli)

_ = [(doops("del", defli, 0)) for x in range(10) if x > 5]

print(defli)

print('-------------------------')

defli = {}

print(defli)

_ = [(doops("=", defli, x,x*100)) for x in range(10) if x > 5]

print(defli)

print('-------------------------')

getitemsresult = [(doops("[]", defli, x)) for x in range(10) if x > 5]

print(getitemsresult)





False

30

-10

-------------------------

[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

[0, 10, 20, 30, 40, 50, 60, 70, 80, 90]

-------------------------

[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

[4, 5, 6, 7, 8, 9]

-------------------------

{}

{6: 600, 7: 700, 8: 800, 9: 900}

-------------------------

[600, 700, 800, 900]



# All operations:

from operatorlookup import opdict

print(opdict)

{'+': <function _operator.add(a, b, /)>,

 'concat': <function _operator.concat(a, b, /)>,

 'in': <function _operator.contains(a, b, /)>,

 '/': <function _operator.truediv(a, b, /)>,

 '//': <function _operator.floordiv(a, b, /)>,

 '&': <function _operator.and_(a, b, /)>,

 '^': <function _operator.xor(a, b, /)>,

 '~': <function _operator.invert(a, /)>,

 '|': <function _operator.or_(a, b, /)>,

 '**': <function _operator.pow(a, b, /)>,

 'is': <function _operator.is_(a, b, /)>,

 'is not': <function _operator.is_not(a, b, /)>,

 '=': <function _operator.setitem(a, b, c, /)>,

 'del': <function _operator.delitem(a, b, /)>,

 '[]': <function _operator.getitem(a, b, /)>,

 '<<': <function _operator.lshift(a, b, /)>,

 '%': <function _operator.mod(a, b, /)>,

 '*': <function _operator.mul(a, b, /)>,

 '@': <function _operator.matmul(a, b, /)>,

 'neg': <function _operator.neg(a, /)>,

 'not': <function _operator.not_(a, /)>,

 'pos': <function _operator.pos(a, /)>,

 '>>': <function _operator.rshift(a, b, /)>,

 '-': <function _operator.sub(a, b, /)>,

 'truth': <function _operator.truth(a, /)>,

 '<': <function _operator.lt(a, b, /)>,

 '<=': <function _operator.le(a, b, /)>,

 '==': <function _operator.eq(a, b, /)>,

 '!=': <function _operator.ne(a, b, /)>,

 '>=': <function _operator.ge(a, b, /)>,

 '>': <function _operator.gt(a, b, /)>,

 '+=': <function _operator.iadd(a, b, /)>,

 '&=': <function _operator.iand(a, b, /)>,

 'iconcat': <function _operator.iconcat(a, b, /)>,

 '//=': <function _operator.ifloordiv(a, b, /)>,

 '<<=': <function _operator.ilshift(a, b, /)>,

 '%=': <function _operator.imod(a, b, /)>,

 '*=': <function _operator.imul(a, b, /)>,

 '@=': <function _operator.imatmul(a, b, /)>,

 '|=': <function _operator.ior(a, b, /)>,

 '**=': <function _operator.ipow(a, b, /)>,

 '>>=': <function _operator.irshift(a, b, /)>,

 '-=': <function _operator.isub(a, b, /)>,

 '/=': <function _operator.itruediv(a, b, /)>,

 '^=': <function _operator.ixor(a, b, /)>}

```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/operatorlookup",
    "name": "operatorlookup",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "operator",
    "author": "Johannes Fischer",
    "author_email": "<aulasparticularesdealemaosp@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/3a/59/671e7dff9ef1d0817a1f5c9ef49bf15bddaa25361b48fdd946e4a39f023a/operatorlookup-0.10.tar.gz",
    "platform": null,
    "description": "\n### Access intrinsic operators through a lookup dict\n\n\n\n#### More information: https://docs.python.org/3/library/operator.html\n\n\n\n```python\n\nfrom operatorlookup import doops\n\nprint('-------------------------')\n\nprint(doops(\"==\", 10, 20))\n\nprint(doops(\"+\", 10, 20))\n\nprint(doops(\"-\", 10, 20))\n\nprint('-------------------------')\n\ndefli = list(range(10))\n\nprint(defli)\n\n_ = [(doops(\"=\", defli, x, x * 10)) for x in range(10)]\n\nprint(defli)\n\nprint('-------------------------')\n\ndefli = list(range(10))\n\nprint(defli)\n\n_ = [(doops(\"del\", defli, 0)) for x in range(10) if x > 5]\n\nprint(defli)\n\nprint('-------------------------')\n\ndefli = {}\n\nprint(defli)\n\n_ = [(doops(\"=\", defli, x,x*100)) for x in range(10) if x > 5]\n\nprint(defli)\n\nprint('-------------------------')\n\ngetitemsresult = [(doops(\"[]\", defli, x)) for x in range(10) if x > 5]\n\nprint(getitemsresult)\n\n\n\n\n\nFalse\n\n30\n\n-10\n\n-------------------------\n\n[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n\n[0, 10, 20, 30, 40, 50, 60, 70, 80, 90]\n\n-------------------------\n\n[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n\n[4, 5, 6, 7, 8, 9]\n\n-------------------------\n\n{}\n\n{6: 600, 7: 700, 8: 800, 9: 900}\n\n-------------------------\n\n[600, 700, 800, 900]\n\n\n\n# All operations:\n\nfrom operatorlookup import opdict\n\nprint(opdict)\n\n{'+': <function _operator.add(a, b, /)>,\n\n 'concat': <function _operator.concat(a, b, /)>,\n\n 'in': <function _operator.contains(a, b, /)>,\n\n '/': <function _operator.truediv(a, b, /)>,\n\n '//': <function _operator.floordiv(a, b, /)>,\n\n '&': <function _operator.and_(a, b, /)>,\n\n '^': <function _operator.xor(a, b, /)>,\n\n '~': <function _operator.invert(a, /)>,\n\n '|': <function _operator.or_(a, b, /)>,\n\n '**': <function _operator.pow(a, b, /)>,\n\n 'is': <function _operator.is_(a, b, /)>,\n\n 'is not': <function _operator.is_not(a, b, /)>,\n\n '=': <function _operator.setitem(a, b, c, /)>,\n\n 'del': <function _operator.delitem(a, b, /)>,\n\n '[]': <function _operator.getitem(a, b, /)>,\n\n '<<': <function _operator.lshift(a, b, /)>,\n\n '%': <function _operator.mod(a, b, /)>,\n\n '*': <function _operator.mul(a, b, /)>,\n\n '@': <function _operator.matmul(a, b, /)>,\n\n 'neg': <function _operator.neg(a, /)>,\n\n 'not': <function _operator.not_(a, /)>,\n\n 'pos': <function _operator.pos(a, /)>,\n\n '>>': <function _operator.rshift(a, b, /)>,\n\n '-': <function _operator.sub(a, b, /)>,\n\n 'truth': <function _operator.truth(a, /)>,\n\n '<': <function _operator.lt(a, b, /)>,\n\n '<=': <function _operator.le(a, b, /)>,\n\n '==': <function _operator.eq(a, b, /)>,\n\n '!=': <function _operator.ne(a, b, /)>,\n\n '>=': <function _operator.ge(a, b, /)>,\n\n '>': <function _operator.gt(a, b, /)>,\n\n '+=': <function _operator.iadd(a, b, /)>,\n\n '&=': <function _operator.iand(a, b, /)>,\n\n 'iconcat': <function _operator.iconcat(a, b, /)>,\n\n '//=': <function _operator.ifloordiv(a, b, /)>,\n\n '<<=': <function _operator.ilshift(a, b, /)>,\n\n '%=': <function _operator.imod(a, b, /)>,\n\n '*=': <function _operator.imul(a, b, /)>,\n\n '@=': <function _operator.imatmul(a, b, /)>,\n\n '|=': <function _operator.ior(a, b, /)>,\n\n '**=': <function _operator.ipow(a, b, /)>,\n\n '>>=': <function _operator.irshift(a, b, /)>,\n\n '-=': <function _operator.isub(a, b, /)>,\n\n '/=': <function _operator.itruediv(a, b, /)>,\n\n '^=': <function _operator.ixor(a, b, /)>}\n\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Access intrinsic operators through a lookup dict",
    "version": "0.10",
    "split_keywords": [
        "operator"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c8304fe95174ee0e76c6613978cde9d8b67669a6ebe1176cc18054f7c84f8e1b",
                "md5": "da706a078f569aa213df4b8e09dbb935",
                "sha256": "00eacd8e8d3e7d14dbb1b196764a6ed55b20e04e769ffec7c80309012fa52e6a"
            },
            "downloads": -1,
            "filename": "operatorlookup-0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "da706a078f569aa213df4b8e09dbb935",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5739,
            "upload_time": "2023-02-07T22:12:23",
            "upload_time_iso_8601": "2023-02-07T22:12:23.024720Z",
            "url": "https://files.pythonhosted.org/packages/c8/30/4fe95174ee0e76c6613978cde9d8b67669a6ebe1176cc18054f7c84f8e1b/operatorlookup-0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3a59671e7dff9ef1d0817a1f5c9ef49bf15bddaa25361b48fdd946e4a39f023a",
                "md5": "071b4c2c89dcfefe24dd3374648d70de",
                "sha256": "1f895aa37353f6c8edcf1bd0590f94fc62cb2cd9170235849fc5b5ecbbba1031"
            },
            "downloads": -1,
            "filename": "operatorlookup-0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "071b4c2c89dcfefe24dd3374648d70de",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4309,
            "upload_time": "2023-02-07T22:12:24",
            "upload_time_iso_8601": "2023-02-07T22:12:24.841899Z",
            "url": "https://files.pythonhosted.org/packages/3a/59/671e7dff9ef1d0817a1f5c9ef49bf15bddaa25361b48fdd946e4a39f023a/operatorlookup-0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-07 22:12:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "hansalemaos",
    "github_project": "operatorlookup",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "operatorlookup"
}
        
Elapsed time: 0.22649s