I need your opinion...

logan tag logantag at gmail.com
Mon Dec 21 14:03:38 EST 2009


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.shansen at gmail.com>wrote:

> On Mon, Dec 21, 2009 at 8:23 AM, logan tag <logantag at 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091221/9a5dfef8/attachment-0001.html>


More information about the Python-list mailing list