Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make provided/implementedBy and adapter registries respect super(). #181

Merged
merged 3 commits into from Mar 10, 2020

Commits on Mar 9, 2020

  1. Make provided/implementedBy and adapter registries respect super().

    The query functions now start by looking at the next class in the MRO (interfaces directly provided by the underlying object are not found).
    
    Adapter registries automatically pick up providedBy change to start finding the correct implementations of adapters, but to make that really useful they needed to change to unpack super() arguments and pass __self__ to the factory.
    
    Fixes #11
    
    Unfortunately, this makes PyPy unable to build the C extensions.
    
    Additional crash-safety for adapter lookup.
    
    Make the C functions get the cache only after resolving the
    ``required`` into a tuple, in case of side-effects like...clearing the
    cache. This could lead to the ``cache`` object being deallocated
    before we used it.
    
    Drop the ``tuplefy`` function in favor of a direct call to
    ``PySequence_Tuple``. It's what the ``tuple`` constructor would do
    anyway and saves a few steps.
    
    Make sure that getting ``providedBy(super())`` and
    ``implementedBy(super())`` have no side effects.
    jamadden committed Mar 9, 2020
    Configuration menu
    Copy the full SHA
    1e720c3 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2020

  1. Remove unused str variables

    The DEFINE_STRING macro prevents the linter from seeing them as unused
    so I temporarily redefined it to find all such variables.
    jamadden committed Mar 10, 2020
    Configuration menu
    Copy the full SHA
    364fd0c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fb8180d View commit details
    Browse the repository at this point in the history