Skip to content

Commit

Permalink
MAINT: Add deprecate_with_replacement to StreamObject.initializeFromD… (
Browse files Browse the repository at this point in the history
py-pdf#2728)

* MAINT: Add deprecate_with_replacement to StreamObject.initializeFromDictionary
  • Loading branch information
j-t-1 authored Jun 27, 2024
1 parent 15e3a5d commit f893a6b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pypdf/generic/_data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -903,10 +903,13 @@ def write_to_stream(
stream.write(b"\nendstream")

@staticmethod
def initializeFromDictionary( # TODO: mention when to deprecate
def initializeFromDictionary(
data: Dict[str, Any]
) -> Union["EncodedStreamObject", "DecodedStreamObject"]: # deprecated
return StreamObject.initialize_from_dictionary(data)
) -> Union["EncodedStreamObject", "DecodedStreamObject"]:
deprecate_with_replacement(
"initializeFromDictionary", "initialize_from_dictionary", "5.0.0"
) # pragma: no cover
return StreamObject.initialize_from_dictionary(data) # pragma: no cover

@staticmethod
def initialize_from_dictionary(
Expand Down

0 comments on commit f893a6b

Please sign in to comment.