Skip to content

Naming Convention Violations in OpenCV Python Bindings #1079

Open
@gabemorris12

Description

Naming conventions are important for readability, and as the title implies, this package does not comply with the PEP 8 naming conventions. As a result, the code can be harder to read, maintain, and integrate with other Python projects that follow standard conventions, leading to inconsistencies, increased learning curves for new developers, and potential for misinterpretation or errors.

A practical solution would be to introduce name aliases to allow backwards compatibility, but also give the choice to pursue the style of modern projects. Another option would be to do something like the threading module does:

def current_thread():
    """Return the current Thread object, corresponding to the caller's thread of control.

    If the caller's thread of control was not created through the threading
    module, a dummy thread object with limited functionality is returned.

    """
    try:
        return _active[get_ident()]
    except KeyError:
        return _DummyThread()

def currentThread():
    """Return the current Thread object, corresponding to the caller's thread of control.

    This function is deprecated, use current_thread() instead.

    """
    import warnings
    warnings.warn('currentThread() is deprecated, use current_thread() instead',
                  DeprecationWarning, stacklevel=2)
    return current_thread()

Are there any thoughts on addressing this issue?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions