Skip to content
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

Remove __nonzero__ methods #896

Merged
merged 2 commits into from
Aug 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions babel/messages/pofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,9 @@ def append(self, s):
def denormalize(self):
return ''.join(map(unescape, self._strs))

def __nonzero__(self):
def __bool__(self):
return bool(self._strs)

__bool__ = __nonzero__

def __repr__(self):
return os.linesep.join(self._strs)

Expand Down
2 changes: 1 addition & 1 deletion babel/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def value(self):
def __contains__(self, key):
return key in self.value

def __nonzero__(self):
def __bool__(self):
return bool(self.value)

def __dir__(self):
Expand Down