Skip to content

Difficult to debug strings in intervals #8

Description

@dbgoodman

Currently it's very difficult to tell if a user accidentally passed in strings to pyinterval.closedopen. For instance, in the case of:

bad_interval =  pyinterval.closedopen('100','200')

The repr() and str() modules don't show the quotes around the values, so it looks like you passed in integers. The only way to tell is by using

bad_interval._data._lower_value
bad_interval._data._upper_value

I understand you want the module to be type-agnostic, which is admirable, but making repr() look like:

['100','200')

instead of:

[100,200)

might make it easier to debug problems.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions