mirror of
https://github.com/kennethreitz/replit-py.git
synced 2026-06-05 23:10:18 +00:00
Rename key() as it conflicts with key variable; fix docsting
This commit is contained in:
@@ -447,13 +447,16 @@ class JSONKey(AsyncJSONKey):
|
||||
)
|
||||
return self.get()[name]
|
||||
|
||||
def key(self, name: str, default: Any = None) -> Any:
|
||||
def read(self, name: str, default: Any = None) -> Any:
|
||||
"""Shorthand for self.get().get(name, default) if datatype is dict.
|
||||
|
||||
Args:
|
||||
name (str): The name to get.
|
||||
default (Any): The default if the key doesn't exist. Defaults to None.
|
||||
|
||||
Raises:
|
||||
TypeError: The datatype is not dict.
|
||||
|
||||
Returns:
|
||||
Any: The value read or the default.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user