glances icon indicating copy to clipboard operation
glances copied to clipboard

`iteritems`, `itervalues`, and `iterkeys` are not more needed in Python 3

Open ariel-anieli opened this issue 7 months ago • 1 comments

iteritems, itervalues and iterkeys were introduced for compatibility with Python 2: Python 2 did not loop by default using iterators.

Since https://github.com/nicolargo/glances/commit/76ea71f256d33eab11a30d48257b9370bf23dc88, only Python 3 is supported.iteritems, itervalues, and iterkeys are used in these files, and are no longer needed.

  • [x] glances/amps/systemd/init.py
  • [x] glances/amps/systemv/init.py
  • [x] glances/plugins/containers/engines/docker.py (#3183)
  • [x] glances/plugins/containers/engines/podman.py (#3183)
  • [x] glances/plugins/containers/init.py (#3180)
  • [x] glances/stats_client_snmp.py (#3187)
  • [x] glances/processes.py (#3187)
  • [x] glances/amps_list.py (#3190)
  • [x] glances/plugins/amps/init.py (#3190)
  • [x] glances/exports/export.py (#3197)
  • [x] glances/exports/glances_cassandra/init.py (#3197)
  • [x] glances/exports/glances_graph/init.py (#3197)
  • [x] glances/exports/glances_prometheus/init.py (#3197)
  • [x] glances/outputs/glances_curses.py (#3197)
  • [ ] glances/outputs/glances_stdout_apidoc.py (#3200)
  • [ ] glances/plugins/cloud/init.py (#3200)
  • [ ] glances/plugins/cpu/init.py (#3200)
  • [ ] glances/plugins/help/init.py (#3200)
  • [ ] glances/plugins/load/init.py (#3200)
  • [ ] glances/plugins/memswap/init.py (#3200)
  • [ ] glances/plugins/plugin/model.py (#3200)
  • [ ] glances/plugins/raid/init.py (#3200)
  • [ ] glances/plugins/system/init.py (#3200)
  • [ ] glances/plugins/vms/init.py (#3200)

When done, iteritems, itervalues, and iterkeys may be removed from glances/globals.py (#3200).

ariel-anieli avatar May 24 '25 21:05 ariel-anieli

This issue is available for anyone to work on. Make sure to reference this issue in your pull request. :sparkles: Thank you for your contribution ! :sparkles:

github-actions[bot] avatar May 25 '25 15:05 github-actions[bot]

Closed in #3252.

ariel-anieli avatar Jul 26 '25 22:07 ariel-anieli