You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ship a py.typed marker (PEP 561) and the Typing :: Typed classifier so
downstream projects type check against PRAW's inline annotations; hatchling
bundles the marker into the wheel automatically.
Add a type dependency group with pyright, a [tool.pyright] config, and a tox
type env, and add that env to the tox envlist so the shared CI lint job
enforces zero pyright errors under standard mode. Enable
reportUnnecessaryTypeIgnoreComment to keep ignores from going stale.
Most fixes declare host-provided attributes on the various mixins, add Optional
narrowing, correct return/argument annotations, and add @overload where a
return type depends on argument values (e.g. DraftHelper.__call__). Notable
changes:
- Config: declare its dynamically-populated attributes (client_id, oauth_url,
ratelimit_seconds, etc.) and widen **settings; drop the redundant None
pre-init.
- FullnameMixin._kind and LiveUpdate._kind are now properties so the property
overrides in Comment/Submission/Message/Redditor/Subreddit are compatible.
- ThingModerationMixin.thing is declared so pyright can resolve self.thing
access within the mixin.
- MoreComments, InlineMedia, and similar classes declare attributes set
elsewhere in the object model.
A handful of targeted # pyright: ignore comments remain where the root cause is
prawcore's session() authorizer annotation (it accepts any BaseAuthorizer).
For read-only authorizations this should return ``{"*"}``.
80
86
81
87
"""
88
+
assertself._reddit._coreisnotNone
82
89
authorizer=self._reddit._core._authorizer
90
+
assertauthorizerisnotNone
83
91
ifnotauthorizer.is_valid():
84
-
authorizer.refresh()
92
+
authorizer.refresh() # pyright: ignore[reportAttributeAccessIssue] # refresh is defined on Authorizer subclasses; the active core authorizer is always refreshable here
0 commit comments