[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RFC python-apt



Dear Friends,

I'm working on improving python-apt and during that work I created a
python abstraction that hides the details of apt_pkg. The code can be
get with (this the bazaar package):
baz get http://people.ubuntu.com/~mvo/arch/ubuntu/python-apt--mvo--0

The interface is in the "apt" subdir, comments on the interface are
very welcome.

One outstanding issue is that it's not pep 8 conform (the python
styleguide). The problem is that all functions and attributes in
python-apt are written with a uppercase (Cache.Upgrade()) but PEP 8
only allows camelCase or use_of_underscore. I can fix that but this
will make a "import apt" inconsitent with "apt_pkg". Every method in
apt_pkg is written Uppercase (and given the time apt_pkg is around I
wouldn't want to change that) but in "apt" it will be
lowercase. Changing this will result in code like this (in the apt
dir): 

class Package:
  def markInstallI():
    self._depcache.MarkInstall(self._pkg)

[_depcache comes from apt_pkg]

As long as people only use "import apt" xor "import apt_pkg" it's no
problem but as soon as both are imported the code will look
messy. What do you think? Should we sacrifice pep08 for consistency
with the apt_pkg interface (that has been around for ages)? Or rather
fix it now in apt and hope that everything that is written now uses
only "import apt" and that there is no reason to "import apt_pkg"?

Cheers,
 Michael

-- 
Linux is not The Answer. Yes is the answer. Linux is The Question. - Neo



Reply to: