ajar.attack.Attack#

class ajar.attack.Attack(attacker: str, attacked: str)[source]#

Bases: object

An attack between two arguments, represented as a tuple of names (strings).

Attacks are implemented as dataclasses, instead of tuples, to avoid ambiguity. It is thus recommended to access the attacker and attacked fields by their name.

__init__(attacker: str, attacked: str) None#

Methods

__init__(attacker, attacked)

short_str()

Return a short textual representation of an Attack.

Attributes

attacker

The name of the attacker Argument.

attacked

The name of the attacked Argument.

attacked: str#

The name of the attacked Argument.

attacker: str#

The name of the attacker Argument.

short_str() str[source]#

Return a short textual representation of an Attack.

This short representation follows the format attacker -> attacked, which is shorter than the traditional dataclass (Attack(attacker=..., attacked=...)).