DS ds-python-list at
Mon Mar 31 00:15:44 CEST 2008

Paul Boddie wrote:
> On 29 Mar, 20:24, DS <ds-python-l... at> wrote:
>> I'm pretty sure this is the wrong place to ask, but I'm hoping someone
>> will point me in the right direction.
>> I'm getting ready to publish a first open-source project written in
>> python.  I am planning to use GPLas the license.  However, in my code,
>> there is a function that I like from Python Cookbook.  I would like to
>> use it, although I could certainly write a less elegant version that
>> would do the same thing.
> Note that the Python Cookbook says this about licensing: "Except where
> otherwise noted, recipes in the Python Cookbook are published under
> the Python license." The link is incorrect, but I presume they mean
> this licence:
> It's generally not recommended to use this licence for anything other
> than Python because it mentions the need to reproduce the Python
> copyright statement in derived works, which would be nonsense for
> anything which isn't the Python distribution. However, one can infer
> that the copyright notice specific to the software concerned should be
> reproduced, and this is what the original CWI licence says.
> Of course, if a different licence is mentioned on the specific recipe
> you're using, you have to observe the terms mentioned in that licence
> instead.
>> So, my options appear to be:
>> 1.   Don't use it.
>> 2.   Use it with no comment -- that doesn't seem right.
>> 3.   Use it with remarks in the code that acknowledge the source.
>> 4.   Provide a separate licensing page for that function
>>        along with the GPL for my code.
>> What is the appropriate course of action here?  I'm thinking #3 is
>> probably ok.  How do others deal with this in an honorable way?  In the
>> book, it appears that they are saying they don't really care unless
>> there is some massive use.
> You just need to do what's necessary to satisfy the licence applied to
> the code you're using. If that's the Python licence, I would imagine
> that reproducing the copyright statement and licence details would be
> sufficient, even if your own work is GPL-licensed.
> What I've done when I've released work which incorporates other work
> (itself available under a permissive licence) is to include the
> copyright statements and the licence text for that other work, but
> I've made it clear in the licensing information that the derived work
> (my code incorporating the other code) is available under the specific
> licence I've chosen, noting that the other work was made available
> under a different licence.
> So I suppose that #4 is the closest, but you should be able to assert
> that the entire work is GPL-licensed unless the recipe isn't licensed
> in a GPL-compatible way, which would open up a range of other issues
> that you hopefully won't have to deal with. ;-)
> Paul
> P.S. This isn't anything close to legal advice, so please take other
> opinions into account. ;-)
Thanks for taking the time to write.  I was also wondering about what 
ramifications there are from mixing code from other licenses.  So, I 
guess if I was going to do it, I'd have a second license file for this 
specific function with the license for it.  I definitely don't want to 
be in a situation where credit for someone else's work is not adequately 
documented.  It has happened to me, I know how I felt about it at the time.

At this point, I'm thinking that it is not worth messing with.  What I 
am going to do is write a separate function to accomplish the same 
thing.  It's only a few lines long. Of course, having seen the other 
code I'm forever tainted...

There is something a little humorous about reading through the Python 
Cookbook.  You have submissions from all these incredibly smart people 
with little gems of functions.  But, if you actually use them, it's kind 
of a hassle.  On the other hand, I'm glad the book exists, and my memory 
of the specific details of a function fade over time, but it has/does 
give my a better understanding in general of how do things.

Thanks again.

More information about the Python-list mailing list