[Distutils] Proposed patch: allowing unknown keywords
A.M. Kuchling
amk@amk.ca
Thu Oct 31 14:49:32 2002
On Thu, Oct 31, 2002 at 10:24:41AM +0200, Juergen Hermann wrote:
> from distutils.dist import Distribution
> assert hasattr(Distribution, "getSupportedOptions")
> assert "foo" in Distribution.getSupportedOptions()
Now that I look at, why would this be a method on Distribution? Are
the options dependent on the Distribution instance, or on the version
of Distutils installed? If the latter, then it should probably be a
function in distutils/core.py. Given that many people write 'from
distutils.core import *', maybe the function should be
named get_distutil_options() to make its origin clearer.
Here's a proposed docstring for core.py. There aren't any options to
record yet, so the returned list is empty. Anyone see problems with
this?
def get_distutil_options ():
"""Returns a list of strings recording changes to the Distutils.
setup.py files can then do:
if 'optional-thing' in get_distutil_options():
...
"""
return []
--amk