diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2017-03-11 05:48:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-11 05:48:36 -0800 |
commit | e3101808ae077a3d352d8740cc39d877ed355b86 (patch) | |
tree | 96cbd8435a6677e4bf266236fea17018b69972a4 /share | |
parent | 15f80ed15c31c4a36c05d9fe405f9bc712898b1c (diff) | |
download | spack-e3101808ae077a3d352d8740cc39d877ed355b86.tar.gz spack-e3101808ae077a3d352d8740cc39d877ed355b86.tar.bz2 spack-e3101808ae077a3d352d8740cc39d877ed355b86.tar.xz spack-e3101808ae077a3d352d8740cc39d877ed355b86.zip |
Make multimethods work with inheritance. (#3411)
Previously, this would fail with a NoSuchMethodError:
class Package(object):
# this is the default implementation
def some_method(self):
...
class Foo(Package):
@when('platform=cray')
def some_method(self):
...
@when('platform=linux')
def some_method(self):
...
This fixes the implementation of `@when` so that the superclass method
will be invoked when no subclass method matches.
Adds tests to ensure this works, as well.
Diffstat (limited to 'share')
0 files changed, 0 insertions, 0 deletions