Closed GoogleCodeExporter closed 9 years ago
I like this idea, and it makes sense to me, however I might recommend that we
avoid the name "utils" for a module, as psutil.utils is a bit awkward/confusing
at first glance - just a thought :-)
If we're not going to add anything else to such a module right now, we could
just only support named tuples on 2.6 and higher, and otherwise fall back to a
standard tuple. This is more of a "nice to have" feature than a critical one
anyway, and > 100 lines of code just to add named tuples to the older Python
versions.
Original comment by jlo...@gmail.com
on 22 Jun 2010 at 5:11
I agree it is more of a "nice to have" feature but changing types between
python versions introduces a level of incompatibility and discrepancy.
Also, deciding whether use a tuple or a named tuple in the code would be
somewhat twisted.
If you're worried about the recipe code I think we can manage to shorten it up
a little.
> I might recommend that we avoid the name "utils" for a module, as psutil.
> utils is a bit awkward/confusing at first glance - just a thought :-)
Agreed. Ideas? What about compatibility.py?
Original comment by g.rodola
on 22 Jun 2010 at 5:36
I would vote for "compat.py", it's shorter and it's a standard abbreviation for
compatibility related libs or code.
Original comment by jlo...@gmail.com
on 22 Jun 2010 at 6:07
Original comment by g.rodola
on 22 Jun 2010 at 7:42
Thinking back, psutil.cpu_times() should keep returning a CPUTimes object: the
position of the values returned as a namedtuple object varies depending on the
platform so that psutil.cpu_times()[4] on Linux, for example, has a different
meaning on Windows.
CPUTimes didn't have this problem since it doesn't implement position index.
Original comment by g.rodola
on 23 Jun 2010 at 4:52
Implemented on Linux (r575), Windows (r576), BSD and OSX (r581).
CPUInfo changes reverted as r579 and r580.
Original comment by g.rodola
on 2 Jul 2010 at 7:42
[deleted comment]
Updated csets after the SVN -> Mercurial migration:
r575 == revision f04e3745bf81
r579 == revision fd053962d42e
Original comment by g.rodola
on 2 Mar 2013 at 11:53
Original issue reported on code.google.com by
g.rodola
on 22 Jun 2010 at 4:54