-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
{Misc.} Improve code style and prepare for pylint 3 #29373
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,8 +182,7 @@ def __len__(self): | |
return len(self._data) | ||
|
||
def __iter__(self): | ||
for key in self._data: | ||
yield key | ||
yield from self._data | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
def __eq__(self, other): | ||
if isinstance(other, AAZBaseValue): | ||
|
@@ -326,8 +325,7 @@ def __init__(self, schema, data): | |
self._len = 0 | ||
if self._data is not None and self._data != AAZUndefined: | ||
for idx in self._data: | ||
if idx + 1 > self._len: | ||
self._len = idx + 1 | ||
self._len = max(self._len, idx + 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
def __getitem__(self, idx) -> AAZBaseValue: | ||
if not isinstance(idx, int): | ||
|
@@ -341,8 +339,7 @@ def __getitem__(self, idx) -> AAZBaseValue: | |
if idx not in self._data: | ||
self._data[idx] = AAZValuePatch.build(item_schema) | ||
|
||
if idx + 1 > self._len: | ||
self._len = idx + 1 | ||
self._len = max(self._len, idx + 1) | ||
|
||
return item_schema._ValueCls(item_schema, self._data[idx]) | ||
|
||
|
@@ -362,8 +359,7 @@ def __setitem__(self, idx, data): | |
|
||
self._data[idx] = item_schema.process_data(data, key=idx) | ||
|
||
if idx + 1 > self._len: | ||
self._len = idx + 1 | ||
self._len = max(self._len, idx + 1) | ||
|
||
def __delitem__(self, idx): | ||
if not isinstance(idx, int): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule is hard to fix and make the code hard to read.