Skip to content

Commit

Permalink
Modify get_attr
Browse files Browse the repository at this point in the history
  • Loading branch information
tekulvw committed Feb 26, 2018
1 parent 896007e commit e1420f1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions redbot/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,11 @@ def is_value(self, item: str) -> bool:

return not isinstance(default, dict)

def get_attr(self, item: str, default=None):
def get_attr(self, item: str):
"""Manually get an attribute of this Group.
This is available to use as an alternative to using normal Python
attribute access. It is required if you find a need for dynamic
attribute access. It may be required if you find a need for dynamic
attribute access.
Example
Expand All @@ -289,17 +289,14 @@ async def some_command(self, ctx, item: str):
----------
item : str
The name of the data field in `Config`.
default
This is an optional override to the registered default for this
item.
Returns
-------
`Value` or `Group`
The attribute which was requested.
"""
return getattr(self, item)
return self.__getattr__(item)

async def get_raw(self, *nested_path: str, default=...):
"""
Expand Down

0 comments on commit e1420f1

Please sign in to comment.