Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8e791bd

Browse files
author
Ubuntu
committedAug 2, 2024·
blabal
1 parent 96270e7 commit 8e791bd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎python/dgl/graphbolt/internal/datapipe_utils.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -147,28 +147,28 @@ def _assign_attr(obj, old_dp, new_dp, inner_dp: bool = False):
147147
elif isinstance(obj, tuple):
148148
temp_list = []
149149
flag = False
150-
for o in obj:
151-
new_obj = _assign_attr(o, old_dp, new_dp, inner_dp)
150+
for item in obj:
151+
new_obj = _assign_attr(item, old_dp, new_dp, inner_dp)
152152
if new_obj is not None:
153153
flag = True
154154
temp_list.append(new_dp)
155155
else:
156-
temp_list.append(o)
156+
temp_list.append(item)
157157
if flag:
158158
return tuple(temp_list) # Special case
159159
else:
160160
return None
161161
elif isinstance(obj, list):
162-
for i in range(len(obj)):
162+
for i in range(len(obj)): # pylint: disable=consider-using-enumerate
163163
new_obj = _assign_attr(obj[i], old_dp, new_dp, inner_dp)
164164
if new_obj is not None:
165165
obj[i] = new_obj
166166
break
167167
return None
168168
elif isinstance(obj, set):
169169
new_obj = None
170-
for o in obj:
171-
if _assign_attr(o, old_dp, new_dp, inner_dp) is not None:
170+
for item in obj:
171+
if _assign_attr(item, old_dp, new_dp, inner_dp) is not None:
172172
new_obj = new_dp
173173
break
174174
if new_obj is not None:

0 commit comments

Comments
 (0)
Please sign in to comment.