Skip to content

Commit

Permalink
Fix wrong type hints for SyndicationFeed methods
Browse files Browse the repository at this point in the history
- The correct type is actually mentioned in django's documentation in
  docs/ref/contrib/syndication.txt.
- The previously defined type doesn't have methods like
  `addQuickElement`, which are used in Django's implementation of
  `add_root_elements`.
  • Loading branch information
WhyNotHugo committed Sep 12, 2023
1 parent 5f57a42 commit 2ceaec4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions django-stubs/utils/feedgenerator.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
from typing import Any
from xml.sax import ContentHandler
from xml.sax.saxutils import XMLGenerator

from typing_extensions import TypeAlias

Expand Down Expand Up @@ -49,9 +50,13 @@ class SyndicationFeed:
) -> None: ...
def num_items(self) -> int: ...
def root_attributes(self) -> dict[Any, Any]: ...
def add_root_elements(self, handler: ContentHandler) -> None: ...
def add_root_elements(self, handler: XMLGenerator) -> None: ...
def item_attributes(self, item: dict[str, Any]) -> dict[Any, Any]: ...
def add_item_elements(self, handler: ContentHandler, item: dict[str, Any]) -> None: ...
def add_item_elements(
self,
handler: XMLGenerator,
item: dict[str, Any],
) -> None: ...
def write(self, outfile: Any, encoding: Any) -> None: ...
def writeString(self, encoding: str) -> str: ...
def latest_post_date(self) -> datetime.datetime: ...
Expand Down

0 comments on commit 2ceaec4

Please sign in to comment.