-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Avoid shadowing important built-ins in the example code #2157
base: master
Are you sure you want to change the base?
Conversation
Welcome @rafrafek! |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rafrafek The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Please sign the CLA |
@roycaihw done! |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Bump. /remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Bump. /remove-lifecycle stale |
Is "cleanup" the best choice? /kind cleanup |
What type of PR is this? cleanup(?)
/kind cleanup
What this PR does / why we need it:
Fixes a lot of potential issues when someone tries to use the code from the example.
Changes in naming:
type
totype_
: The variabletype
is renamed totype_
. In Python, type is a built-in name for a function that returns the type of an object. Usingtype
as a variable name can shadow this built-in function, which could lead to confusion or errors in the code. Renaming it totype_
avoids this potential issue.object
toobject_
: Similarly,object
is a built-in type in Python (for instance,object
is the base class for all classes in Python). Usingobject
as a variable name can also overshadow the built-inobject
type, which can lead to bugs or misunderstandings. Renaming it toobject_
avoids this issue.Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change? NONE
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: