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

Stop caching propnames? #162

Closed
michael-k opened this issue Mar 21, 2021 · 1 comment · Fixed by #203
Closed

Stop caching propnames? #162

michael-k opened this issue Mar 21, 2021 · 1 comment · Fixed by #203

Comments

@michael-k
Copy link
Contributor

I've noticed in troposphere that with self.propnames = props.keys() the object can no longer be pickled.

  • Does AWSObject need to be able to be pickled?

  • Is it even necessary to cache the keys? name in self.props (.keys() is not necessary) should be just as fast as name in self.propnames.

I don't see a reason for caching here.

See b4e4008#diff-7026bda438cf5fffa3496ee838ea9504d1962b37c3e1c573f34b09ebe4b4588cL21-R21

@zdot
Copy link

zdot commented Sep 21, 2021

Our code uses deepcopy to create copies of Troposphere templates (including any awacs statements) that can be safely mutated for various purposes. Removing list() breaks this functionality for us (because of the pickling issue). Is it possible to restore the list call, or else get rid of the cache altogether as @michael-k suggests above?

michael-k added a commit to michael-k/awacs that referenced this issue Sep 22, 2021
markpeek pushed a commit that referenced this issue Sep 27, 2021
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 a pull request may close this issue.

2 participants