Files
typikon/python/typikon/_typikon.pyi
T
funkpower 3e3b585b2a a jurisdiction is not just a key any more
describe() in Python was answering a different fast than the same date on the
command line: xerophagy on a Wednesday of the Great Fast read as wine_oil. Not a
cosmetic difference in a tool whose whole job is to say what may be eaten.

The cause is that Jurisdiction grew a tradition and a discipline, and config
carries all three — main.rs reads the saved jurisdiction, then the saved
tradition, then whether the Typikon's full discipline was asked for, and builds
an overridden Jurisdiction from the lot. The bindings resolved the key and
stopped, so everything the other two decide was silently dropped.

They now take the same three steps, and tradition= and typikon= are arguments, so
the library can say what the command line can. Pascha does not take them: it
follows the paschalion alone and neither can move it.

The overrides are interned rather than leaked per call. main.rs leaks one per run
and exits; a library gets called in a loop, and a leak per call adds up. The
combinations are bounded by jurisdictions x traditions x discipline, so the map
cannot grow past that.

The parity test spread widens to seven dates across both fasts and both
calendars, and clippy now runs under the feature as well — the binding code only
exists there, so a bare clippy run had never looked at it.
2026-09-18 12:33:56 -04:00

84 lines
2.3 KiB
Python

import datetime
from typing import Any, Final
__version__: Final[str]
class Day:
"""One day, fully reckoned. Immutable."""
@property
def date(self) -> datetime.date: ...
@property
def iso(self) -> str: ...
@property
def weekday(self) -> str: ...
@property
def jurisdiction(self) -> str: ...
@property
def calendar(self) -> str: ...
@property
def church_date(self) -> str:
"""The ecclesiastical date, as "25 December"."""
@property
def season(self) -> str | None: ...
@property
def cycle(self) -> str | None: ...
@property
def feast(self) -> str | None: ...
@property
def rank(self) -> str | None: ...
@property
def sign(self) -> str | None:
"""The mark the liturgical books print beside a day of this rank."""
@property
def tradition(self) -> str:
"""Greek or Slavic usage, as this jurisdiction reads the Typikon."""
@property
def title(self) -> str:
"""The feast if there is one, else the principal commemoration."""
@property
def commemorations(self) -> list[str]: ...
@property
def fast(self) -> str: ...
@property
def fast_label(self) -> str: ...
@property
def emoji(self) -> str: ...
@property
def reason(self) -> str: ...
@property
def obligation(self) -> str | None:
"""``"obligatory"``, ``"customary"``, or ``None``."""
@property
def binds(self) -> str: ...
@property
def pascha(self) -> datetime.date: ...
@property
def days_to_pascha(self) -> int: ...
@property
def julian_offset(self) -> int: ...
def is_obligatory(self) -> bool: ...
def to_dict(self) -> dict[str, Any]:
"""The same fields as ``typikon --json``."""
def describe(
date: datetime.date,
jurisdiction: str | None = None,
tradition: str | None = None,
typikon: bool | None = None,
) -> Day: ...
def today(
jurisdiction: str | None = None,
tradition: str | None = None,
typikon: bool | None = None,
) -> Day: ...
def week(
start: datetime.date,
days: int = 7,
jurisdiction: str | None = None,
tradition: str | None = None,
typikon: bool | None = None,
) -> list[Day]: ...
def pascha(year: int, jurisdiction: str | None = None) -> datetime.date: ...
def jurisdictions() -> list[dict[str, str]]: ...