python
python copied to clipboard
Avoid shadowing important built-ins in the example code
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
NONE
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: rafrafek / name: Rafał (f6c65df10f057066569f09cd4214392f21185645)
Welcome @rafrafek!
It looks like this is your first PR to kubernetes-client/python 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.
You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.
You can also check if kubernetes-client/python has its own contribution guidelines.
You may want to refer to our testing guide if you run into trouble with your tests not passing.
If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!
Thank you, and welcome to Kubernetes. :smiley:
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: rafrafek Once this PR has been reviewed and has the lgtm label, please assign yliaog for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
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:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale
- Close this PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
Bump.
/remove-lifecycle stale