GuessedString

class mobase.GuessedString
class mobase.GuessedString(value: str, quality: GuessQuality = GuessQuality.USER)

Bases: object

Represents a string that may be set from different places. Each time the value is changed a “quality” is specified to say how probable it is the value is the best choice. Only the best choice should be used in the end but alternatives can be queried. This class also allows a filter to be set. If a “guess” doesn’t pass the filter, it is ignored.

Methods Summary

reset(**kwds)

Helper for @overload to raise when called.

setFilter(filter)

Set the filter for this GuessedString.

update(**kwds)

Helper for @overload to raise when called.

variants()

rtype:

Set[str]

Methods Documentation

reset(**kwds)

Helper for @overload to raise when called.

setFilter(filter)

Set the filter for this GuessedString.

The filter is applied on every update() and can reject the new value altogether or modify it (by returning a new value).

Return type:

None

Parameters:

filter – The new filter.

update(**kwds)

Helper for @overload to raise when called.

variants()
Return type:

Set[str]

Returns:

The list of variants for this GuessedString.