Skip to content

Error in numexpr.validate documentation #573

Open

Description

@gtsintzas

Hi there,

The NumExpr User Guide mentions:

It is also possible to use NumExpr to validate an expression:
ne.validate('2*a + 3*b')
which returns None on success or raises an exception on invalid inputs.

However after using the function, I realised this isn't true. For example, this snippet does not raise an exception.

import numexpr as ne

try:
    ne.validate("Invalid input!!!")
except:
    print("Exception")
    exit()

print("No exception...")

After digging a bit deeper in the numexpr.validate() source code, I realised that the exception object is being returned, and not raised. I'm not sure if that is an issue or not, but I thought the documentation wording was a bit misleading, so I thought to make an issue of this.

Sorry if it doesn't apply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

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