Issue #36 resolved
Jan-Jaap Driessen
created an issue

What exactly is the raison d'etre of the ResourceBase? I see the same need method on both of its subclasses Resource and GroupResource. Is this a hurry.resource w/ zope.interface remnant?

Comments (2)

  1. faassen

    ResourceBase is there to make sure we can check whether something is a Resource at all. It currently only seems to be used in normalize_resource, but this makes sure that a mode string or dependency is turned into a resource object only if it isn't already a resource. Since it could potentially be a GroupResource this is an easy and flexible way to check it.

    It's not really doing much though. It's a good observation that we could now pull up "need()", though we would need to examine the impact on documentation.

    Alternatively we could simply get rid of ResourceBase and modify the isinstance check to get a tuple. That makes it harder to create a derived "resourcy" object though. Another way to go about this is to compare the input to normalize_resource to basestring and if so, turn it into a resource, otherwise leave it alone. That might be the best way to get rid of ResourceBase.

  2. Log in to comment