From 6b5d2635ed00dfc4011f49e3ec261a1e3dfc4c1f Mon Sep 17 00:00:00 2001 From: Jakub Stasiak Date: Tue, 25 Oct 2016 15:15:24 +0100 Subject: [PATCH] Replace @provides in the readme with @provider This is to stop promoting a deprecated decorator, see [1]. [1] 2be8dbac4351376253c0b87bffd4d90202ec7638. --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ee018b8..155fc6d 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Here's a full example to give you a taste of how Injector works: ```python ->>> from injector import Module, Key, provides, Injector, inject, singleton +>>> from injector import Module, Key, provider, Injector, inject, singleton ``` @@ -108,9 +108,8 @@ Next we create a module that initialises the DB. It depends on the configuration ```python >>> class DatabaseModule(Module): ... @singleton -... @provides(sqlite3.Connection) -... @inject -... def provide_sqlite_connection(self, configuration: Configuration): +... @provider +... def provide_sqlite_connection(self, configuration: Configuration) -> sqlite3.Connection: ... conn = sqlite3.connect(configuration['db_connection_string']) ... cursor = conn.cursor() ... cursor.execute('CREATE TABLE IF NOT EXISTS data (key PRIMARY KEY, value)')