Skip to content

unexpected behaviour in LowPrev set_lower vs. __setitem__ #5

@equaeghe

Description

@equaeghe

Documented, but it still bit me:

>>> ev = lambda event: Event(pspace, event)
>>> print(lprob)
a b     : 1/2
a   c   : 1/2
a     d : 1/2
  b c   : 1/2
  b   d : 1/2
    c d : 1/2
a b c   : 1/2
a b   d : 1/2
a   c d : 1/2
  b c d : 1/2
>>> lprob.set_lower(ev('bc'), 0)
>>> print(lprob)
a b     : 1/2
a   c   : 1/2
a     d : 1/2
  b c   : 1/2
  b   d : 1/2
    c d : 1/2
a b c   : 1/2
a b   d : 1/2
a   c d : 1/2
  b c d : 1/2
>>> lprob[ev('bc'), True] = (0, None)
>>> print(lprob)
a b     : 1/2
a   c   : 1/2
a     d : 1/2
  b c   : 0
  b   d : 1/2
    c d : 1/2
a b c   : 1/2
a b   d : 1/2
a   c d : 1/2
  b c d : 1/2

I don't know whether anything should be done, but I wanted to let you know it may cause confusion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions