Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V3 Config] Adjust functionality of get_attr #1342

Merged
merged 6 commits into from
Feb 26, 2018

Conversation

tekulvw
Copy link
Member

@tekulvw tekulvw commented Feb 24, 2018

This is a BREAKING CHANGE

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

For a bit of background: get_attr has a resolve kwarg which changes how the method acts. If resolve is true, get_attr will return a coroutine which, when awaited, returns the actual saved value of that attribute. If resolve is false, get_attr returns the next nested group object

As an example:

conf.get_attr('test', resolve=False)
# is equivalent to
conf.test

And:

await conf.get_attr('test', resolve=True)
# is equivalent to
await conf.test()

And:

await conf.get_attr('test', resolve=True)
# is equivalent to
await conf.get_raw('test')

This PR permanently removes the resolve kwarg from get_attr and keeps the functionality that occurs when resolve=False is passed currently.

set_attr was also removed.

This change was brought on by it's replacement by set_raw.

@tekulvw tekulvw force-pushed the V3/config_breakgetattr branch from d9c3b79 to e1420f1 Compare February 26, 2018 14:05
@palmtree5 palmtree5 merged commit 64af780 into Cog-Creators:V3/develop Feb 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking Change Will potentially break some cogs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants