Skip to main content

Get operator information.

Project description

Operator Information Library

The library to get information about various operators in Python.

Install through pip:

pip install o

Start off my importing the module:

import o

Use the get method to get the Operator object for a specific operator, provided as a string.

operator = o.get("+=")
print(operator)
>>> "<class 'Operator(operator='+=', name='addition assignment', type=AssignmentOperatorType, methods=['__iadd__'], function=operator.iadd)'>"

Use the various attributes to retrieve information for the operator.

operator.methods
>>> ['__iadd__']

str(operator.type)
>>> "assignment"

isinstance(operator.type, o.AssignmentOperatorType)
>>> True

Or, you can use the Operator object directly. Be careful, an unknown operator raises an UnknownOperator exception.

License

This repo is under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

o-0.0.2b2.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

o-0.0.2b2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file o-0.0.2b2.tar.gz.

File metadata

  • Download URL: o-0.0.2b2.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5

File hashes

Hashes for o-0.0.2b2.tar.gz
Algorithm Hash digest
SHA256 77b1667be6da65a64420ee07ac937ace3de94bdd2eb75febc874ac71e2a92787
MD5 c81210c56ce509aa630da8c211db1370
BLAKE2b-256 a6d7a9da7b25d570cabd5edba7801b2ecaf65bdc9662cea1a0870375286c3e57

See more details on using hashes here.

File details

Details for the file o-0.0.2b2-py3-none-any.whl.

File metadata

  • Download URL: o-0.0.2b2-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5

File hashes

Hashes for o-0.0.2b2-py3-none-any.whl
Algorithm Hash digest
SHA256 b16252420d2526feb9b00af8de7e6baa7488f71e5a5b9661efb28440bac39168
MD5 b370388eab69925ec4b25f02fb337c04
BLAKE2b-256 ae6b0cdb02b84702d931bc1475c5c40ccf346b20ce16fb424eba999ea978e811

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page