diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-04-13 20:00:09 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-04-13 20:00:09 +0200 |
| commit | ccd98916ba50c7583f354e0d3487ffb0830103f0 (patch) | |
| tree | f38068a3d3a5053600663c4e25fc2c0396a0e476 /doc | |
| parent | ebedf54fd4c72bfbf5c5e60d3d908cd66acace95 (diff) | |
| download | python-apt-ccd98916ba50c7583f354e0d3487ffb0830103f0.tar.gz | |
* python/configuration.cc: Support the 'in' operator for Configuration
Support the replacement of mapping.has_key() for Configuration,ConfigurationPtr
and ConfigurationSub objects.
This is implemented by extending the various types with the tp_as_sequence
slot, which refers to a PySequenceMethods containing only this method.
The CnfGetAttr() function has been removed and replaced by the use of the
tp_method slot. This helps the py3k port because the previously used
Py_FindMethod() is not avilable anymore.
This completes the support of the 'in' operator in all python-apt objects,
which makes it even easier to convert python-apt-using applications to py3k
once python-apt supports it, as 2to3 converts 'm.has_key(k)' to 'k in m'.
Also finalize the types in apt_pkgmodule.cc and add the new 'key in conf'
description to the documentation.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/source/apt_pkg/cache.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/source/apt_pkg/cache.rst b/doc/source/apt_pkg/cache.rst index 146c2c2a..3ecbf069 100644 --- a/doc/source/apt_pkg/cache.rst +++ b/doc/source/apt_pkg/cache.rst @@ -117,6 +117,10 @@ Classes in apt_pkg The Configuration objects store the configuration of apt. + .. describe:: key in conf + + Return ``True`` if *conf* has a key *key*, else ``False``. + .. describe:: conf[key] Return the value of the option given key *key*. If it does not |
