Holdings

class authorityspoke.holdings.Holding(rule, rule_valid=True, decided=True, exclusive=False, generic=False)

An Opinion’s announcement that it posits or rejects a legal Rule.

Note that if an opinion merely says the court is not deciding whether a Rule is valid, there is no Holding, and no Rule object should be created. Deciding not to decide a Rule’s validity is not the same thing as deciding that the Rule is undecided.

Parameters
  • rule (Rule) – a statement of a legal doctrine about a Procedure for litigation.

  • rule_valid (bool) – True means the Rule is asserted to be valid (or useable by a court in litigation). False means it’s asserted to be invalid.

  • decided (bool) – False means that it should be deemed undecided whether the Rule is valid, and thus can have the effect of overruling prior holdings finding the Rule to be either valid or invalid. Seemingly, decided=False should render the rule_valid flag irrelevant.

  • exclusive (bool) – if True, the stated rule is asserted to be the only way to establish the output that is the output of the rule.

  • generic (bool) – if True, indicates that the specific attributes of this holding are irrelevant in the context of a different holding that is referencing this holding.

property context_factors

Call Procedure’s context_factors() method.

Return type

Tuple

Returns

context_factors from self’s Procedure

property generic_factors

Get Factors that can be replaced without changing selfs meaning.

Return type

List[Factor]

Returns

generic Factors from self’s Procedure

explanations_contradiction(other, context=None)

Find context matches that would result in a contradiction with other.

Parameters

other (Factor) – The Factor to be compared to self. Unlike with contradicts(), this method cannot be called with an Opinion for other.

Return type

Iterator[Explanation]

Returns

a generator yielding ContextRegisters that cause a contradiction.

contradicts(other, context=None)

Test if self implies() other negated().

Works by testing whether self would imply other if other had an opposite value for rule_valid.

This method takes three main paths depending on whether the holdings self and other assert that rules are decided or undecided.

A decided Rule can never contradict a previous statement that any Rule was undecided.

If rule A implies rule B, then a holding that B is undecided contradicts a prior Rule deciding that rule A is valid or invalid.

Return type

bool

Returns

whether self contradicts other.

implies(other, context=None)

Test for implication.

See Procedure.implies_all_to_all() and Procedure.implies_all_to_some() for explanations of how inputs, outputs, and despite Factors affect implication.

Parameters

other (Factor) – A Holding to compare to self, or a Rule to convert into such a Holding and then compare

Return type

bool

Returns

whether self implies other

explanations_implication(other, context=None)

Generate ContextRegisters that cause self to imply other.

If self is absent, then generate a ContextRegister from other’s point of view and then swap the keys and values.

Return type

Iterator[Explanation]

implied_by(other, context=None)

Test if other implies self.

This function is for handling implication checks for classes that don’t know the structure of the Holding class, such as Fact and Rule.

Return type

bool

__ge__(other)

Call implies() as an alias.

Return type

bool

Returns

bool indicating whether self implies other

__len__()

Count generic Factors needed as context for this Holding.

Returns

the number of generic Factors needed for self’s Procedure.

property inferred_from_exclusive

Yield Holdings that can be inferred from the “exclusive” flag.

The generator will be empty if self.exclusive is False.

Return type

List[Holding]

evolve(changes)

Make new object with attributes from self.__dict__, replacing attributes as specified.

Parameters

changes (Union[str, Tuple[str, …], Dict[str, Any]]) – a dict where the keys are names of attributes of self, and the values are new values for those attributes, or else an attribute name or list of names that need to have their values replaced with their boolean opposite.

Return type

Holding

Returns

a new object initialized with attributes from self.__dict__, except that any attributes named as keys in the changes parameter are replaced by the corresponding value.

explanations_same_meaning(other, context=None)

Generate ways to match contexts of self and other so they mean the same.

Return type

Iterator[ContextRegister]

means(other, context=None)

Test whether other has the same meaning as self.

Return type

bool

Returns

whether other is a Holding with the same meaning as self.

negated()

Get new copy of self with an opposite value for rule_valid.

new_context(changes)

Create new Holding, replacing keys of changes with values.

Return type

Factor

Returns

a version of self with the new context.

property nonexclusive_holdings

Yield all Holdings with exclusive is False implied by self.

Return type

List[Holding]

own_attributes()

Return attributes of self that aren’t inherited from another class.

Used for getting parameters to pass to __init__() when generating a new object.

Return type

Dict[str, Any]

__str__()

Return str(self).