mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
Improve typing deck_due_tree()
(#3003)
* Improve typing `deck_due_tree()` * Add me to CONTRIBUTORS
This commit is contained in:
parent
f4a8f7d9c7
commit
9ba527afa2
2 changed files with 10 additions and 1 deletions
|
@ -160,6 +160,7 @@ Pedro Lameiras <pedrolameiras@tecnico.ulisboa.pt>
|
||||||
Kai Knoblich <kai@FreeBSD.org>
|
Kai Knoblich <kai@FreeBSD.org>
|
||||||
Lucas Scharenbroch <lucasscharenbroch@gmail.com>
|
Lucas Scharenbroch <lucasscharenbroch@gmail.com>
|
||||||
Antonio Cavallo <a.cavallo@cavallinux.eu>
|
Antonio Cavallo <a.cavallo@cavallinux.eu>
|
||||||
|
Han Yeong-woo <han@yeongwoo.dev>
|
||||||
|
|
||||||
********************
|
********************
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ ScheduleCardsAsNewDefaults = scheduler_pb2.ScheduleCardsAsNewDefaultsResponse
|
||||||
FilteredDeckForUpdate = decks_pb2.FilteredDeckForUpdate
|
FilteredDeckForUpdate = decks_pb2.FilteredDeckForUpdate
|
||||||
RepositionDefaults = scheduler_pb2.RepositionDefaultsResponse
|
RepositionDefaults = scheduler_pb2.RepositionDefaultsResponse
|
||||||
|
|
||||||
from typing import Sequence
|
from typing import Sequence, overload
|
||||||
|
|
||||||
from anki import config_pb2
|
from anki import config_pb2
|
||||||
from anki.cards import CardId
|
from anki.cards import CardId
|
||||||
|
@ -65,6 +65,14 @@ class SchedulerBase(DeprecatedNamesMixin):
|
||||||
# Deck list
|
# Deck list
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
|
@overload
|
||||||
|
def deck_due_tree(self, top_deck_id: None = None) -> DeckTreeNode:
|
||||||
|
...
|
||||||
|
|
||||||
|
@overload
|
||||||
|
def deck_due_tree(self, top_deck_id: DeckId) -> DeckTreeNode | None:
|
||||||
|
...
|
||||||
|
|
||||||
def deck_due_tree(self, top_deck_id: DeckId | None = None) -> DeckTreeNode | None:
|
def deck_due_tree(self, top_deck_id: DeckId | None = None) -> DeckTreeNode | None:
|
||||||
"""Returns a tree of decks with counts.
|
"""Returns a tree of decks with counts.
|
||||||
If top_deck_id provided, only the according subtree is returned."""
|
If top_deck_id provided, only the according subtree is returned."""
|
||||||
|
|
Loading…
Reference in a new issue