Skip to content

Change factory methods to class methods#103

Merged
OrangeTux merged 1 commit into
AdvancedClimateSystems:masterfrom
rgov:rzg/fix_factory_methods
Jul 27, 2020
Merged

Change factory methods to class methods#103
OrangeTux merged 1 commit into
AdvancedClimateSystems:masterfrom
rgov:rzg/fix_factory_methods

Conversation

@rgov

@rgov rgov commented Jul 25, 2020

Copy link
Copy Markdown
Contributor

Instead of declaring the create_from_request_pdu and create_from_response_pdu factory methods as @staticmethod, use @classmethod. Then the class is passed to the method as the cls parameter, which can be used to instantiate an instance, rather than hardcoding the class name.

This allows the function classes to be subclassed without having to reimplement the factory methods just to change the class name.

Also fixes up some comments that were incorrect.

@coveralls

coveralls commented Jul 25, 2020

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 95.824% when pulling ba7c73b on rgov:rzg/fix_factory_methods into 0faaf90 on AdvancedClimateSystems:master.

@OrangeTux OrangeTux merged commit f125365 into AdvancedClimateSystems:master Jul 27, 2020
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.

3 participants