On Mon, Dec 21, 2009 at 8:23 AM, logan tag <span dir="ltr"><<a href="mailto:logantag@gmail.com">logantag@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

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.<br>


Basically, the opposite of the current "copytree".<br><br>Maybe were a stupid idea but I throw it anyway.<br><br>Thanks in advance.<font color="#888888"><br></font></blockquote><div><br></div><div>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.</div>

<div><br></div><div>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.</div>

<div><br></div><div>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.</div><div><br>

</div><div>Or you might be asking something else entirely, in which case I'm sorry, I'm not sure what it is :)</div><div><br></div><div>HTH,</div><div><br></div><div>--S</div></div>