gpuopenanalytics / pynvml

Provide Python access to the NVML library for GPU diagnostics
BSD 3-Clause "New" or "Revised" License
205 stars 31 forks source link

Readme.md import example #41

Closed zansity closed 2 years ago

zansity commented 2 years ago

Hello,

From the example to import the module (from pynvml import *) should be import pynvml or to import a specific function or subclass for best Python coding practices.

The phrase from module import * can cause namespace collisions within people's code and should be avoided whenever it can.

rjzamora commented 2 years ago

Agree that import * should be discouraged. If I understand correctly, the "example" actually predates this repository. Are you interested in submitting a PR to improve this?

zansity commented 2 years ago

Of course! Thank you.