From 6e31462cc8329adadf2756583e8c66dd5b6eaebf Mon Sep 17 00:00:00 2001 From: Marc Brinkmann Date: Sat, 25 Apr 2015 16:00:03 +0200 Subject: [PATCH] Updated README.rst. --- README.rst | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index b81bc9e..6fc5972 100644 --- a/README.rst +++ b/README.rst @@ -3,6 +3,21 @@ A copy & paste backport of Python 3.3's ``shutil.which`` function. Usage ===== -* Install this package: ``pip install shutilwhich`` -* Import like this: ``import shutilwhich``. This will monkeypatch ``shutil`` - if there is no ``shutil.which`` method, otherwise leave it alone. +First, install the package: ``pip install shutilwhich`` + +Importing the package:: + + import shutilwhich + +will monkey-patch the ``shutil`` package, so from that point on you can simply +import the ``which`` function:: + + from shutil import which + +To keep things a little more concise, you can also import ``which`` directly +from ``shutilwhich``:: + + from shutilwhich import which + +This will still monkeypatch the ``shutil`` module. On Python 3.3 and above, the +module never do anything but return the stdlib ``shutil.which`` function.