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

Switch resource.meta to be an object. #45

Merged
merged 3 commits into from
Dec 19, 2014
Merged

Switch resource.meta to be an object. #45

merged 3 commits into from
Dec 19, 2014

Conversation

danielgtaylor
Copy link
Member

This changes the behavior of the meta object in a backward-incompatible
way. It goes from being a dict to an instance of a ResourceMeta class.
Example:

import boto3

s3 = boto3.resource('s3')

# The old way
s3.meta['service_name']
s3.meta['client']

# The new way
s3.meta.service_name
s3.meta.client

cc @jamesls, @kyleknap

This changes the behavior of the meta object in a **backward-incompatible**
way. It goes from being a dict to an instance of a `ResourceMeta` class.
Example:

```python
import boto3

s3 = boto3.resource('s3')

s3.meta['service_name']
s3.meta['client']

s3.meta.service_name
s3.meta.client
```
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling 9f3f4ec on meta-object into bc866bb on develop.

#: (``string``) The service name, e.g. 's3'
self.service_name = service_name
#: (``list``) List of identifier names
self.identifiers = identifiers or []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think stylistically we should always be using "is not None" if we are comparing against None, which in this scenario we are.

@jamesls
Copy link
Member

jamesls commented Dec 19, 2014

Looks good, just some small questions on the ResourceMeta class itself.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.1%) when pulling c48ecc8 on meta-object into bc866bb on develop.

@jamesls
Copy link
Member

jamesls commented Dec 19, 2014

:shipit:

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) when pulling e31eba1 on meta-object into bc866bb on develop.

danielgtaylor added a commit that referenced this pull request Dec 19, 2014
Switch `resource.meta` to be an object.
@danielgtaylor danielgtaylor merged commit 59136a4 into develop Dec 19, 2014
@danielgtaylor danielgtaylor deleted the meta-object branch December 19, 2014 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants