Thanks for the answer, it's perfect for my purposes. See you in other thread!!!
On Mon, Dec 21, 2009 at 6:47 PM, Stephen Hansen <apt.shan...@gmail.com>wrote: > On Mon, Dec 21, 2009 at 8:23 AM, logan tag <logan...@gmail.com> wrote: > >> It should be interesting to add new funcionality to "copytree" function >> into a "shutil.py" module?, I mean...I have developed a very silly function >> "copytree" with a different fourth argument. I have modified the "ignore" >> parameter to "target" parameter; this new one is used to copy the files wich >> matched with the given pattern. >> Basically, the opposite of the current "copytree". >> >> Maybe were a stupid idea but I throw it anyway. >> >> Thanks in advance. >> > > I don't understand what you're actually asking. Are you asking if its > possible to 'add' new functionality into shutil yourself/manually? If so, > yes, you can just 'shutil.mynewfunction = myfunction'. But doing so is > highly discouraged, it's best to simply put this function into your own > module and import that module when needed. > > Or are you asking if such a function would be useful as an addition to the > shutil in the standard library? If so, I'd say no: every "ignore" option can > trivially be turned into a "target" by simply inverting the test and > vice-versa. There's no reason to expand the stdlib's API and make people > choose between two functions which do the same thing in opposite directions. > > Meaning, an argument which defines "ignore=" can serve the purpose of > "target=" by simply choosing to ignore everything which doesn't match what > you want to target. > > Or you might be asking something else entirely, in which case I'm sorry, > I'm not sure what it is :) > > HTH, > > --S >
-- http://mail.python.org/mailman/listinfo/python-list