File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -598,7 +598,9 @@ async def get_or_fetch(
598598 default : Any = MISSING ,
599599 attr : str = MISSING ,
600600 id : int = MISSING ,
601- ) -> _FETCHABLE | None : # TODO: Remove in 3.0 the arguments attr and id
601+ ) -> (
602+ _FETCHABLE | None
603+ ): # TODO: Remove in 3.0 the arguments attr and id + remove the = MISSING for both object_type and object_id
602604 """
603605 Shortcut method to get data from an object either by returning the cached version, or if it does not exist, attempting to fetch it from the API.
604606
@@ -644,12 +646,13 @@ async def get_or_fetch(
644646 "appemoji" : AppEmoji ,
645647 "role" : Role ,
646648 }
647-
649+ # backward support for attr and id, this whole if block should be removed in v3
648650 if attr is not MISSING or id is not MISSING or isinstance (object_type , str ):
649651 warn_deprecated (
650652 name = "get_or_fetch(obj, attr='type', id=...)" ,
651653 instead = "get_or_fetch(obj, object_type=Type, object_id=...)" ,
652654 since = "2.7" ,
655+ removed = "3.0" ,
653656 )
654657
655658 deprecated_attr = attr if attr is not MISSING else object_type
You can’t perform that action at this time.
0 commit comments