Unused variable 'chunk_key'
1386 ref_level, {}
1387 )
1388 chunks = mrc.available_chunks()
1389 chunk_key = str(path)+'-'+ str(iteration)+'-'+str(ref_level)1390 for _chunk in chunks:
1391 # We set the actual data to None, and we will read it in
1392 # _read_component_as_uniform_grid_data upon request
Description
An unused variable takes up space in the code, and can lead to confusion, and it should be removed. If this variable is necessary, name the variable _
to indicate that it will be unused, or start the name with unused
or _unused
.
Bad practice
def update():
for i in range(10): # Usused variable `i`
time.sleep(0.01)
display_result()
Preferred:
def update():
for _ in range(10):
time.sleep(0.01)
display_result()