Skip to content

Refactor use of __framework_name__ in framework classes #1607

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

Closed
metrizable opened this issue Jun 18, 2020 · 0 comments
Closed

Refactor use of __framework_name__ in framework classes #1607

metrizable opened this issue Jun 18, 2020 · 0 comments

Comments

@metrizable
Copy link
Contributor

metrizable commented Jun 18, 2020

Is your feature request related to a problem? Please describe.

The framework classes define a __framework_name__ attribute used in multiple places that may lead to breakage without warning. From the docs:

Any use of __*__ names, in any context, that does not follow explicitly documented use, is subject to breakage without warning.

Describe the solution you'd like

Protected attributes should use, by convention, a single leading underscore, like

class Framework(EstimatorBase):

    _framework_name = None

Describe alternatives you've considered

  • One could forego the leading single underscore, but it lacks the convention of letting code authors know that the attribute is intended to be protected.
  • One could use a leading dunder, but the class-private name may have unintended consequences regarding expectation of the existing use in inheritance and name mangling.

Additional context

n/a

pintaoz-aws pushed a commit that referenced this issue Dec 4, 2024
* Use sagemaker core Session

* update tests with session

* update

* flake8

* update docs

---------

Co-authored-by: Gokul Anantha Narayanan <[email protected]>
pintaoz-aws pushed a commit that referenced this issue Dec 4, 2024
* Use sagemaker core Session

* update tests with session

* update

* flake8

* update docs

---------

Co-authored-by: Gokul Anantha Narayanan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants