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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

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