Skip to content
Reference

Glossary

These terms describe Lookups as a Python library for finding available objects by type. The public API lists the interfaces, and the lookup model explains how they fit together.

Objects and responsibilities

Lookup

A source of available objects that can be searched by Python type, including a parent type. A lookup can expose several members matching the same type, so “dictionary” is misleading when it suggests one object per type.

Member

An object made available through a lookup, either directly or through deferred creation. Membership does not require the object to have been constructed yet. Use deferred member when that distinction matters: “instance” can otherwise mean either an existing object or a member whose object does not yet exist.

A member is distinct from its item: the member is what the lookup makes available, while the item describes it and provides access to its object.

Searched type

The Python type used to select matching members. It can be a parent of a member's concrete class. Avoid “key” for this type, because conversion key names the stand-in for a deferred member.

Lookup owner

The part of an application responsible for choosing which objects a lookup exposes, and when. The owner controls availability so callers can query the lookup without managing its membership. Use owner when discussing this control, rather than calling every owner a context or provider.

Lookup provider

An object that supplies an associated lookup through LookupProvider.get_lookup(). A provider need not control that lookup's membership, so provider and owner are not interchangeable. See Composition and providers.

Role, context and data object

Role describes a capability expressed by a searched type. It does not restrict members to application-wide services. Context refers to the application coordinator using those capabilities for a particular use case, and data object refers to an application object that supplies them. “Lookup item” still means the description of a member, not the application object.

These terms have other meanings in the literature. See Tentative use in DCI for the project's interpretation and its ambiguities. They are not prerequisites for using the library.

Matches and descriptions

See Queries, results and items for the corresponding interfaces.

Result

A view of members matching one searched type, represented by Result[T]. A result exists even when no members currently match. Retaining a result allows the caller to read its collections again and observe possible changes.

Snapshot

A collection read from a result at a particular time. The returned collection keeps its contents when lookup membership changes. Read the result again for an updated view. The result itself is not a snapshot. An immutable collection does not make its member objects immutable or promise an atomic read across several sources. See Lifetime and change notifications.

Lookup item

A description of one member, represented by Item[T], with access to its object, represented type, identifier and display name. Use item for this description and instance for the retrieved object. Inspecting an item's metadata can avoid constructing a deferred member.

Item identifier

A textual reference supplied by Item.get_id(). Direct items use str(instance) unless an explicit identifier is supplied. A convertor supplies identifiers for its deferred members. Queries select members by type rather than by identifier.

Display name

Text suitable for presenting an item to a person, returned by get_display_name(). A display name is a human-readable label and need not be a distinct or durable identifier.

Possible change / result change

A signal that the members available through a result may have changed. A listener receives the result, rather than an exact difference between old and new membership. Read the result again to inspect its members, because the signal does not identify which members were added or removed.

Deferred availability

See Dynamic membership and conversion for registration and convertor interfaces.

Deferred member

A member represented before its object is needed, with enough information to describe and select it. Avoid “deferred instance” when no instance exists yet.

Conversion key

The stand-in registered with a convertor to represent a deferred member. It identifies what the convertor will turn into an available object. A conversion key represents one member, whereas a searched type selects matching members.

Convertor

A description and creation rule for turning a conversion key into a member object. Convertor supplies convert(), type(), id() and display_name(). Use the project's spelling convertor when naming this concept. Deferred construction does not imply construction happens only once: a converted object can be collected and constructed again.

Sources of availability

Dynamic lookup

A lookup whose available members can change during its lifetime. GenericLookup is one implementation. Use dynamic for the general property. “Generic lookup” names that implementation and does not cover every changing source.

Fixed lookup

A lookup whose membership is chosen at creation and remains unchanged. Fixed membership says nothing about changes inside the member objects, so “immutable objects” is not a synonym. See Fixed lookups.

Singleton lookup

A fixed lookup with one member, created by singleton(). One member does not imply application-wide scope, so avoid “global lookup” for this property.

Empty lookup

A lookup with no members. EmptyLookup is the fixed implementation, while a dynamic lookup can also be empty at a particular time.

Composite lookup

A lookup that presents members from several source lookups together. ProxyLookup implements composition. It combines sources, whereas a delegated lookup presents one supplied source at a time. See Composition and providers.

Delegated lookup

A lookup that presents members of one source supplied by a lookup provider, with the possibility of replacing that source. DelegatedLookup refreshes its source through an explicit lookup_updated() call. Use composite when several sources are combined, rather than switched.

Entry-point lookup

A lookup whose members come from a named group of contributions made by installed packages. EntryPointLookup loads and constructs those contributions at creation, then keeps fixed membership. Use contributing package, contribution or entry-point lookup as appropriate, because “plugin” can blur the distinction between them. See Entry points and the default lookup.

Default lookup

The application's common lookup, obtained through Lookup.get_default(), for use when no more specific source is selected. Its built-in entry-point group is lookup.default.

Default and global lookup

Use default lookup for this application-wide source. “Global lookup” also names the separate experimental execution-scoped GlobalLookup, so the default lookup API does not integrate that mechanism. See the experimental API.

Experimental vocabulary

Actionable

An object that offers an action while that action is relevant, such as a changed resource that can be saved. This is an experimental concept whose boundary with a general capability remains unspecified. See the experimental API. The term does not define an additional stable membership category.