An adapter neither adds a method to an existing class nor to an instance of a class - this would be classed "Monkey patching" or you would use class inheritance for creating your own implementation of class (which is not appropriate here). Adapters do not add anything magically to existing implementations. They adapt your current object and create something new (as you can see from your own adapter implementation). You custom logic in myCustomMethod will make use of self.context - which is the adapted or wrapped object. The implementation - as said - does not extend the functionality of the class of context.
An adapter wraps an instance of a given class and provides additional functionality through its defined interface. So you usually need
on the docs says "Adapters make it possible to extend the behavior of a class without modifyingthe class itself." and I thought that "the class" would be the original class because I was not "modifying" it.
mekell via Plone Community wrote at 2022-2-18 13:36 +0000:
BTW: Where is the @adapter decorator defined? Is there any documentation on this decorator?
defined in zope.component (finally zope.component._declarations).
It does what its name suggests -- it declares that
the decorated object is meant as (multi) adapter for the
interfaces named during construction. Component registrations
can use this information to get defaults of the "for/required" parameters.