Question: I am trying to integrate redis to scalacache. Keys are usually string but values can be objects, Set[String], etc. Cache is initialized by this

```
val cache: RedisCache = RedisCache(config.host, config.port)
private implicit val scalaCache: ScalaCache[Array[Byte]] = ScalaCache(cacheService.cache)

```

But while calling put, i am getting this error "Could not find any Codecs for type Set[String] and Repr". Looks like i need to provide codec for my cache input as suggested [here](https://github.com/cb372/scalacache#custom-codec) so i added,

```
class A extends Codec[Set[String], Array[Byte]] with GZippingBinaryCodec[Set[String]]

```

Even after, my class A, is throwing the same error. What am i missing.

Answer: 
Thanks @mata i also did the same i changed the order and it worked.

```
def extend_instance(obj, cls):
    """Apply mixins to a class instance after creation"""
    base_cls = obj.__class__
    base_cls_name = obj.__class__.__name__
    obj.__class__ = type(base_cls_name, (cls, base_cls),{})

```
Don't use inheritance. It's a overused abstraction in many cases, and this is an example. By using dependency-injection, you can easily default to the actual DB, but replace your backend with a mocked one.

```
class MockReferenceData(object):
  def dbName(self):
    return 'mock'

  def totalNumberOfSeats(self):
    return '10'

class ReferenceData(object):
  def dbName(self):
    return 'real DB'

  def totalNumberOfSeats(self):
    return 'Fetch from DB'

class Car(object):

    def __init__(self, datasource_class=ReferenceData):
        self._datasource = datasource_class() # instead of creation here, you could also pass in an

    def showNumberOfSeats(self):
        print(self._datasource.totalNumberOfSeats())

real_car = Car()
real_car.showNumberOfSeats()

mocked_car = Car(datasource_class=MockReferenceData)
mocked_car.showNumberOfSeats()

```

Also please follow PEP8 for coding-conventions in Python. You use the "wrong" indentation depth of 2, resulting in editing problems for fellow developers like me. Same goes for method-names.