Skip to content

Proposal: Rename bool() to to_bool() #32923

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
skasturi opened this issue Mar 23, 2020 · 5 comments
Closed

Proposal: Rename bool() to to_bool() #32923

skasturi opened this issue Mar 23, 2020 · 5 comments
Labels
Deprecate Functionality to remove in pandas Enhancement Needs Discussion Requires discussion from core team before further action Refactor Internal refactoring of code

Comments

@skasturi
Copy link
Contributor

skasturi commented Mar 23, 2020

def bool(self):

This method conflicts with python's native bool. Wondering if it would be okay to rename this to to_bool.

I can get the needed changes done, but wanted to make sure it's okay before sending out a PR.

@jorisvandenbossche
Copy link
Member

This method conflicts with python's native bool.

How does it conflict? It's a method, so I don't directly see a way that it can conflict with the built-in bool function?

I never use this method, so I don't have much of an opinion on the method itself, but also wondering whether it is worth a deprecation to rename this.

@skasturi
Copy link
Contributor Author

skasturi commented Mar 26, 2020

Given that bool is an keyword inbuilt method in Python and usually represents the native bool, overloading it might get confusing IMO. That's why.

@mproszewska
Copy link
Contributor

IMO to_bool would be more consistent with function naming in pandas

@mroeschke mroeschke added Enhancement Refactor Internal refactoring of code Deprecate Functionality to remove in pandas Needs Discussion Requires discussion from core team before further action and removed API Design labels Jul 30, 2021
@brurosa
Copy link

brurosa commented Oct 19, 2022

Is this refactor still relevant? If it is, I would like to take it!

@mroeschke
Copy link
Member

Given there is traction to deprecate this it is renaming is not relevant anymore so closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Enhancement Needs Discussion Requires discussion from core team before further action Refactor Internal refactoring of code
Projects
None yet
Development

No branches or pull requests

6 participants