Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Injector.alias() #13

Description

@groner

Instead of writing:

@Injector.factory('send_mail')
def send_mail_factory(send_mail: annotate.partial(send_mail)):
    return send_mail

What if you could just write:

Injector.alias('send_mail', annotate.partial(send_mail))

Another possible use:

# In a web application
Injector.alias('user', 'session:user')
# In tests
Injector.alias('user', 'fixture:user')

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions