Skip to content

Allow inclusive/exclusive to be specified on Float property #273

@fwkoch

Description

@fwkoch

Currently, properties.Float('', min=0.) is inclusive of 0, and this cannot be changed at the property level. We could add min_inclusive/max_inclusive boolean attributes, to make this possible.

Alternatively, this could just be done at the validator level, i.e.

class HasFloat(properties.HasProperties):

    my_float = properties.Float('Exclusive minimum float', min=0.)

    @properties.validator('my_float')
    def _validate_min_exclusive(self, change):
        if change['value'] == 0:
            raise properties.ValidationError(...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions