[issue25294] Absolute imports fail in some cases where relative imports would work
Patrick Maupin added the comment: You are correct that I have conflated two issues, but they are not orthogonal -- if you choose to use relative imports, you will never encounter this issue, because your imports will all be of the 'from ... import' form. (And, as you point out, the fact that you don't have this issue with absolute "from ... import" statements is due to some special-casing in the import logic that doesn't help the other kind of import statement.) But PEP 8 denigrates relative imports, and then goes on to describe the use of the "import x.y.z; x.y.z.foo" form as a way to avoid name clashes. So PEP 8 promotes absolute imports, and then it presents using "import" instead of "from ... import" as a solution to some problems. It never mentions that the 'as' clause could also solve those problems, and also never mentions that "import x.y.z" can actually cause problems in some cases. And the importlib documentation is also a bit sparse on where things can fail. We're in agreement that it will be difficult to document properly, and maybe I overstated my case, but my opinion remains that the current documentation promotes practices that _will_ sometimes get people in trouble. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25294> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25294] Absolute imports fail in some cases where relative imports would work
Patrick Maupin added the comment: concurrent/futures/__init__.py may be a better example than 2to3 for this issue. It's relatively new code, it's part of the standard library, it's fairly small and self-contained, and it doesn't follow the promulgated standard. If it's bad code, it should be modified. If it's not bad code, then the docs shouldn't denigrate the coding style (especially not to the extent of requiring absolute imports in standard library code), because a lot of newbies take the docs to heart and spend a lot of time and energy beating up themselves and others about conformance. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25294> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25294] Absolute imports fail in some cases where relative imports would work
Patrick Maupin added the comment: I don't think anything is wrong with that code. But PEP 8 prescribes a way of doing something that often won't work (which is unusual for PEP 8), with no discussion of this fact. > I think the key thing to take away from this whole discussion is "don't have > circular imports" is the key practice to follow. If this is a "key practice" then why the heck is the recommended way to do things the one that is guaranteed to break it? I have empirical evidence that it is surprising to some users that the semantics of "from .z import foo" and "from x.y.z import foo" are not identical -- in other words, some of them have a hard time classifying the second as a circular import but not the first. And the documentation is silent on this. > And if someone wants to propose a patch to update some documentation I'll try to get to this in the next couple of weeks. Thanks, Pat -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25294> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25294] Absolute imports fail in some cases where relative imports would work
Patrick Maupin added the comment: The PEP 8 recommendation to "use absolute imports" is completely, totally, unambiguously meaningless absent the expectation that packages refer to parts of themselves. And it works, too! (For a single level of package.) As soon as packages are nested, this recommendation falls over, with the most innocuous code: x/__init__.py: import x.y x/y/__init__.py: import x.y.z; x.y.z x/y/z/__init__.py: The ability to nest packages is an attractive nuisance from a programmer's perspective. He's neatly organized his code, and now he finds that there are two ways to make it work: (1) Use the disparaged relative imports; or (2) flatten his package to a single level, because importing X.Z from within X.Y will work fine. IMO, the language that Nick proposes for PEP 8 will either (a) not be understood at all by the frustrated junior programmer -- sure, the import system views it as a circular import, but he's not seeing it that way; or (b) be understood to expose a huge wart on the side of Python: Even though Z is only used by Y/__init__, and doesn't itself use anything else in Y, it cannot live alongside Y/__init__. Instead, unless Y is a top level module or the programmer uses denigrated relative imports, he will now have to move it to a different place, so that from Y he can then "import X.Y_HELPER.Z". Another PEP 8 prescription is that "Standard library code should avoid complex package layouts and always use absolute imports." Here's a serious offer -- I'll give $200 to whoever gets the patch accepted that makes lib2to3 conformant without breaking it. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25294> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25294] Absolute imports fail in some cases where relative imports would work
Patrick Maupin added the comment: I'm a big fan of stitching things together at the top myself -- maybe that's partly an unconscious reaction to this very issue. But I'm not sanguine about how easy it is to express this practice in the docs. This issue arose in the context of me answering a question on Stack Overflow. My initial response was "well, duh, obviously relative imports are more Pythonic here because that's the obvious way to do it (that works)." But then, of course, PEP 8 disagrees. For that actual question on Stack Overflow, you would have to carefully define the scope of "executing" so that it was fully understood to include "subclassing a class defined in a peer module or submodule" -- because that's what was breaking. Just as most people don't think of imports that can be placed in a DAG as circular, most people also don't think of subclassing as "executing." But the Python interpreter sometimes vehemently disagrees in both cases. I'm not surprised at its behavior, but I'm also not surprised that some people who haven't thought deeply about the behavior find it surprising. I'm not fully convinced that this even can be documented in a way that renders observed behavior unsurprising in the general case, but I am convinced that doing so would require a lot of care. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25294> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24426] re.split performance degraded significantly by capturing group
Patrick Maupin added the comment: (stuff about cPython) No, I was curious about whether somebody maintained pure-Python fixes (e.g. to the re parser and compiler). Those could be in a regular package that fixed some corner cases such as the capture group you just applied a patch for. ... regex is more powerful and better supports Unicode. Unfortunately, it is still not competitive. For example, for one package I maintain (github.com/pmaupin/pdfrw), I have one unittest which reads in and parses several PDF files, and then outputs them to new PDF files: Python 2.7 with re -- 5.9 s Python 2.7 with regex -- 6.9 s Python 3.4 with re -- 7.2 s Python 3.4 with regex -- 8.2 s A large reason for the difference between 2.7 and 3.4 is the fact that I'm too lazy, or it seems too error-prone, to put the b'xxx' in front of every string, so the package uses the same source code for 2.7 and 3.4, which means unicode strings for 3.4 and byte strings for 2.7. Nonetheless, when you consider all the other work going on in the package, a 14% _overall_ slowdown to change to a better re package seems like going the wrong direction, especially when stacked on top of the 22% slowdown for switching to Python3. Do you mean documenting codes of compiled re pattern? Yes. This is implementation detail and will be changed in future. Understood, and that's fine. If the documentation existed, it would have helped if I want to create a pure-python package that simply performed optimizations (like the one in your patch) against existing Python implementations, for use until regex (which is a HUGE undertaking) is ready. Thanks, Pat -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24426 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24445] rstrip strips what it doesn't have to
Patrick Maupin added the comment: Example text = 'test1/1.jp2' text.rstrip('.2jp') 'test1/1' -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24445 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24445] rstrip strips what it doesn't have to
Patrick Maupin added the comment: I think you misunderstand rstrip -- it works from the right, and checks to see if the right-most character is in the string you have given it. As long as it is, then it will remove the character and loop -- nosy: +Patrick Maupin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24445 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24426] re.split performance degraded significantly by capturing group
Patrick Maupin added the comment: Thank you for the quick response, Serhiy. I had started investigating and come to the conclusion that it was a problem with the compiler rather than the C engine. Interestingly, my next step was going to be to use names for the compiler constants, and then I noticed you did that exact same thing in the 3.6 tree. I will try this out on my use-case tomorrow to make sure it fixes my issue, but now I'm intrigued by the inner workings of this, so I have two questions: 1) Do you know if anybody maintains a patched version of the Python code anywhere? I could put a package up on github/PyPI, if not. 2) Do you know if anybody has done a good writeup on the behavior of the instruction stream to the C engine? I could try to do some work on this and put it with the package, if not, or point to it if so. Thanks and best regards, Pat -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24426 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24426] re.split performance degraded significantly by capturing group
New submission from Patrick Maupin: The addition of a capturing group in a re.split() pattern, e.g. using '(\n)' instead of '\n', causes a factor of 10 performance degradation. I use re.split a() lot, but never noticed the issue before. It was extremely noticeable on 1000 patterns in a 5BG file, though, requiring 40 seconds instead of 4. I have attached a script demonstrating the issue. I have tested on 2.7 and 3.4, but have no reason to believe it doesn't exist on other vesions as well. Thanks, Pat -- components: Regular Expressions files: splitter2.py messages: 245137 nosy: Patrick Maupin, ezio.melotti, mrabarnett priority: normal severity: normal status: open title: re.split performance degraded significantly by capturing group type: performance versions: Python 2.7, Python 3.4 Added file: http://bugs.python.org/file39676/splitter2.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24426 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24426] re.split performance degraded significantly by capturing group
Patrick Maupin added the comment: 1) I have obviously oversimplified my test case, to the point where a developer thinks I'm silly enough to reach for the regex module just to split on a linefeed. 2) '\n(?=(\n))' -- yes, of course, any casual user of the re module would immediately choose that as the most obvious thing to do. 3) My real regex is r'( [a-zA-Z0-9_]+ \[[0-9]+\][0-9:]+\].*\n)' because I am taking nasty broken output from a Cadence tool, fixing it up, and dumping it back out to a file. Yes, I'm sure this could be optimized, as well, but when I can just remove the parentheses and get a 10X speedup, and then figure out the string I meant to capture by looking at string lengths, shouldn't there at least be a warning that the re module has performance issues with capturing groups with split(), and casual users like me should figure out what the matching strings are some other way? I assumed that, since I saw almost exactly the same performance degradation with \n as I did with this, that that was a valid testcase. If that was a bad assumption and this is insufficient to debug it, I can submit a bigger testcase. But if this issue is going to be wontfixed for some reason, there should certainly be a documentation note added, because it is not intuitive that splitting 5GB of data into 1000 strings of around 5MB each should be 10X faster than doing the same thing, but also capturing the 1K ten-byte strings inbetween the big ones. Thanks, Pat -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24426 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24426] re.split performance degraded significantly by capturing group
Patrick Maupin added the comment: Just to be perfectly clear, this is no exaggeration: My original file was slightly over 5GB. I have approximately 1050 bad strings in it, averaging around 11 characters per string. If I split it without capturing those 1050 strings, it takes 3.7 seconds. If I split it and capture those 1050 strings, it takes 39 seconds. ISTM that 33 ms to create a capture group with a single 11 character string is excessive, so there is probably something else going on like excessive object copying, that just isn't noticeable on a smaller source string. In the small example I posted, if I replace the line: data = 100 * (20 * ' ' + '\n') with data = 1000 * (50 * ' ' + '\n') then I get approximately the same 3.7 second vs 39 second results on that (somewhat older) machine. I didn't start out with that in the example, because I thought the problem should still be obvious from the scaled down example. Obviously, your CPU numbers will be somewhat different. The question remains, though, why it takes around 60 million CPU cycles for each and every returned capture group. Or, to put it another way, why can I stop doing the capture group, and grab the same string with pure Python by looking at the string lengths of the intervening strings, well over 100 times faster than it takes for the re module to give me that group? Thanks, Pat -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24426 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: match, concatenate based on filename
On Nov 3, 9:55 pm, Matt macma...@gmail.com wrote: Hi All, I am trying to concatenate several hundred files based on their filename.. Filenames are like this: Q1.HOMOblast.fasta Q1.mus.blast.fasta Q1.query.fasta Q2.HOMOblast.fasta Q2.mus.blast.fasta Q2.query.fasta ... Q1223.HOMOblast.fasta Q1223.mus.blast.fasta Q1223.query.fasta All the Q1's should be concatenated together in a single file = Q1.concat.fasta.. Q2's go together, Q3's and so on... I envision something like for file in os.listdir(/home/matthew/Desktop/pero.ngs/fasta/final/): if file.startswith(Q%i): concatenate... But I can't figure out how to iterate this process over Q-numbers 1-1223 Any help appreciate. I haven't tested this, so may have a typo or something, but it's often much cleaner to gather your information, massage it, and then use, than it is to gather it and use it in one go. from collections import defaultdict filedict = defaultdict(list) for fname in sorted(os.listdir(mydir)): if fname.startswith('Q') and '.' in fname: filedict[fname[:fname.find('.')]].append(fname) for prefix, fnames in filedict.iteritems(): #print prefix, fnames concatenate... HTH, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Question about metaclass
On Nov 1, 11:02 pm, Makoto Kuwata k...@kuwata-lab.com wrote: Hi, I want to define a special class which groups functions, like: class Greepting(FuncGroup): def hello(): # no self, no @staticmethod! print(Hello!) def goodbye(): # no self, no @staticmethod! print(Good Bye!) Geeting.hello(): #= Hello! Geeting.goodbye(): #= Good Bye! I tried the following code which converts instance mthods into static method automatically, but I don't get result what I want. (python 2.5.5) import sys from types import FunctionType class MetaClass(type): def __init__(cls, name, bases, dct): ## converts instance methods to static methods automatically for k in dct.keys(): v = dct[k] if isinstance(v, FunctionType): dct[k] = staticmethod(v) print(*** debug: dct[%r] = %r % (k, dct[k])) #= staticmethod object at 0x100378d38 class FuncGroup(object): __metaclass__ = MetaClass class Greeting(FuncGroup): def hello(): print(Hello!) def goodbye(): print(Good Bye!) print(*** type(Greeting.hello)=%r % type(Greeting.hello) #= type 'instancemthod' print(*** type(Greeting.goodbye)=%r % type(Greeting.goodbye) #= type 'instancemthod' Could you give me advice? -- regards, makoto kuwata I think you need to unwrap the instance methods first: class foo(object): ... def bar(): ... print Hi there ... foo.bar2 = staticmethod(foo.bar.im_func) foo.bar2() Hi there -- http://mail.python.org/mailman/listinfo/python-list
Re: Efficient, built-in way to determine if string has non-ASCII chars outside ASCII 32-127, CRLF, Tab?
On Mon, Oct 31, 2011 at 4:08 PM, Dave Angel d...@davea.name wrote: Yes. Actually, you don't even need the split() -- you can pass an optional deletechars parameter to translate(). On Oct 31, 5:52 pm, Ian Kelly ian.g.ke...@gmail.com wrote: That sounds overly complicated and error-prone. Not really. For instance, split() will split on vertical tab, which is not one of the characters the OP wanted. That's just the default behavior. You can explicitly specify the separator to split on. But it's probably more efficient to just use translate with deletechars. I would probably use a regular expression for this. I use 'em all the time, but not for stuff this simple. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Efficient, built-in way to determine if string has non-ASCII chars outside ASCII 32-127, CRLF, Tab?
On Oct 31, 9:12 pm, Dave Angel d...@davea.name wrote: I would claim that a well-written (in C) translate function, without using the delete option, should be much quicker than any python loop, even if it does copy the data. Are you arguing with me? I was agreeing with you, I thought, that translate would be faster than a regex. I also pointed out that the delete function was available as , but OTOH, that might be a little slow because I think it does the deletion before the translate. I think I'd just do something like this: transtab = ''.join(' ' if 32 = x = 126 else chr(x) for x in range(256)) 'abc\x05\def\x0aghi'.translate(transtab).replace(' ', '') '\x05\n' Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Assigning generator expressions to ctype arrays
On Oct 28, 3:24 pm, Terry Reedy tjre...@udel.edu wrote: On 10/28/2011 2:05 PM, Patrick Maupin wrote: On Oct 27, 10:23 pm, Terry Reedytjre...@udel.edu wrote: I do not think everyone else should suffer substantial increase in space and run time to avoid surprising you. What substantial increase? of time and space, as I said, for the temporary array that I think would be needed and which I also described in the previous paragraph that you clipped That's because I don't think it needs a temporary array. A temporary array would provide some invariant guarantees that are nice but not necessary in a lot of real-world cases. There's already a check that winds up raising an exception. Just make it empty an iterator instead. It? I have no idea what you intend that to refer to. Sorry, code path. There is already a code path that says hey I can't handle this. To modify this code path to handle the case of a generic iterable would add a tiny bit of code, but would not add any appreciable space (no temp array needed for my proposal) and would not add any runtime to people who are not passing in iterables or doing other things that currently raise exceptions. I doubt it would be very many because it is *impossible* to make it work in the way that I think people would want it to. How do you know? I have a use case that I really don't think is all that rare. I know exactly how much data I am generating, but I am generating it piecemeal using iterators. It could, but at some cost. Remember, people use ctypes for efficiency, yes, you just made my argument for me. Thank you. It is incredibly inefficient to have to create a temp array. No, I don't think I did make your argument for you. I am currently making a temp list because I have to, and am proposing that with a small change to the ctypes library, that wouldn't always need to be done. But necessary to work with blank box iterators. With your own preconceived set of assumptions. (Which I will admit, you have given quite a bit of thought to, which I appreciate.) Now you are agreeing with my argument. Nope, still not doing that. If ctype_array slice assignment were to be augmented to work with iterators, that would, in my opinion (and see below), That's better for not being absolute. Thank you for admitting other possibilities. require use of temporary arrays. Since slice assignment does not use temporary arrays now (see below), that augmentation should be conditional on the source type being a non-sequence iterator. I don't think any temporary array is required, but in any case, yes the code path through the ctypes array library __setslice__ would have to be modified where it gives up now, in order to decide to do something different if it is passed an iterable. CPython comes with immutable fixed-length arrays (tuples) that do not allow slice assignment and mutable variable-length arrays (lists) that do. The definition is 'replace the indicated slice with a new slice built from all values from an iterable'. Point 1: This works for any properly functioning iterable that produces any finite number of items. Agreed. Iterators are always exhausted. And my proposal would continue to exhaust iterators, or would raise an exception if the iterator wasn't exhausted. Replace can be thought of as delete follewed by add, but the implementation is not that naive. Sure, on a mutable length item. Point 2: If anything goes wrong and an exception is raised, the list is unchanged. This may be true on lists, and is quite often true (and is nice when it happens), but it isn't always true in general. For example, with the current tuple packing/unpacking protocol across an assignment, the only real guarantee is that everything is gathered up into a single object before the assignment is done. It is not the case that nothing will be unpacked unless everything can be unpacked. For example: a,b,c,d,e,f,g,h,i = range(100,109) (a,b,c,d), (e,f), (g,h,i) = (1,2,3,4), (5,6,7), (8,9) Traceback (most recent call last): File stdin, line 1, in module ValueError: too many values to unpack a,b,c,d,e,f,g,h,i (1, 2, 3, 4, 104, 105, 106, 107, 108) This means that there must be temporary internal storage of either old or new references. As I show with the tuple unpacking example, it is not an inviolate law that Python won't unpack a little unless it can unpack everything. An example that uses an improperly functioning generator. (snip) Yes, I agree that lists are wondrously robust. But one of the reasons for this is the flexible interpretation of slice start and end points, that can be as surprising to a beginner as anything I'm proposing. A c_uint array is a new kind of beast: a fixed-length mutable array. So it has to have a different definition of slice assignment than lists. Thomas Heller, the ctypes author, apparently chose 'replacement by a sequence with exactly the same number of items, else raise
Re: Assigning generator expressions to ctype arrays
On Oct 27, 10:23 pm, Terry Reedy tjre...@udel.edu wrote: I do not think everyone else should suffer substantial increase in space and run time to avoid surprising you. What substantial increase? There's already a check that winds up raising an exception. Just make it empty an iterator instead. It violates the principle of least surprise for ctypes to do what is most efficient in 99.9% of uses? It doesn't work at all with an iterator, so it's most efficient 100% of the time now. How do you know how many people would use iterators if it worked? It could, but at some cost. Remember, people use ctypes for efficiency, yes, you just made my argument for me. Thank you. It is incredibly inefficient to have to create a temp array. so the temp array path would have to be conditional. I don't understand this at all. Right now, it just throws up its hands and says I don't work with iterators. Why would it be a problem to change this? -- http://mail.python.org/mailman/listinfo/python-list
Re: Assigning generator expressions to ctype arrays
On Oct 28, 3:19 am, Terry Reedy tjre...@udel.edu wrote: On 10/28/2011 3:21 AM, Steven D'Aprano wrote: If the slice has too few elements, you've just blown away the entire iterator for no good reason. If the slice is the right length, but the iterator doesn't next raise StopIteration, you've just thrown away one perfectly good value. Hope it wasn't something important. You have also over-written values that should be set back to what they were, before the exception is raised, which is why I said the test needs to be done with a temporary array. Sometimes when exceptions happen, data is lost. You both make a big deal out of simultaneously (a) not placing burden on the normal case and (b) defining the normal case by way of what happens during an exception. Iterators are powerful and efficient, and ctypes are powerful and efficient, and the only reason you've managed to give why I shouldn't be able to fill a ctype array slice from an iterator is that, IF I SCREW UP and the iterator doesn't produce the right amount of data, I will have lost some data. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Assigning generator expressions to ctype arrays
On Oct 28, 4:51 pm, Patrick Maupin pmau...@gmail.com wrote: On Oct 28, 3:19 am, Terry Reedy tjre...@udel.edu wrote: On 10/28/2011 3:21 AM, Steven D'Aprano wrote: If the slice has too few elements, you've just blown away the entire iterator for no good reason. If the slice is the right length, but the iterator doesn't next raise StopIteration, you've just thrown away one perfectly good value. Hope it wasn't something important. You have also over-written values that should be set back to what they were, before the exception is raised, which is why I said the test needs to be done with a temporary array. Sometimes when exceptions happen, data is lost. You both make a big deal out of simultaneously (a) not placing burden on the normal case and (b) defining the normal case by way of what happens during an exception. Iterators are powerful and efficient, and ctypes are powerful and efficient, and the only reason you've managed to give why I shouldn't be able to fill a ctype array slice from an iterator is that, IF I SCREW UP and the iterator doesn't produce the right amount of data, I will have lost some data. Regards, Pat And, BTW, the example you give of, e.g. a,b,c = (some generator expression) ALREADY LOSES DATA if the iterator isn't the right size and it raises an exception. It doesn't overwrite a or b or c, but you're deluding yourself if you think that means it hasn't altered the system state. -- http://mail.python.org/mailman/listinfo/python-list
Re: Assigning generator expressions to ctype arrays
On Oct 28, 8:01 pm, Steven D'Aprano ALREADY LOSES DATA if the iterator isn't the right size and it raises an exception. Yes. What's your point? This fact doesn't support your proposal in the slightest. You earlier made the argument that If the slice has too few elements, you've just blown away the entire iterator for no good reason. If the slice is the right length, but the iterator doesn't next raise StopIteration, you've just thrown away one perfectly good value. Hope it wasn't something important. In other words, you WERE arguing that it's very important not to lose information. Now that I show that information is ALREADY LOST in a similar scenario, you are arguing that's irrelevant. Whatever. You have argued against using a temporary array. I quote: [Aside: how do you know this is not just inefficient but *incredibly* so?] By profiling my app, looking for places to save time without having to resort to C. But that's exactly what happens in tuple unpacking: the generator on the right hand side is unpacked into a temporary tuple, and then assigned to the targets on the left hand side. Agreed. But Terry was making the (correct) argument that people using ctypes are often looking for efficiency. If the number of elements on both sides aren't the same, the assignment fails. That is, tuple unpacking behaves like (snip) Yes, and that loses information from the right hand side if it fails and the right hand side happens to be an iterator. For some reason you're OK with that in this case, but it was the worst thing in the world a few messages ago. This has the important property that the assignment is atomic: it either succeeds in full, or it doesn't occur. Not right at all. The only side-effect is to exhaust the generator, which is unavoidable given that generators don't have a length. Yes. But earlier you were acting like it would be problematic for me to lose information out of the generator if there were a failure, and now the sanctity of the information on the LHS is so much more than on the RHS. Frankly, that's all a crock. In your earlier email, you argued that my proposal loses information, when in fact, in some cases it PRESERVES information (the very information you are trying to transfer) that ISN'T preserved when this temp array is tossed, and the only information it LOSES is information the programmer declared his clear intent to kill. But that's an edge case anyway. Without temporary storage for the right hand side, you lose the property of atomicism. That would be unacceptable. As if the temporary storage workaround exhibited the necessary atomicity, or as if you have even showed a valid argument why the atomicity is important for this case. In the case of the ctypes array, the array slice assignment is also treated as atomic: it either succeeds in full, or it fails in full. This is an important property. Unlike tuple unpacking, the array is even more conservative about what is on the right hand size: it doesn't accept iterators at all, only sequences. This is a sensible default, How it works is not a bad start, but it's arguably unfinished. because it is *easy* to work around: if you want to unpack the iterator, just make a temporary list: (snip) I already said I know the workaround. I don't know why you can't believe that. But one of the purposes of the iterator protocol is to reduce the number of cases where you have to create huge lists. Assignment remains atomic, and the generator will be unpacked into a temporary list at full C speed. Which can be very slow if your list has several million items in it. If you don't care about assignment being atomic -- and it's your right to weaken the array contract in your own code Currently, there IS no contract between ctype arrays and generators. I'm suggesting that it would be useful to create one, and further suggesting that if a programmer attempts to load a ctypes array from a generator of the wrong size, it is certainly important to let the programmer know he screwed up, but it is not at all important that some elements of the ctypes array, that the programmer was in fact trying to replace, were in fact correctly replaced before the size error was noticed. -- feel free to write your own helper function based on your earlier suggestion: (snip) Doing this in Python is also slow and painful, and the tradeoff of this vs the temp list depends on the system, the caching, the amount of memory available, and the size of the data to be transferred. I could do it in C, but that defeats my whole purpose of using ctypes to avoid having to ship C code to customers. But this non-atomic behaviour would be entirely inappropriate as the default behaviour for a ctypes array. That's obviously your opinion, but your supporting arguments are quite weak. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Assigning generator expressions to ctype arrays
Bug or misunderstanding? Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) [GCC 4.5.2] on linux2 Type help, copyright, credits or license for more information. x = 32 * [0] x[:] = (x for x in xrange(32)) from ctypes import c_uint x = (32 * c_uint)() x[:] = xrange(32) x[:] = (x for x in xrange(32)) Traceback (most recent call last): File stdin, line 1, in module ValueError: Can only assign sequence of same size Thanks, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Assigning generator expressions to ctype arrays
On Oct 27, 5:31 pm, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: From the outside, you can't tell how big a generator expression is. It has no length: I understand that. Since the array object has no way of telling whether the generator will have the correct size, it refuses to guess. It doesn't have to guess. It can assume that I, the programmer, know what the heck I am doing, and then validate that assumption -- trust, but verify. It merely needs to fill the slice and then ask for one more and check that StopIteration is raised. I would argue that it should raise a TypeError with a less misleading error message, rather than a ValueError, so bug. And I would argue that it should simply work, unless someone can present a more compelling reason why not. The simple solution is to use a list comp instead of a generator expression. I know how to work around the issue. I'm not sure I should have to. It violates the principle of least surprise for the ctypes array to not be able to interoperate with the iterator protocol in this fashion. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: __dict__ attribute for built-in types
On Oct 27, 9:46 pm, candide cand...@free.invalid wrote: Le 28/10/2011 02:02, MRAB a crit : No, built-in classes written in C have certain limitations, but why would you want to do that anyway? Mainly for learning purpose and Python better understanding. Actually, I have a class of mine for drawing graphs with the Graphviz software. The nodes of the graph to be represented was supposed to have 2 attributes, say title and shortName. Now, I want to plot a graph whose nodes are pure string. So to fit the class interface, I was trying to add title and shortName attribute to every string node. You can easily do that by subclassing a string: class AnnotatedStr(str): pass x = AnnotatedStr('Node1') x.title = 'Title for node 1' etc. The fact that you subclass it (unless your subclass uses __slots__) will give it a dict. -- http://mail.python.org/mailman/listinfo/python-list
Re: signed vs unsigned int
On Jun 2, 6:25 am, John Machin sjmac...@lexicon.net wrote: On Jun 2, 4:43 pm, johnty johntyw...@gmail.com wrote: i'm reading bytes from a serial port, and storing it into an array. each byte represents a signed 8-bit int. currently, the code i'm looking at converts them to an unsigned int by doing ord(array[i]). however, what i'd like is to get the _signed_ integer value. whats the easiest way to do this? signed = unsigned if unsigned = 127 else unsigned - 256 That works, but I prefer not using if/else for things that can be described in an expression without it. Other ways of expressing this include: signed = (unsigned 127) - (unsigned 128) signed = (unsigned 127) * 2 - unsigned signed - unsigned - 2 * (unsigned 128) Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Diff of Text
On Jun 3, 9:54 pm, GZ zyzhu2...@gmail.com wrote: Hi All, I am looking for an algorithm that can compare to source code files line by line and find the minimum diff. I have looked at the difflib included in python. The problem is that it is designed to make the diff results easier for humans to read, instead of minimize the size of the output differencial. I would like an algorithm implementation that gives the absolute minimum difference between the two files. Can you help me? Thanks, gz There's an rsync.py module in pypi -- one would think that would have to solve that same problem... Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: where are the program that are written in python?
On May 21, 8:45 pm, a...@pythoncraft.com (Aahz) wrote: In article eb0c9aec-428f-45a2-a985-5b33906e0...@z17g2000vbd.googlegroups.com, Patrick Maupin pmau...@gmail.com wrote: There are a lot of commercial programs written in Python. But any company which thinks it has a lock on some kind of super secret sauce isn't going to use Python, because it's very easy to reverse engineer even compiled Python programs. That's not always true. Both my employer (Egnyte) and one of our main competitors (Dropbox) use Python in our clients. We don't care much because using our servers is a requirement of the client. Absolutely. I wrote my post after the OP's second post, and from that short, derisive tome, I inferred that the OP's definition of commercial was quite narrow, so I was trying to respond on the basis of what he would consider commercial, which BTW, probably wouldn't include a lot of programs that, e.g. Google uses to make money. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: where are the program that are written in python?
On May 21, 9:12 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: a...@pythoncraft.com (Aahz) writes: In article eb0c9aec-428f-45a2-a985-5b33906e0...@z17g2000vbd.googlegroups.com, Patrick Maupin pmau...@gmail.com wrote: There are a lot of commercial programs written in Python. But any company which thinks it has a lock on some kind of super secret sauce isn't going to use Python, because it's very easy to reverse engineer even compiled Python programs. That's not always true. Both my employer (Egnyte) and one of our main competitors (Dropbox) use Python in our clients. We don't care much because using our servers is a requirement of the client. Doesn't that mean those companies don't fit the above description? That is, neither of them “thinks it has a lock on some kind of super secret sauce” in the programs. So they don't seem to be counter-examples. Just because someone has competition doesn't mean they don't think they have secret sauce. I think Aahz's main point was that in his sub- industry, the secret sauce is guarded by not actually letting the customer have access to executable code, other than through the network. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: where are the program that are written in python?
On May 22, 2:43 am, sturlamolden stu...@molden.no wrote: On 21 Mai, 20:20, Patrick Maupin pmau...@gmail.com wrote: Also, any company in a competitive market where execution speed is extremely important might choose some other language because, frankly, the fact that a development tool is highly productive is not something that the end user directly cares about. That only applies to CPU bound program code (most program code is I/O bound), and only to computational bottlenecks (usually less than 5% of the code) in the CPU bound programs. Today, most programs are I/O bound: You don't get a faster network connection or harddrive by using C. In this case, performance depends on other factors than choice of language. That is why Mercurial (written in Python) can be much faster than SVN (written in C). For computational bottlenecks we might want to try high-performance numerical libraries first. If that does not help, we can try to replace some Python with C. Python as glue does not mean Python is inferior to C. It just means it is a PITA to write C or Fortran all the time. I value my own time a lot more than a few extra CPU cycles. Who cares about speed where it is not needed? I think we're in violent agreement here -- you neglected to quote the part where I said (But the up-front choice of another language simply for speed, rather than prototyping with Python and then recoding the slow bits, would probably be a decision borne of ignorance.) Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Another Go is Python-like article.
On May 22, 5:00 am, Michele Simionato michele.simion...@gmail.com wrote: On May 21, 4:20 pm, Grant Edwards inva...@invalid.invalid wrote: What about Go, exactly, do people see as Python-like? The philosophy of keeping things simple. I find the concurrency mechanism quite Pythonic. That's nice. Moreover Go interfaces are quite akin to Python duck typing, but better. That's nice too. There also things which are quite different from Python e.g. the attitude towards exceptions. That's a biggie. One of the beautiful things about Python is how it lets me incrementally deal with incompletely specified problems -- here's some source data -- go do something useful with it. The FAQ discusses why the go language deliberately leaves out assert -- the developers rightly view assert statements as problematic in achieving 5 nines in a server environment, and they (somewhat incorrectly IMO) view them as problematic when testing things. Looking at their rationale, it is appears that one or more of the primary go developers had to deal way too often with people who overuse and abuse exceptions, so they are reverting to an almost childish I'll fix their little red wagon! When they have to use *my* language, they won't be able to do that anymore! kind of mentality. Another possibility is that they viewed the complexity of exceptions as interfering with their primary goals, and felt it necessary to rationalize their absence after the fact. For some kinds of programming, the lack of exceptions wouldn't keep me from programming Pythonically, but for huge classes of problems, it would. That's a big deal for me personally -- although I like to have lots of tools in my toolbox, the one I reach for when doing exploratory programming is probably going to have exceptions. And guess what? If the exploratory programming winds up being good enough (as often happens), then no recoding is required. In theory Go should be akin to C, but my gut feeling is that in practice programming in it should not feel too much different from programming in Python (but I do not have first hand experience). For well-specified problems, I might be able to agree with you, but I'm not sure. Even then, sometimes I build stuff incrementally, trying out various kinds of internal interfaces. During that development process, exceptions are a valuable mechanism for ensuring that both sides of an interface agree on the contract. (Obviously, unit testing is useful in this as well, but premature unit testing can add friction that makes it difficult to converge on an optimal design -- it's no fun to be continually rearchitecting unit tests because of other design decisions.) What will be interesting to see is if a culture develops inside google where people prototype in Python or some other language and then implement the final cut in go. If this happens often enough and the cost of recoding the final implementation is deemed high enough, then the natural question will be What can we add to go to make it a better prototyping language? Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: where are the program that are written in python?
On May 22, 1:49 pm, Terry Reedy tjre...@udel.edu wrote: Because, as I said, and as you explain further, Python favors programmer speed, including speed of testing new algorithms, over raw execution speed of current algorithms. (Current) speed is (also) easier to test than improvability and hence possible speed improvements. First of all, I don't think you and Lie have any basic disagreements. The key realization is that the quantitative difference in programmer speed you mention is so large (orders of magnitude) that, for many classes of problems, it is not just *possible*, but actually *probable*, that a Python implementation *will be faster* than a C implementation. Yes, you are absolutely correct that most Python programs can be made faster by adding a bit of C, but that doesn't negate the fact that if I can throw 'x' man-hours at a problem, for lots of real-world values of 'x' and of 'the problem', a pure Python implementation will run rings around a pure C implementation, assuming the C implementation even works by the time I've burned through 'x' hours. I discussed this a bit on this newsgroup over five years ago, and the points are still pertinent: http://groups.google.com/group/comp.lang.python/msg/910a54ddec946567 If and when mercurial deveopment slows down, some of its developers might consider whether any of the utility functions written in Python might usefully be rewritten in C. One of the intentional virtues of Python is that one can transparently convert part or all of a module *without changing* the import and use of the module. I don't even think that Mercurial development has to slow down to decide to recode a few things in C. A tiny bit of C at the right place can often provide more than enough leverage to be worthwhile, and be small enough to throw away if need be. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: where are the program that are written in python?
On May 21, 10:30 pm, Chris Rebert c...@rebertia.com wrote: Erm, in fairness, I recall hearing that some speed-critical bits of hg are written in C. It does lend credence to the Python as glue language argument though; I doubt hg's extensibility and friendly interface would have been as easy to implement it C (particularly the slick instant-server feature). Is C viewed as a glue language in those environments where it is the primary tool and sometimes some small bits are recoded into assembly language for speed? Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Another Go is Python-like article.
On May 22, 6:14 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sat, 22 May 2010 12:13:30 -0700, Patrick Maupin wrote about the lack of exceptions in Go: Looking at their rationale, it is appears that one or more of the primary go developers had to deal way too often with people who overuse and abuse exceptions, so they are reverting to an almost childish I'll fix their little red wagon! When they have to use *my* language, they won't be able to do that anymore! kind of mentality. Another possibility is that they viewed the complexity of exceptions as interfering with their primary goals, and felt it necessary to rationalize their absence after the fact. That's two possible explanations. A third is that they genuinely believe that exceptions lead to poor programming practice and left them out, just as the designers of many other languages believe that goto leads to poor practice and leave it out as well. I don't think there's necessarily anything childish about choosing to leave out a language feature that you think is bad from a language you design. While I admit that childish is an inflammatory simplification, other than that, I think that your possible explanation is, essentially, identical to my first possibility -- why would you think exceptions were bad if you didn't have first-hand evidence of that? Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: where are the program that are written in python?
On May 21, 5:21 am, Deep_Feelings doctore...@gmail.com wrote: i could not see many programs written in python Well you could try PyPi, or even a search on googlecode. (i will be interested more in COMMERCIAL programs written in python ). What do you mean by commercial, and why? and to be honest ,i tried some of the programs in that list and all the programs that i tried either dead projects or so buggy ! So, you want us to believe that you desperately want to pay someone for working Python software, but are finding it hard to find some? 1- where are the programs that is written in python ? All over the place. 2- python is high productivity language : why there are no commercial programs written in python ? There are a lot of commercial programs written in Python. But any company which thinks it has a lock on some kind of super secret sauce isn't going to use Python, because it's very easy to reverse engineer even compiled Python programs. Also, any company in a competitive market where execution speed is extremely important might choose some other language because, frankly, the fact that a development tool is highly productive is not something that the end user directly cares about. (But the up-front choice of another language simply for speed, rather than prototyping with Python and then recoding the slow bits, would probably be a decision borne of ignorance.) is python a valid practical programming language ? Absolutely. I've been using it heavily for 11 years, for real work, for which I get paid. why it is not used in commercial software ? What makes you think that it's not? Is this some kind of big lie strategy? To what end? any help will be appreciated It's hard to help when you don't describe the problem. Reading between the lines, the most charitable and probable interpretation of your problem I can come up with is that you think you're going to create a multi-billion dollar computer program and you're desperately trying to validate your preconceived notion that Python isn't the language to write it in. Sorry, but I can't help with that. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: starting repl programmatically
On May 20, 6:57 pm, Brendan Miller catph...@catphive.net wrote: I have a python script that sets up some environmental stuff. I would then like to be able to change back to interactive mode and use that environment. What's the best way to do that? import cmd class MyCmd(cmd.Cmd): ... def default(self, line): ... exec line in globals() ... MyCmd().cmdloop() (Cmd) s = 'The answer is probably to use %s' (Cmd) print s % 'the cmd module' The answer is probably to use the cmd module (Cmd) Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: optional argument to a subclass of a class
On May 20, 9:56 pm, Alex Hall mehg...@gmail.com wrote: Hi all, I am now trying to allow my classes, all of which subclass a single class (if that is the term), to provide optional arguments. Here is some of my code: class Craft(): def __init__(self, name, isAircraft=False, id=helpers.id(), hits=0, weapons=[]): self.name=name self.id=id self.hits=hits self.weapons=weapons self.isAircraft=isAircraft #end def #end class #now a class for each type of craft in the game #each will subclass the Craft class, but each also has its own settings class Battleship(Craft): def __init__(self, name, maxHits): Craft.__init__(self, name) self.maxHits=maxHits self.length=maxHits #in Battleship, each ship's length is the same as how many times it can be hit #end def #end class I want to be able to say something like b=Battleship(battleship1, 4, weapons=[missile1,missile2]) When I do that, though, I get a traceback on the above line saying type error: __init__() got an unexpected keyword argument 'weapons'. What did I do wrong / what do I need to change so that any Craft (Battleship, Carrier, and so on) can optionally provide a list of weapons, or any other arguments to which I assign default values in my Craft class? I hope this makes sense. -- Have a great day, Alex (msg sent from GMail website) mehg...@gmail.com;http://www.facebook.com/mehgcap You overrode the __init__method from the superclass. One thing you can do is in battleship, you can accept additional keyword arguments: def __init__(self, name, ..., **kw): Then you could invoke the superclass's init: Craft.__init__(self, name, **kw) Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: optional argument to a subclass of a class
On May 20, 10:35 pm, Alex Hall mehg...@gmail.com wrote: So how do I get at anything inside **kw? Is it a list? It's a dictionary. Use *args for a list. (As with self, the name is whatever you want to use, but some sort of consistency is nice.) One of the cool things about Python is how easy it is to play at the command prompt: def foo(x=3, y=7): ... print x,y ... def sam(**kw): ... print kw ... foo(**kw) ... sam(x=5) {'x': 5} 5 7 sam(y='hi there') {'y': 'hi there'} 3 hi there sam(z=42) {'z': 42} Traceback (most recent call last): File stdin, line 1, in module File stdin, line 3, in sam TypeError: foo() got an unexpected keyword argument 'z' Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Newbie Alert: subprocess.call
On May 19, 9:27 pm, Carbon nob...@nospam.tampabay.rr.com wrote: I am new to Python and am trying to write a GUI wrapper script in python 2.5 to get username and passwords from Linux users to send as options to run an app on a 2X terminal server. I came across the easygui module and its multpasswordbox function, which made popping a dialog box and storing the usernames very painless. However, subprocess.call as implemented below doesn't work. For some reason the -s ts.mycompany.org:80 parameter is being interpreted differently by the application when sent from the python script than it does when sent from the BASH script below. The :80 is the default port so it isn't technically required, but the script doesn't work without it either. Any ideas where I should look? Is subprocess.call the best way to do what I want? Any advice would be most appreciated. Here's the broken bit: print Reply was:, fieldValues print Reply was:, fieldValues[0], fieldValues[1] subprocess.call([/opt/2X/Client/bin/appserverclient, -u fieldValues [0], -p fieldValues[1], -s ts.mycompany.org:80, -d corp, -S local, -c 16, -e 0xF, -l 0x0409, -a #1]) Output: m...@work:~/bin$ ./demo2.py Reply was: ['MyUsername', 'MyPassword'] Reply was: MyUsername MyPassword ERROR in CTcpConnector: ts.mycompany.org: unable to resolve host Error 7: TCP/IP connection: unable to resolve host. This BASH script runs correctly: m...@work:~/bin$ cat 2xconnect #!/bin/bash USER=$1 PASS=$2 /opt/2X/Client/bin/appserverclient \ -u $USER \ -p $PASS \ -s ts.mycompany.org:80 \ -d corp \ -S local \ -c 16 \ -e 0xF \ -l 0x0409 \ -m 2G \ -a #1 I think, for example, instead of -d corp, you want -d and corp in your list. I usually make a string like I would pass to bash, and then do .split() on it to get the list. This works fine unless you need embedded spaces anywhere. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Newbie Alert: subprocess.call
On May 19, 10:28 pm, Ben Finney ben+pyt...@benfinney.id.au wrote: Better is to use ‘shlex.split’ to split the string as a shell parser would do URL:http://docs.python.org/library/shlex#shlex.split. Good point. I always forget about shlex.split because I'm usually passing (relatively) constant strings with no funny quoting. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 18, 11:03 am, Robert Kern robert.k...@gmail.com wrote: On 2010-05-16 09:25 , Ed Keith wrote: No, the GPL makes it clear that the responsibly is on the distributor to either supply the source or written notice, Caveat venditor. The violation exists regardless of whether or not the recipient makes a request. No, one of the options for you is that you make the source available upon request. Do you have a citation for that? My reading, of both GPL v2 section 3 and GPL v3 section 6, is that someone distributing GPL licensed object must do one of the following: - supply the source with the object - supply a written offer for source with the object - supply a copy of someone else's written offer for source with the object (only allowed sometimes) - Perhaps verbally communicate an offer (GPL v2 only, very liberal reading of 3c, but even then the communication must accompany the object distribution). - supply object by offering access from a designated place as long as you offer equivalent access to the Corresponding Source in the same way through the same place or you maintain clear directions next to the object code saying where to find the Corresponding Source. That last one effectively has written offer defined in a slightly different way (maintain clear directions), and also might allow you to just have a pile of source DVDs adjacent to a pile of object CDs with no explicit written offer, but I honestly can't see how even that can be stretched to cover just handing somebody an object CD without even mentioning that source is available, and then only later giving them source if they explicitly ask for it. Sure, if you give somebody source after they ask for it, you have probably cured any violation, but I think the very act of handing someone an object CD without source or a written offer of source would put you in violation of the license at the time you give them the object CD. It may be that saying oh, by the way, source code's available if you want it would suffice in some cases under GPL v2, but it doesn't look like that would work at all for GPL v3. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: recall function definition from shell
On May 18, 12:31 pm, superpollo ute...@esempio.net wrote: def myfun(): ... return WOW ... myfun() 'WOW' now, i would like to list the funcion definition, something like this: myfun.somethinglikethis() def myfun(): return WOW is there something like this around? bye Sure, just give it a docstring and then you can call help on it: def myfun(): ... ''' myfun returns WOW when called. ... This is just a Python __doc__ string ... ''' ... return WOW ... help(myfun) Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: recall function definition from shell
On May 18, 1:41 pm, superpollo ute...@esempio.net wrote: Patrick Maupin ha scritto: On May 18, 12:31 pm, superpollo ute...@esempio.net wrote: def myfun(): ... return WOW ... myfun() 'WOW' now, i would like to list the funcion definition, something like this: myfun.somethinglikethis() def myfun(): return WOW is there something like this around? bye Sure, just give it a docstring and then you can call help on it: def myfun(): ... ''' myfun returns WOW when called. ... This is just a Python __doc__ string ... ''' ... return WOW ... help(myfun) Regards, Pat mmm... thanks but not quite what i meant :-( bye Well, I don't think Python remembers exactly how you typed it in, but you can always ask Python for what it remembers about the function: def myfun(): ... return WOW ... import dis dis.dis(myfun) 2 0 LOAD_CONST 1 ('WOW') 3 RETURN_VALUE The inspect module is useful, as well. But AFAIK Python doesn't remember the source code for stuff you typed in. (For functions in imported modules, there is sufficient information remembered for tracebacks to allow you to print out the lines of a function.) Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: help need to write a python spell checker
On May 14, 3:19 am, harry k hkiri...@yahoo.com.au wrote: Write a spell checking tool that will identify all misspelled word in a text file using a provided dictionary. Well, this has been educational. Both my daughters just finished their final exams last week, so I was confused about seeing the homework assignment. Then I saw the email address. Although it makes perfect sense, I never really thought much about the possibility that the school year would be upside down down under... Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: python application question
On May 17, 8:20 am, a oxfordenergyservi...@googlemail.com wrote: ps someone helped me with enumerate(), which works on the linux but not on the windows? enumerate() works fine on windows. Perhaps your windows box has a really old Python? Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: classes and __init__ question
On May 17, 3:19 pm, Alex Hall mehg...@gmail.com wrote: Hi all, I am a bit confused about classes. What do you pass a class, since all the actual information is passed to __init__? For example, say you have a dog class. The dog object has a name, a size, and a color. I believe you would say this: class dog(): def __init__(self, name, size, color): self.name=name self.size=size self.color=color #end def #end class What, then, gets passed to the class constructor? class dog(whatGoesHere?): Sometimes I see things passed to this. For example, if you create a class for a wxPython frame, you will say: class myapp(wx.App): In this case you pass something. However, I have a class that I use in one of my programs to create contact objects, which looks like this: class contact(): def __init__(self, name, email, status, service): self.name=name self.email=email self.status=status self.service=service #end def #end class Here, I do not pass anything to the class, only to __init__. What is going on? On a related note, is it horrible for resource usage to create a large array, up to 500 or so, where each member is a small object? I am thinking of, for example, a game board array where each member of the array is a square object. A square might have a status, a color, and other flags associated with it, so you could then say something like board[i][j].hasGamePiece=True. Lookups and adjustments like this will be going on a lot. Am I better off using an array of numbers where each number means something different? Thanks in advance for any info. -- Have a great day, Alex (msg sent from GMail website) mehg...@gmail.com;http://www.facebook.com/mehgcap What you are calling passing to a class is the superclass (or list of superclasses) if you are creating a subclass. Under Python 2.x, you might want to subclass object (if you need/want a newstyle class), so it is fairly common to see: class foo(object): whatever Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: classes and __init__ question
On May 17, 3:55 pm, Alex Hall mehg...@gmail.com wrote: So what is a subclass compared to a class? Are you saying that what is passed to the class, so what is in the parentheses of the class, is really the superclass? If so, what is the advantage of doing this; why not just create a class that is not a sub? I thinking I am missing something elementary here. :) A subclass can inherit methods and attributes from a base class. This is not necessary, but is sometimes useful. In Java, a class is an object. Is Python the same thing? Yes, a class is an object. A class's class is its metaclass. An instance of a class is also an object. Would you say that my dog class, for example, creates a new dog object when an instance is instantiated? Yes. But the actual act of coding something like: class foo(object): pass Creates a class object, which is a subclass of the 'object' object, and is an instance of the 'type' object. Since Python is so dynamic, you can easily determine this at the command prompt: class foo(object): ... pass ... x = foo() type(x) class '__main__.foo' type(foo) type 'type' Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: getting attributes and methods of class without creating object
On May 17, 10:52 pm, shuvro shuvr...@gmail.com wrote: Suppose I have a class like this - class myClass(object): def __init__(self): self.a = 10 self.b = 20 def my_method(self,var = 20): self.local_var = var I want to know about its method(__init__ and my_method) and variables(a,b, local_var) without creating the object of it. I tried getmembers function of inspect module. But it can do this with an object of myClass as argument. Like import inspect var = myClass() inspect.getmembers(var) I have to know about this without creating the object of myClass. Can anyone help me please? Well, you can do the same thing with myClass itself: inspect.getmembers(myClass) But that won't show you a,b, or local_var, because those don't belong to the class. They only belong to class instances, and maybe even not all class instances. (For example, if my_method is not called, then the instance won't have local_var defined.) Python is a very dynamic language, and class instances (and even the classes themselves!) can be modified at any time during execution. You don't even have to be executing inside a class's function to add stuff to it: class foo: pass bar = foo() bar.a = 3 So to know about the attributes of an instance of a class without actually creating that instance is very difficult. You didn't specify why you want to do this, but often the reason is to try to catch potential errors without actually running code. This is typically called linting, and there are a few Python packages designed to do this, such as pylint and pychecker. Probably others, but I don't know anything about them, because I find that in most cases, the best way to test or to reason about Python code is to actually run it. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 16, 9:19 am, Ed Keith e_...@yahoo.com wrote: --- On Sat, 5/15/10, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: But what about the “freedom” to take away other people’s freedom? Is that really “freedom”? Yes. But that’s a “freedom” that non-GPL licences do not give you, that the GPL does. So which licence gives you more “freedoms”, again? [ stuff snipped] There is clearly some kind of communication problem here. Either were are speaking different languages with some faulty transaction program interviewing, or one of is is either stupid or senile (seems a bit early for me, but it is possible); or you are being disingenuous. Lawrence is certainly being overly clever. He is somewhat technically correct, but is playing a shell game where he moves around who the potential freedom giver is and who the potential freedom receiver is. The problem is, you have to handle this sort of argument very carefully, or someone will come along and then point out (again, somewhat technically correctly) that copyright law restricts the freedoms, and the GPL license only gives them out, so where's the problem? It's easy to lose sight of where the pea is, particularly when you were expecting straightforward communication rather than this sort of sophistry. When people in this thread previously said that permissive licenses give you the freedom to take away others' freedoms, but the GPL does not, the you they are referring to is a person who has received the software from someone else. When Lawrence is now saying that the GPL gives you the freedom to take away others' freedoms but other licenses do not, the you he is referring to is the author of the software, who I think we all agree retains more freedom to restrict others' freedoms if he uses the GPL than if he uses a permissive license. So in this instance, the thing that disappeared under the shell where you thought it was and reappeared under a different shell was the very definition of the word you. But don't feel bad; some of the thimbleriggers around here are quite accomplished, and very hard to catch out. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: imports and exec
On May 16, 1:51 pm, Paul Carter pacman...@gmail.com wrote: We are using python for our build system. Each subproject dir has a python script that builds it. Parent dirs have python scripts that recurse into their children and use exec to invoke the python scripts. Recently we discovered that one of the python scripts works when invoked directly, but fails when invoked with exec. I've created a very simple pair of python scripts that demonstrates the problem. (We're using python 2.6) Can someone explain or point to a good explanation of why this problem occurs? I have two python files: prim.py and sec.py. prim.py: - #!/usr/bin/env python ##sec2 = open('sec.py') ##exec sec2 def invoke(): sec = open('sec.py') exec sec invoke() -- and sec.py: -- import sys def sec(): print('Inside sec(): ' + str(sys.argv)) print('Outside sec(): ' + str(sys.argv)) sec() -- When I run prim.py, I get an error: Outside sec(): ['./prim.py'] Traceback (most recent call last): File ./prim.py, line 10, in module invoke() File ./prim.py, line 8, in invoke exec sec File sec.py, line 7, in module sec() File sec.py, line 4, in sec print('Inside sec(): ' + str(sys.argv)) NameError: global name 'sys' is not defined -- I don't understand why the sys import is not visible in the sec() function. I can fix this by adding a: global sys or import sys inside the sec() function. But I would like to understand why this is necessary, especially since sys is visible in sec.py outside of the sec() function. I found this page discussing exec http://docs.python.org/reference/executionmodel.html but I'm afraid I couldn't quite follow it. It makes me think that a free variable is involved, but I don't see how. It did made me try invoking exec in prim.py outside of the invoke() function (see the commented out code). Everything worked fine when I did that. Can someone set me straight? Suggestions on avoiding this problem are welcome as well! Thanks in advance. Yes. Since you did not pass any dictionaries to your exec of sec, sec inherited the globals and locals from the calling function. So the import of sys happened in that functions locals (bad practice in any case) and the globals used by sec() are the globals of your main module. Especially if invoked from inside a function, you should always pass a dict to exec. Just exec sec() in {} will do the trick. But if you want to use your caller's dictionaries, you can do exec sec() in globals() But you should *not* use a functions locals directly if you are going to modify them (as you are currently doing). Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: global variables in imported modules
On May 16, 4:42 pm, vsoler vicente.so...@gmail.com wrote: Taken fromwww.python.org, FAQ 2.3 How do I share global variables across modules? config.py: x = 0 # Default value of the 'x' configuration setting mod.py: import config config.x = 1 main.py: import config # try removing it import mod print config.x The example, such as shown in the website, works perfectly well. However, I don't fully understand why I have to import config in main.py, since it has already been imported by mod.py. As the website explains, there is only one module namespace for each module, and mod.py has aleady created the config namespace by importing it. Why should I import it again in main.py if that namespace already exists? If I remove - import config # try removing it in main.py, the application does not run What am I missing? What you are missing is that the interpreter has to look *inside* a namespace in order to actually find the object associated with a name. As you found out, there is a namespace per module. So main.py's namespace is where the code in main.py will search for variables. If 'mod' imports config, then the 'mod' module's namespace is updated with 'config' - the config module. But the act of 'mod' importing 'config' will not alter the namespace of 'main' at all. So if you want to access variable 'x' inside 'config' from main you can either import config directly into main and access it as config.x, or you can import config into mod and import mod into main and access it as mod.config.x. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: global variables in imported modules
On May 16, 5:38 pm, James Mills prolo...@shortcircuit.net.au wrote: On Mon, May 17, 2010 at 8:26 AM, vsoler vicente.so...@gmail.com wrote: However, can I be 100% sure that,no matter how I access variable 'x' (with config.x or mod.config.x) it is always the same 'x'. I mean that either reference of 'x' points to the same id(memory position)? Yes it does unless you re-assign it. --James To expand a bit on what James is saying: If, for example, inside your main module, you got tired of typing mod.config.x everywhere you were using it, and decided that you could make a local reference to the same variable: x = mod.config.x Now, whenever you use just plain x inside the main module, you are also referencing the exact same object, *until* some other function decides to do: mod.config.x = y At this point in time, the 'x' inside main references the object that mod.config.x originally referenced, but mod.config.x now references a different object. Unlike C, for example, where the assignment operator physically places an item into a specific memory location (either fixed globally or within a stack frame), the assignment operator in python simply stores a key/value pair into a namespace dictionary. So whenever you retrieve a value from the dictionary using that key, you will get the value that was last associated with that key. So, 'mod.config.x' will first retrieve the object associated with the key 'mod' from the main module's namespace dictionary, then will retrieve the object associated with the key 'config' from that module's namespace dictionary, then will retrieve the object associated with the key 'x' from that module's namespace dictionary. Unless you later modify any of those key/value pairs, subsequent retrieval will always result in the same final value. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 15, 12:50 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Fri, 14 May 2010 08:37:14 -0700, Patrick Maupin wrote: The most obvious example was that the University of Berkley counter-sued Unix System Laboratories over USL's infringement of the BSD licence. Well, I specifically excluded BSD for this reason. But in any case, I'd be willing to place a small wager that it's the *only* (rather than merely the most obvious) example you can find... Admittedly this wasn't the MIT or Apache licence, and the circumstances were fairly special. It's a fairly safe bet that anyone who is distributing their software under such a licence is sending an implicit signal that they don't intend to sue. Right. But it does demonstrate that MIT- style licences aren't the same as public domain -- they do impose obligations on the recipient, even if those obligations are much lighter than those of the GPL. And I certainly have never deliberately attempted to mislead on this point. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 15, 1:34 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Fri, 14 May 2010 19:17:20 -0700, Patrick Maupin wrote: On May 14, 9:04 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 548024fc- dd56-48b9-907d-3aa6a722b...@l31g2000yqm.googlegroups.com, Patrick Maupin wrote: The confusion that some are showing in this thread about whether source must be distributed certainly helps to show that as well. What “confusion”? The GPL requires that source must always be offered in some form. Simple as that. Right, but when I explained that that requirement also applies to Joe, who downloaded an ISO from Ubuntu and burned a CD and gave it away, no less than 3 people jumped in to correct me. The confusion is over what form that offer may be, and what counts as distribution. Your claim seems plausible, but whether it is correct or not is not so obvious. Exactly. And when people say it's obviously incorrect, they're obviously incorrect, because if it were obvious, it would have been answered correctly by now :-) I would say that, given the lack of any lawsuits against individuals and Linux User Groups, the *intention* of the GPL is to allow individuals to act as a proxy between the end-user and the actual distributor (in this case, Ubuntu) without taking on the obligation to provide source code. Yes, and as I said, lawsuits against individuals would be bad for business (as business is defined in the GPL world). Looking at the FAQs, my comments in square brackets: http://www.gnu.org/licenses/gpl-faq.html#WhatDoesWrittenOfferValid Well, for one thing, that section is only *directly* relevant to GPL v2. For another thing, it is only directly relevant to Canonical's obligations, not Joe's. [Text snipped; part of d'Aprano interpretation left] [I am obliged to tell my friend they can get the Ubuntu written offer from Ubuntu's website, and pass it on directly if asked] Sure, and that's *exactly* what I said isn't going to happen in a lot of cases, because it takes a careful reading of the license and FAQ for someone to realize that. The download button at Ubuntu tells you to make more copies (your rights) without telling you about the source code (your obligations). Which is perfectly legal, but someone who isn't reading carefully could easily give a CD to a friend without the offer of source. This means that people who did not get the binaries directly from you can still receive copies of the source code, along with the written offer. More obligations on the part of Canonical; note, however, that Canonical's obligation to distribute source to a CD that you gave to a friend may not even be long enough to cover 3 years after the time you gave the CD to your friend. The reason we require the offer to be valid for any third party is so that people who receive the binaries indirectly in that way can order the source code from you. [In other words, if I give Fred a copy of Ubuntu, it is Canonical and not me who is responsible for providing the source code to Fred if he asks for it.] Okay, it's not the licence itself, but the FAQ pretty much makes the intention clear. Yes, it does. The FAQ part you quote is for Canonical and for v2. The one for the user handing over the CD still says (for v3): I downloaded just the binary from the net. If I distribute copies, do I have to get the source and distribute that too? Yes. The general rule is, if you distribute binaries, you must distribute the complete corresponding source code too. The exception for the case where you received a written offer for source code is quite limited. But, even if you fall under that limited exception, you *still* have to make the written offer, and I stand by my assertion that even that token act is not happening in lots of cases as we speak. Merely handing over an Ubuntu DVD to a friend is not a violation of the GPL. ... as long as you make the written offer. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 8:04 am, Ethan Furman et...@stoneleaf.us wrote: Steven D'Aprano wrote: You've never had to recode something because it was nominally available under a proprietary licence that you (or your client) was unwilling to use? Lucky you! Steven, did you actually read what he wrote? If you did, why would you say something so stupid? Well, in Steven's defense, my literal words ... labor that could have been spent elsewhere if someone else had done something differently. The only time that comes into play in my programming life is when I have to recode something that is nominally available under the GPL... could easily be taken to mean that I have never had to recode something that was under a proprietary license. In truth most of what any of us write is probably very similar to stuff that others have written, so taken in a very literal sense, yes, obviously, there are several times that I have had to recode proprietary software. But I was responding to Brendan's broken window analogy, and, rightly or wrongly, I *assumed* he was only referring to software that was free *at one time* but then was somehow taken out of the commons. To my knowledge, I've never recoded such software, and to the extent that anybody might be suggesting that *all* software belongs in an easily-accessible commons and that nobody should ever have to recode anything -- well, I could probably be seduced by the Utopian vision, but I strongly reject that the sort of rights-pooling mandated by the GPL is the single way to get there. If everybody believes in the Utopian vision, the GPL is rendered unnecessary, and to the extent that some people *really* don't believe in the Utopian vision, the wording of the GPL makes a gentle transition from proprietary to free difficult for programmers with feet in both camps. However, the GPL *does* provide a core focal point for the actual Utopian vision itself, and this does serve a useful purpose. Personally, I think we are gradually lurching towards the Utopian vision, and probably at a faster pace than if we only had the GPL or if we only had permissive licenses. I think even RMS believes this; as a matter of practicality he will suggest the LGPL or even permissive licensing under some circumstances. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 15, 12:49 pm, Albert van der Horst alb...@spenarnc.xs4all.nl wrote: In article 7bdce8a7-bf7d-4f1f-bc9d-1eca26974...@d27g2000yqc.googlegroups.com, Patrick Maupin pmau...@gmail.com wrote: SNIP That is correct. All privileges as you put it are merely things that a user can do with the code without fear of a lawsuit by the author, and when an author uses a permissive license, he indicates that the things that he could possibly find egregious enough to sue over are very few. For example, if you give an Ubuntu CD to your friend without giving source code or a written offer of source code, you have violated the license on quite a few of the programs on the CD, but not, for example, on Python or Apache, because these licenses do not attempt to forbid you from doing this. Bit this is stupid! The GPL is to accomplish a political goal, an operating system with tools available to all, that can be modified by anybody capable of doing so. Sure. Enforcements not amenable to that goal will not happen. Absolutely agreed. I have no real problem with that. I *do* have a problem with some of the faithful acting like I'm completely wrong and trying to actively mislead about how the license works, but then I guess that's par for the course for politics. It might surprise even RMS himself but ... The political goal has been large and by accomplished at the expense of great legal effort and great efforts of Linus Torvalds. Agreed. c.s. Without the GPL Linux would not exist -- except in the form of an academic exercise Not sure that's true. Linus would have picked *some* license. Possibly something like the BSD. He started development using Minix, which certainly wasn't licensed freely, and which was first released 2 years before the GPL, so the GPL was not instrumental in providing his first development environment. He might have had to choose a different compiler if GCC weren't available, but there was a compiler with Unix. I can believe that the GPL helped Linux gain some momentum it wouldn't have had otherwise, but I reject your absolute assertion. -- and neither would gcc, Well, not gcc itself, but there were compilers around... so neither would Python. That I *completely* disagree with. Python was written for the amoeba O/S, which was in existence and had compilers a good 3 or 4 years before the first release of gcc. By proxy I estimate that none of the software with a permissive license you mention would not be available. I disagree. If Linux weren't around, MS would not be the sole winner. Free development would have coalesced around one of the BSDs (which in absolute numbers are still pretty big projects right now, in any case, just lacking the mindshare of Linux). As apache and other projects have shown, the propensity of the few to try to lock things up can easily be overcome with sheer numbers and willpower -- no reciprocal license required. You seem to imply that RMS is a nasty guy. I think we both agree that people who make history are often unreasonable. I really don't have a problem with that, but I do have a problem with apologists claiming it isn't so in his case. Yes, RMS is a nasty guy. All warriors are! Get in his way and you're blasted. So maybe you're not one of the ones I have a problem with. But some warriors fight for a right cause ... This really has nothing to do with anything. The meek will inherit the world, yes, but only after the second coming. If you read all the posts carefully, you will see that people arguing that sometimes permissive licenses are the right ones also allow a place for the GPL. It is only some of the GPL adherents who accuse some of the non-believers of acting duplicitously, with malice, of being against freedom. I reject that characterization of myself, and when people accuse me of this, I mentally place them in the category of religious nutter. Once I have placed someone in that category, it is sometimes hard for me to respond civilly to them, especially when they write something stupid. I have not yet placed you in that category, but I do categorically reject your interpretation of some of the relevant historical events. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 15, 2:59 pm, Paul Boddie p...@boddie.org.uk wrote: [Rest of the post, that contains points previously debated and well- refuted, snipped] Any claim that a licensing change is needed merely to let people develop open source applications on the platform is dishonest, See, there you go again, impugning the motives and character of others. Is it really that surprising that sometimes others get annoyed by this and start to assume things about your personality that you disagree with? especially as the about page for PySide spells out the licensing objective. Yes, it does: PySide is licensed under the LGPL version 2.1 license, allowing both Free/Open source software and proprietary software development. Take away the proprietary software requirement and you might as well use the GPL. You obviously agree that PySide was coded as a direct replacement for PyQt, for licensing reasons, so certainly there's a perception that *something* is wrong with PyQt's license. Let's see what the PyQt license page has to say about it: PyQt is available under the following licenses. * GNU General Public License v2 * GNU General Public License v3 * PyQt Commercial License Hmm, the only thing that PySide seems to allow that is missing from this list seems to be the O in FOSS. But of course, you already knew that, because I already explained it, and as you've told me that you read and think about everything very carefully, obviously your objective in repeating this nonsense is to mislead and confuse. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: write a 20GB file
On May 15, 7:09 pm, Dave Angel da...@ieee.org wrote: Nathan Rice wrote: This is precisely the situation mmap was made for :) It has almost the same methods as a file so it should be an easy replacement. snip Only on a 64bit system, and I'm not sure it's even possible there in every case. On a 32bit system, it would be impossible to mmap a 20gb file. You only have 4gb of address space to play with, total. DaveA -- http://mail.python.org/mailman/listinfo/python-list
Re: write a 20GB file
On May 15, 7:09 pm, Dave Angel da...@ieee.org wrote: Nathan Rice wrote: This is precisely the situation mmap was made for :) It has almost the same methods as a file so it should be an easy replacement. snip Only on a 64bit system, and I'm not sure it's even possible there in every case. On a 32bit system, it would be impossible to mmap a 20gb file. You only have 4gb of address space to play with, total. DaveA Well, depending on the OS, I think you could have multiple mappings per file. So you could maintain your own mapping cache. That could get a bit ugly, but depending on what you are doing, it might not be too bad. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 8:47 am, Paul Boddie p...@boddie.org.uk wrote: On 14 Mai, 05:35, Patrick Maupin pmau...@gmail.com wrote: I mean, it's in English and very technically precise, but if you follow all the references, you quickly come to realize that the license is a patch to the GPL. It is a set of exceptions applied to version 3 of the GPL, done this way so that the exceptions machinery of the GPL can be used to remove them if desired, as opposed to getting into the business of allowing people to relicense works from the LGPL to the GPL, as was the case with previous versions of these licences. You don't even have to read as far as the first clause of the LGPL terms to be told this, but I guess there's more sport in taking cheap shots at the authors than reading three lines down from the top of the text. Paul That's not a cheap shot. It's a (programmer) technical description of how the licenses interact, along with an opinion that it would be easier to read otherwise, along with a quoted snippet that shows (at least to me) that these are really quite complicated licenses. The confusion that some are showing in this thread about whether source must be distributed certainly helps to show that as well. Now, it may well be, and probably is, that the licenses are as simple as they can be for the desired effect, but that doesn't make them simple. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 9:10 am, Ed Keith e_...@yahoo.com wrote: --- On Thu, 5/13/10, Patrick Maupin pmau...@gmail.com wrote: From: Patrick Maupin pmau...@gmail.com Subject: Re: Picking a license To: python-l...@python.org Date: Thursday, May 13, 2010, 11:35 PM On May 13, 10:07 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: How exactly does the LGPL lead to a requirement to “relink”? I think this might be a misconception, but I'm not 100% sure. Since Ed gives his customers full source code, there may not be the requirement to directly provide the ability to relink, because The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application. and section 4d0 requires you to permit the user to recombine or relink where recombine isn't defined directly (perhaps in the underlying GPL?) But if my client give someone else a copy of the binary I gave them, they are now in violation. I do not want to put my client in this position. When using the GPL or LGPL you can do anything you want as long as you do not let anyone else use your work, but if you let someone else have a copy of you work you are putting them in a position where that can easily/inadvertently violate the law. I do not want to put clients in legal jeopardy, so I do not use GPL, or LGPLed code. Good point. I guess I haven't distributed something linked in a while (really just Python), so I tend to forget that aspect of it. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 1:08 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Thu, 13 May 2010 19:10:09 -0700, Patrick Maupin wrote: The broken window fallacy is about labor that could have been spent elsewhere if someone else had done something differently. The only time that comes into play in my programming life is when I have to recode something that is nominally available under the GPL, so I'm not sure this is really making the point you think it is. You've never had to recode something because it was nominally available under a proprietary licence that you (or your client) was unwilling to use? Lucky you! Don't be silly. That's why I started writing open source software in the first place. But if I start writing stuff to put in the commons with strings removed, why would I bother with a license that just adds some strings back? The GPL ensures that once software has entered the commons (and therefore available for all), it can never be removed from the commons. No it doesn't. It just insures that if people actually *distribute* the software to others, they have to distribute the source. In any case, for software to remain in the commons, it has to be available where people can get to it. Somebody has to care enough to maintain a repository, or it has to be good enough for people to distribute. The MIT licence does not. The only difference is that somebody has to care enough to maintain a repository, or it has to be good enough for people to distribute *along with source*. Now, you might argue that in practice once software is released under an MIT licence, it is unlikely to ever disappear from the commons. Depends on the software. See above. Well, perhaps, but if so, that's despite and not because of the licence. Same thing for GPLed software. See above. In practice, I believe most MIT-licenced code never even makes it into the commons in the first place. Interesting assertion. I'm willing to predict that the majority of code you've written for paying customers (as opposed to specifically for open source projects) has disappeared into their code base, never to be seen by anyone outside of the company. Am I right? That's true, but what on earth does that have to do with the MIT license? Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 8:26 am, Paul Boddie p...@boddie.org.uk wrote: On 13 Mai, 22:10, Patrick Maupin pmau...@gmail.com wrote: Just to deal with your Ubuntu high horse situation first, you should take a look at the following for what people regard to be the best practices around GPL-licensed software distribution: http://www.softwarefreedom.org/resources/2008/compliance-guide.html Before, you were busy pointing me at the GPL FAQ as authoritative. When I show where the FAQ says that you should distribute source if you give somebody a CD, you point me at a document which is obviously designed for the Ciscos of the world. If you still think Ubuntu are violating the GPL or encouraging others to do so, feel free to contact their lawyers who I'm sure will be very interested to hear from you. Did I *ever* say that Ubuntu was violating the GPL. No. Do I believe that the practices of any binary Linux distribution that fits on a single CD make it easy for the downloader/burner to violate the GPL. Yes. When the leader of your religion bandies terms like freedom and evil about, what do you expect? Seriously? I thought you were done. I guess you are: again, we have the usual courting of public outrage by labelling stuff you don't like as religion - presumably not the right one, either - when it is no such thing. Well, you conveniently ignore sections of your bible (for example, the part of the FAQ where it says you should distribute source with binary) and reach for more obscure scrolls whenever the real world gets in the way of your fantasy. Even here, you don't bother to quote what you wrote, which would show I am just responding to your outrage. My primary agenda is to explain that RMS does, in fact, have an agenda, and the GPL was designed as a tool in furtherance of that agenda, and that while the agenda does have some arguably noble goals, before using the GPL people should understand its consequences both for good and bad, and make their own determination about whether it's the right license for their project. Reading through your translations of what are effectively honest summaries. There are multiple sides to every discussion, and everybody comes to the table with biases. If you honestly think that you are not biased, then you are deluding yourself. If you realize that you are biased, then you will also come to realize that my translations are equally honest. one gets the impression that you have quite a chip on your shoulder about the FSF and RMS. I can take them or leave them until they and their followers start spouting damaging nonsense. Many businesses were scared to death of FOSS for many years, and I lay the blame squarely on RMS's shoulders. You see only the good he has done; it is tempered by quite a bit of bad. Referring to the GPL as a commercial licence and stating that it (as opposed to any other licence or even the word copyright followed by a name) is a threat to sue people, presumably appealing to the libertarian crowd with a judicious mention of government just to fan the flames of supposed injustice, really does triangulate where you are coming from. So, yes, we're now rather more aware of what your agenda is, I think. I'm not the one who keeps spouting that it gives freedoms (or even privileges) that copyright would have taken away. That's complete bullshit. As I said, copyright *allows* the author to control various aspects of his work (take away freedoms in GPL-speak), and all licenses (including the GPL) explicitly state which aspects the author plans to control. The only way the author can really exert control is to sue or credibly threaten to sue. I can actually point to multiple instances of GPL authors suing, and people like you crowing about how great it is that the GPL stands up in court, but I don't actually recall any suits about violations of the MIT or Apache licenses. So, yes, I firmly believe that when somebody slaps a GPL license on their software (and especially if they sign the copyrights over to the FSF) they are trying to signal that they are willing to go to court to protect their rights. This is no different than when Microsoft sues an infringer, and is not an evil thing, but it is definitely something to be aware of. The easiest way to not get tangled in that kind of lawsuit is to just make sure that you never distribute any software with a commercial-type license on it (including the GPL). And I don't think it improves any argument you may have by projecting notions of morality or immorality onto what I have written, But you're arguing from a moral standpoint. especially when I have deliberately chosen to use other terms which avoid involving such notions Yes, but you're making exactly the same arguments as others, just changing the name. or by equating the copyleft licences with criminal enterprises (pyramid scheme), Well, that may be a bit OTT. What I really should say is that the GPL license has
Re: Picking a license
On May 14, 6:12 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 2ff3643b-6ef1-4471-8438- dcba0dc93...@a21g2000yqn.googlegroups.com, Patrick Maupin wrote: On May 13, 10:04 pm, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.142.1273767256.32709.python-l...@python.org, Ed Keith wrote: The claim is being made that [the GPL] restricts freedom. What about the “freedom” to restrict other people’s freedom? Should that be restricted or not? It's interesting that some people don't like the comparison of the Free Software movement to a religion, yet the main argument of the movement, and the deliberate co-opting of words like Free and Free Software ... Haven’t you “co-opted” those words yourself? Only in response. But hey, it's not just me; even Stallman says that MIT-licensed software is free software, just not Free Software. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 6:13 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 2b17ee77-0e49-4a97-994c-7582f86c0...@r34g2000yqj.googlegroups.com, Patrick Maupin wrote: On May 13, 10:06 pm, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: Under the GPL, everybody has exactly the same freedoms. That's absolutely not true. For a start, the original author can dual- license. That’s nothing to do with the GPL. If you mean that's out of the control of the GPL I agree. But the whole point of the discussion has been about how people can't take GPL licensed code proprietary, making enhancements, etc. and I'm just pointing out that this doesn't apply to the original author. Someone can decide they aren't making enough money under the GPL and stop distributing that way, and make all their enhancements proprietary, if they are the original author. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 10:20 am, Paul Boddie p...@boddie.org.uk wrote: On 14 Mai, 09:08, Carl Banks pavlovevide...@gmail.com wrote: On May 13, 10:59 pm, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Thu, 13 May 2010 17:18:47 -0700, Carl Banks wrote: 2. Reimplment the functionality seperately (*cough* PySide) Yes. So what? In what possible way is this an argument against the GPL? [...] It's not. It's an argument that the GPL doesn't do much good. Right. So nobody got the benefit from Qt under the GPL or PyQt under the GPL? Even the PySide developers seem hell-bent on picking over the work of the PyQt developers for ideas, although they obviously won't touch the code. Nokia seem to have accrued tremendous benefit from the existence of PyQt because I rather doubt that anyone would have bothered rolling a set of mature, usable Python bindings for Qt now had some not existed already and proved that dynamic languages are worth supporting. Perhaps he should have said the GPL doesn't do any more good than any other commercial license. After all, lots of software ideas proved their worth in proprietary systems, and then were later cloned by FOSS developers. In many cases, these clones are, functionally, almost exact copies. That's why all the really proprietary people are hell-bent on trying to get or maintain patent protection -- copyright doesn't protect inventions. Would you have agreed had he had said that MatLab's license doesn't do much good and assigned the same sort of meaning to that statement, namely that the MatLab license prevented enough motivated people from freely using MatLab in ways that were important to them? Obviously, it was important enough to enough people that they went and built the GPLed Octave software, which now emulates MatLab very closely. As I think both Ed and I have said before, the GPL can be a great license for a full-blown *program* (like Octave) that people can just download and use, but is not always so great for program *pieces* that are designed to be used in the programmatic equivalent of a mash-up, like PyQt/PySide, so the cloning of PyQt into PySide is as inevitable as the cloning of MatLab into Octave, or Unix/Minix into Linux. As far as your comments about PyQt proving out the concept, well duh! Just as there are a lot of proprietary programs that are relatively useless and *won't* have any GPLed versions written, nobody's going to waste time rewriting a marginally useful GPLed library just to put a permissive license on it, either. They are either going to write something completely different in the hopes that their vision is correct, or are going to copy at least some parts of the design and/or vision of something that is popular and useful. And that's a great thing. It would have been horribly unproductive if the Linux API weren't at least reasonably close to the Unix API, for example. It's an interesting tension between the licenses. Nobody rewrites permissively licensed software as GPL simply because the license is unacceptable, but just as people will rewrite proprietary programs and libraries as GPL because the license is unacceptable, so will some rewrite GPLed libraries as permissive because the license is unacceptable. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 11:48 am, Paul Boddie p...@boddie.org.uk wrote: On 14 Mai, 17:37, Patrick Maupin pmau...@gmail.com wrote: Before, you were busy pointing me at the GPL FAQ as authoritative. No, the licence is the authority, although the FAQ would probably be useful to clarify the licence author's intent in a litigation environment. Agreed. Section 3 of GPLv2 (and section 6(d) of GPLv3 reads similarly): If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. And here's that FAQ entry which clarifies the intent: http://www.gnu.org/licenses/gpl-faq.html#DistributeWithSourceOnInternet That entry, along with the written offer, certainly covers Ubuntu when they distribute a CD. But if I *download* an ISO, burn it on a CD, and give it away, *I* am the one distributing the physical copy, not Ubuntu, and I am not going to put up an FTP server just so my friend can get source from it. And as section 6 of GPL v3 makes clear, I am not allowed to piggyback on Ubuntu's source offer. My situation *really is* covered by the FAQ entry I referred you to: http://www.gnu.org/licenses/gpl-faq.html#UnchangedJustBinary Like I said, if you really have a problem with Ubuntu shipping CDs and exposing others to copyright infringement litigation. So, deliberately or not, you're trying to change the discussion again. I *never* discussed Ubuntu shipping a physical CD, and never intimated that that was a problem. My discussion was *always* about an individual *downloading* an ISO and *burning* a CD himself, then *distributing* the CD to someone else. - or even themselves, since they (and all major distributions) are actively distributing binaries but not necessarily sources in the very same download or on the very same disc - then maybe you should take it up with them. Again, I never intimated this. Please read more carefully in the future before you reply, and then perhaps you will actually make cogent replies that address my points, and then I won't be so frustrated that I make snide comments you take offense at, OK? This has happened on at least 4 separate occasions in this thread, and sometimes a single misunderstanding goes on for quite a few posts, so I'm starting to wonder if it's deliberate. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 1:07 pm, Paul Boddie p...@boddie.org.uk wrote: On 14 Mai, 19:00, Patrick Maupin pmau...@gmail.com wrote: Would you have agreed had he had said that MatLab's license doesn't do much good and assigned the same sort of meaning to that statement, namely that the MatLab license prevented enough motivated people from freely using MatLab in ways that were important to them? Obviously, it was important enough to enough people that they went and built the GPLed Octave software, which now emulates MatLab very closely. I don't need to answer your question. It's obvious that the licence doesn't do much good when people seek to create a platform which is genuinely and irrevocably open as a response. That they have done so using the GPL pretty much sinks the previous ridiculous statement about the GPL, too. That statement was made in the context of why Carl doesn't use GPL- licensed *libraries*. He and I have both explained the difference between libraries and programs multiple times, not that you care. unless Octave is somehow a bad thing (which is what a certain vendor of proprietary statistics software would have you believe about a certain widely-used statistical analysis tool). Although people can argue that usage of the GPL prevents people from potentially contributing because they would not be able to sell proprietary versions of the software, it has been in no way demonstrated to be universally true that such contributors would contribute more than those who do so because of the copyleft licensing. As I have said before, the availability of multiple (but not too many!) licenses is a great thing, because each contributor can decide how he wants to license his creation. Finding the right license to contribute under can only enhance the commons. The creators of Octave are obviously not willing to create (or help create) another system with all the proprietary limitations of MatLab, and why should they be willing? I don't presume to know their motivations, or how the license got chosen. However, once it was under the GPL and there were multiple contributors, it would certainly be difficult to relicense any other way. The production of a different proprietary flavour of MatLab wouldn't be beneficial to them at all - it might even be detrimental to their project - and might only be marginally beneficial, at best, to existing MatLab customers. I personally can't see any realistic chance of detriment. How could a proprietary clone hope to compete against free software on one side and real matlab on the other side? That's a no-win position, so I wouldn't expect to see any proprietary clones. [PySide] Just as there are a lot of proprietary programs that are relatively useless and *won't* have any GPLed versions written, nobody's going to waste time rewriting a marginally useful GPLed library just to put a permissive license on it, either. Unless they really want to release (or encourage the creation of) proprietary software. How does recreating something marginally useful encourage proprietary software? That's very confusing. which is precisely what PySide is all about. No, PySide is about non-GPL software, and is released under a license that even RMS recognizes as free, and it is certainly not of marginal utility. (And PyQt is not marginally useful - it is a widely-used and widely well-regarded library.) Well, we agree on that. But I don't know why you're trying to claim I said PyQt was only marginally useful. And this apparent overriding need to support proprietary solutions results in different strategies, such as with the Chandler project: because the OSAF wanted to be able to sell proprietary solutions but didn't own all the code, they decided to pick only permissively licensed software for the components of the solution, resulting in a lot of extra effort expended in getting their user interface toolkit up to scratch. You can make your own mind up about whether that was a sensible strategy. Large, high-risk projects are often going to fail and there will always be some decisions that are easy to second-guess, correctly or not. In any case, if the goal was a particular method to get a ROI, it may have been that they wouldn't have been able to do that at all with the GPL, either. Usually, however, most people wanting to write proprietary software cannot be bothered to do the work to replicate an existing GPL- licensed solution (or even to significantly improve permissively licensed solutions). Usually, most people wanting to write software can't be bothered to do the work. That's nothing new. Yet occasionally people do some work, and some projects make progress. They instead appeal to people to release already- mature permissively licensed software, typically waiting for someone with enough money or manpower to do most of the work for them. Well, personally, I'm still waiting for someone to finish the Hurd
Re: Picking a license
On May 14, 1:38 pm, Paul Boddie p...@boddie.org.uk wrote: On 14 Mai, 19:15, Patrick Maupin pmau...@gmail.com wrote: On May 14, 11:48 am, Paul Boddie p...@boddie.org.uk wrote: Section 3 of GPLv2 (and section 6(d) of GPLv3 reads similarly): If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. And here's that FAQ entry which clarifies the intent: http://www.gnu.org/licenses/gpl-faq.html#DistributeWithSourceOnInternet [...] http://www.gnu.org/licenses/gpl-faq.html#UnchangedJustBinary We're all aware of the obligation to provide source code. You've spent the last few days complaining about it. Like I said, if you really have a problem with Ubuntu shipping CDs and exposing others to copyright infringement litigation. So, deliberately or not, you're trying to change the discussion again. I *never* discussed Ubuntu shipping a physical CD, and never intimated that that was a problem. My discussion was *always* about an individual *downloading* an ISO and *burning* a CD himself, then *distributing* the CD to someone else. I am not changing the discussion at all. You are describing a situation where someone gets the binaries but not the sources, but according to the licence they should get both of those things (ignoring written offers and the like), and this does apply to Ubuntu since precisely this act of distribution (to use the older term) is performed by them. That you then pass on the binaries without the sources is an equivalent situation, ignoring for the moment that you do not yourself have the sources either. If Joe downloads and burns a CD for his friend, he may not have the sources and may not have any intention of getting them, and probably didn't provide a written offer. What you're ignoring for the moment is my whole point, that unlike Ubuntu, Joe is now in violation of the GPL license, because he provided neither a written offer nor source on CD, nor his own download site. So, what are you supposed to do when the recipient calls you on the lack of sources? There is possibly no calling. Since no source and no written offer was delivered, Joe's friend may not know about the issue. Even Joe himself just saw it was free software and didn't read the fine print, so he may not have a clue how to get the source. (And, yes, clearly the FSF anticipates that not everyone will request the sources because it is written in that very excerpt I provide above.) Which Joe doesn't know about and didn't adhere to in any case. If the recipient is strict about exact compliance, you will have to provide the sources on CD to them. That could be a year later, and Joe, who doesn't really even know anything about source, is really going to have a hard time figuring out exactly which sources went into the CD he downloaded that long ago. And this makes sense: if they can only make use of the binaries if provided on CD (and not, say, on an FTP site because they don't have an Internet connection, for example), then they will need to receive the sources in the same manner. To an extent it makes sense. That's why I explained that I thought it would be nice of Ubuntu to put a warning to Joe on their site explaining the consequences of helping his friend out. Of course, since the warning would only serve to decrease object downloads, and since Joe's friend doesn't really want the source anyway, there is no real point. That doesn't alter the fact that Joe is immediately in violation of the GPL once he delivers the CD to his friend without the written offer. Of course, the recipient may only demand certain sources, not wishing to avail themself of the sources for all copyleft-licensed packages in the binary distribution. [ Stuff about ShipIt snipped because I was never discussing that.] Really, if at this point you think I'm playing games with you. I don't know what to think about that. Even after I've explicitly said multiple times I'm not discussing when Ubuntu ships a CD, you still felt compelled to include a big paragraph about ShipIt. Is it to confuse? Or because have OCD? I don't really know. then you really need to stop taking score and formulate the exact problem you have with the distribution of Ubuntu-style media, I explained it fully multiple times. because I'm starting to think that the only real problem here is the one you have with people using copyleft-style licences for their works. Well, as I have tried to explain, there are tradeoffs with any license, including the GPL. With the GPL, you can easily adhere to the letter of the license by shipping source with object. But sometimes the source is so huge, people take shortcuts to get around
Re: Picking a license
On May 14, 2:26 pm, Paul Boddie p...@boddie.org.uk wrote: On 14 Mai, 20:36, Patrick Maupin pmau...@gmail.com wrote: That statement was made in the context of why Carl doesn't use GPL- licensed *libraries*. He and I have both explained the difference between libraries and programs multiple times, not that you care. Saying that GPL-licensed applications are acceptable is a minor concession to the use of copyleft licensing if one advocates permissive licensing for all things which are not perceived to be finished products: things that one isn't looking to re-use somehow. I am only advocating to the extent of explaining why I license stuff permissively, and why, whenever I incorporate other stuff, it has to be licensed permissively as well. How you license your stuff is your business. Saying that one likes Octave and that it uses the GPL I don't recall saying I liked Octave. I have no opinion. I have never used it. Just threw it out there as an example of how people rewrite proprietary software to counter your indignation that somebody would rewrite PyQt. damning it with faint praise if one were then to say that its parts should be permissively licensed so that one can incorporate its functionality into something else. I'm not operating a chop shop. Never even had cause to look at the source. I really don't care about it. No, I don't care if you have a problem with GPL-licensed libraries because it is, as we have established repeatedly, your problem not mine. Sure, the problems that I see with the GPL lead me to choose non-GPL solutions for libraries. And I never asked you to care. I had a brief moment of hope that you could see that my concerns were valid, if personal, but apparently you can only concede that if you attribute some sort of selfish ill-will to me. I personally can't see any realistic chance of detriment. How could a proprietary clone hope to compete against free software on one side and real matlab on the other side? That's a no-win position, so I wouldn't expect to see any proprietary clones. Well, only permissively licensed software would encourage such clones. See, there you go with choice of language again. Remember, we're both biased with different viewpoints. You say encourage; I say allow. I further argued that it's immaterial that it's allowed, nobody sane would do it. At that point, there are incentives for people to develop functionality for proprietary deployment instead of for the upstream project. What incentives? The incentives that the original matlab team will keep outcompeting you from the top, or the incentives that the open source octave team will keep outcompeting you from the bottom? [PySide and proprietary software] No, PySide is about non-GPL software, and is released under a license that even RMS recognizes as free, and it is certainly not of marginal utility. No, PySide is about permitting the development of proprietary applications by providing a solution to the all-important ISVs which lets them develop and deploy proprietary software. That's an interesting viewpoint. Originally, both Qt and PyQt were available dual-licensed under the GPL or proprietary licenses. For anybody serious about proprietary development, the proprietary licensed versions were actually quite reasonably priced. Really the major advantage I see in PySide licensing is for somebody like Ed or Carl or me, who simply wants to be able to deliver programs with no strings attached. That was not possible under the GPL-licensed version (because of the strings attaching to the customer that Ed has talked about) or the commercial version (because then Ed couldn't even give his customer the source to PyQt). PySide is LGPL, which Ed still might not touch, but at least any linking required between that and code that uses it is really just an import statement, so then again, he might be OK with that. Of course, the fact that Qt and PySide are now both free of cost for non-GPL customers certainly helps Nokia in their push to get people to take them. Do you really think a platform vendor whose ISVs routinely ship proprietary software on their platform and on other platforms, and who will demand the ability to continue to do so, now expects all these ISVs to provide their applications under the modified BSD licence? Not at all. But they have now *enabled* ISVs to do that. Before, with QT and PyQt, it was GPL or proprietary. Sure, other developers can use the software - even people releasing GPL-licensed software - but that is highly unlikely to be the primary business motivation. I think the motivation was to remove all impediments to using it on the platform, and I see nothing wrong with that motivation. They already spent a lot on Qt, and they really want to leverage that. If you think the mobile telephony vendors are a bunch of fluffy bunny rabbits playing with each other in sugary meadows of niceness, I don't
Re: Picking a license
On May 14, 6:42 pm, Paul Boddie p...@boddie.org.uk wrote: You really should slow down and read a bit more carefully. You might want to tone down the condescension. I didn't start out condescending, and I agree I could have worded this particular statement a bit more clearly, so I apologize for that, but I can point to at least 5 or 6 occurrences of you misreading me when I stated things very clearly. It's really starting to get old. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 7:24 pm, Terry Reedy tjre...@udel.edu wrote: The option to provide an offer for source rather than direct source distribution is a special benefit to companies equipped to handle a fulfillment process. GPLv2 § 3(c) and GPLv3 § 6(c) avoid burdening noncommercial, occasional redistributors with fulfillment request obligations by allowing them to pass along the offer for source as they received it. Paul Boddie already pointed out that document. As I explained, that document was written for the Ciscos of the world. The FAQ, which was written for you and me states very clearly The general rule is, if you distribute binaries, you must distribute the complete corresponding source code too. The exception for the case where you received a written offer for source code is quite limited. in answer to the question I downloaded just the binary from the net. If I distribute copies, do I have to get the source and distribute that too? As I have pointed out on at least 3 posts by now, this FAQ interpretation derives directly from the actual license terms and appears to reflect the terms correctly. If you actually *read* GPLv3 § 6(c), it *only* applies if you received the object code in accordance with GPLv3 § 6(b). But if you download an ISO from Ubuntu, that happens under GPLv3 § 6(d), *not* GPLv3 § 6(b). However, the distribution to your friend when you give him the CD that you burned for him is under 6(b), so not only do you not have an upstream to rely on, you are actually in violation of the license once you give him the CD without your own written offer! (At one level, this makes sense -- if the 3 year window for source is to have any teeth, then you can't give the poor guy a CD 2 years after you downloaded it and expect Ubuntu to make good on the source 5 years after you downloaded it.) Now maybe there is some *other* way (besides the obvious ways I've mentioned such as fair use and the fact that nobody's going to sue because of the PR fallout from bothering some grandma for sharing a CD that was advertised as free) that this is not an issue, but nobody on this thread has yet shown any credible evidence that the act of just handing somebody a freshly burned Ubuntu CD with no written offer is not a violation of the license. As I have made clear, I do not view this as a direct practical problem. But I do view it as a huge problem that the license is so complex that in a couple of days of conversing about it, several people have asserted that there is no way my reading of the license is correct, yet nobody has shown solid evidence that would back up an alternate reading, and I also view it as the tip of the iceberg as far as the issue of license compliance goes. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 6:52 pm, Paul Boddie p...@boddie.org.uk wrote: On 14 Mai, 21:14, Patrick Maupin pmau...@gmail.com wrote: If Joe downloads and burns a CD for his friend, he may not have the sources and may not have any intention of getting them, and probably didn't provide a written offer. What you're ignoring for the moment is my whole point, that unlike Ubuntu, Joe is now in violation of the GPL license, because he provided neither a written offer nor source on CD, nor his own download site. Now, wait a moment! Your point is that just by giving the binary CD to someone, you are now in violation of the licence. Correct -- download an ISO, burn onto CD, hand CD to friend w/o written offer = license violation. What I tried to explain is that this situation is anticipated - that the FSF acknowledges that the recipient won't have received the sources at the same time in all situations - and that the same distributor is responsible for providing the sources. Right. That distributor would be Joe. As long as they don't deny the recipient access to the sources, by the same means, they are not violating the licence. But Joe didn't give a written offer, and he doesn't even know how to download the source, and you still haven't showed why that's not a problem for him. You have a point about recipients not being immediately and obviously informed of the things they are entitled to, but that is a matter for the distributing parties to remedy: Well, Joe's the distributor to his friend. He got the stuff from Ubuntu, who will give him source and even have a legal page about it, but Joe didn't bother reading all that stuff. that is arguably what happens when, upon loud squealing about matters of ideology, distributors decide to de-emphasise the Free Software aspect of their distributions. Yesterday, you were telling me I should inform Ubuntu that they didn't have enough license information prominently available in the right places. Are you now claiming that that's simply because people like me told Ubuntu that they were emphasizing the license information too much? In any case, Ubuntu prominently describes The Ubuntu Promise with a link to more information from their front page. Of course, the download button is prominent as well. Nevertheless, it is my understanding that anyone attempting to use or install such distributions do get to see a summary of the licences; Yes, and we all know that everybody has been trained to fully read and understand every single license the click on when installing software. only people who pass on the software without inspecting it (which would involve actually inserting the CD and booting from it) will be unaware of its contents, Well, to make what I said in my previous comment more clear, I believe that Joe would have actually installed the software himself without bothering to read the license. This may be foolish of Joe, but he is in excellent company -- in one recent unscientific yet (IMO) well- constructed study, only 12% of users bothered to read the license at all: http://www.huffingtonpost.com/2010/04/17/gamestation-grabs-souls-o_n_541549.html and they could only be held responsible as reasonably as one's Internet service provider if that party were asked to provide source packages for that Linux distro I downloaded last year. You still haven't yet provided any credible evidence for this version of the chain of responsibility. But in any case, I suspect Joe would have actually installed the software without bothering to read any license information. You also have a point about whether people are able to provide sources at a later date, which might be troublesome if someone gave someone else a CD with an old version of Ubuntu on it and then were asked to provide the source packages. Bingo! My hypothetical Joe would be in serious hot water at this point. Naturally, the FSF have attempted to address these points in version 3 of the GPL. And I submit that they addressed the problem by making it really clear that yes, it is Joe's responsibility, in section 6. I would be interested to hear the opinion of the FSF and distributors on this matter, but I think it's absurd to accuse the FSF as operating as you allege Microsoft do, especially as the distributors are the ones who encourage the sharing of the installation media. Well, it's really the entire ecosystem. I have to believe that everybody at the FSF knows how this works, and even though RMS is a shrinking violet, I suspect that if he seriously cared about this, he would work up the courage to address it publicly, much as it pains him to share his opinions. Really, if you think distributions should do a better job at educating their users and helping them uphold any obligations that may apply to them, you should talk to them about it. I seriously don't think they, or the FSF, are interested in this, and I don't think they will harass Joe in any case
Re: Picking a license
On May 14, 9:02 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message ab78bcb6-f07c-4d6c-b6aa-961f4ff59...@i9g2000yqi.googlegroups.com, Patrick Maupin wrote: On May 14, 6:12 am, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message 2ff3643b-6ef1-4471-8438-dcba0dc93...@a21g2000yqn.googlegroups.com, Patrick Maupin wrote: On May 13, 10:04 pm, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.142.1273767256.32709.python-l...@python.org, Ed Keith wrote: The claim is being made that [the GPL] restricts freedom. What about the “freedom” to restrict other people’s freedom? Should that be restricted or not? It's interesting that some people don't like the comparison of the Free Software movement to a religion, yet the main argument of the movement, and the deliberate co-opting of words like Free and Free Software ... Haven’t you “co-opted” those words yourself? Only in response. So it’s bad when others do it, but not when you do it? I don't claim to have the vision that gave me the last word on freedom, complete with the overarching power to enumerate all the necessary freedoms on heaven and earth. But even if I accept Stallman's definitions of freedom it is apparently heretical of me to point out that under other licenses, the original recipient of a piece of software (for example, anybody who downloads any of my software direct from google code) enjoys all four of the freedoms relative to that particular piece of software, and has the additional freedom of not having to worry too much about compliance. BTW, RMS apparently stole 4 freedoms from FDR. But don't tell anybody. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 9:04 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 548024fc- dd56-48b9-907d-3aa6a722b...@l31g2000yqm.googlegroups.com, Patrick Maupin wrote: The confusion that some are showing in this thread about whether source must be distributed certainly helps to show that as well. What “confusion”? The GPL requires that source must always be offered in some form. Simple as that. Right, but when I explained that that requirement also applies to Joe, who downloaded an ISO from Ubuntu and burned a CD and gave it away, no less than 3 people jumped in to correct me. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 8:57 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 84a26d03-03b3-47d9- a1f9-107470b87...@k2g2000yqe.googlegroups.com, Patrick Maupin wrote: I also firmly believe, as I have stated before, that the GPL is a much more commercial license. If you want to make money off something, then, no doubt, GPL keeps your competitors from being able to take what you wrote and redistribute it as closed source. But, frankly I view that as more of a business issue than a moral issue. Nevertheless, it’s probably a big factor in why the GPL has become the single most popular open-source licence. Possibly. I think a bigger factor is that the GPL is *designed* to win license competitions. If you view the license as part of the DNA of a piece of software, then whenever two packages breed (are combined) the resultant package will always have the GPL if either of the source packages did. In attempting to draw a biological parallel, many have equated the GPL to a virus, but this analogy fails miserably. The selfish gene analogy has much to recommend it, however: http://en.wikipedia.org/wiki/The_Selfish_Gene#.22Selfish.22_genes It's an interesting exercise to extend the analogy to show how the GPL gene mutated in a way to allow it to mate with even *more* licenses (and always come out on top). So now there are two incompatible selfish gene FOSS licenses in the ecosystem. The license genes always propagate whenever the host software mates, but in order to have that genetic advantage, they avoid allowing their host software to mate whenever they couldn't be the dominant license gene of the resultant package. One side effect of this is that the two major GPL variants are unable to mate with each other. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 9:21 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message mailman.180.1273860694.32709.python-l...@python.org, Ed Keith wrote: I just refuse to use [the GPL] in any code for a client, because I do not want to require someone who does not know source code from Morse code code to figure out what they need to do to avoid violating the license. Why don’t you just put the source code on the same disc you send them, and tell them to pass copies of the entire disc to anyone they want? What you would really have to tell them is don't pass along the program *unless* you copy the whole disk. That's no longer a courtesy -- that's a mandate. By not using the GPL, Ed avoids having to mandate to his customer how to treat the software he has delivered to them. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 9:32 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: Don't be silly. That's why I started writing open source software in the first place. But if I start writing stuff to put in the commons with strings removed, why would I bother with a license that just adds some strings back? To maximise the likelihood of it staying in the commons, of course. Well, it's your opinion that it would do that, and you have some reasonably good reasons for that opinion, but I don't personally buy into all of them. [...] Obviously no licence can guarantee that people will want to use your software. Unpopular software will remain unpopular no matter what licence you use. But it is precisely the viral nature of the GPL that means that, *if* your software is useful enough for people to want to distribute it, it will remain in the commons even if you, the original author, are hit by a bus, your web server crashes, and you lose the original sources. Sure, there's an additional guarantee. But I don't believe there is a real distinction. I believe, for example, that all the major Linux distributions don't try to save bandwidth or disk space by discriminating against non-GPL packages. For example, the Ubuntu policy clearly states that to be in main rather than restricted a package must include source code. Under the GPL, of course work can be lost from the commons if nobody distributes it and the original is lost. But the viral nature is designed so that *if* the software propagates legally, it remains in the commons and not out of it. This is different from MIT-style licences, which are indifferent to whether the software propagates in the commons or not, and proprietary licences, which typically prohibit it. While that is a theoretical difference, I don't believe it is a practical one. I don't download all the source for my Linux distro, but they make all the source available. In practice, I believe most MIT-licenced code never even makes it into the commons in the first place. Interesting assertion. I think it is a safe one. So far in the discussion, you and Ed (and possibly others, I may have forgotten) have repeatedly declared that you use the MIT licence for work you write for clients. I think there is a serious misunderstanding there. For me, there are usually 3 types of licenses involved: 1) proprietary license or work-for-hire agreement for the customer's secret sauce 2) Stuff that the author has put under a permissive license before, or gets the customer to agree is not part of the secret sauce, and the customer agrees to allow the author to put under a permissive license after he writes it 3) Stuff that somebody else wrote under a permissive license For most of my career, I've been an employee with a work-for-hire clause, so pretty much all my writing falls under (1) unless I can make a compelling argument for (2), which is finally starting to happen a bit more. This implies two obvious business models: (1) You write open source software, put it on the Internet, and wait for the donations to come flooding in. (2) Clients pay you to write software for them, which you then use a non- GPL open source licence so that they don't need to release the source code if/when they distribute it further. The bulk of the code is probably (3) Customer dictates the license. [Snipped a bunch of stuff predicated on a misunderstanding of the way things work for me] It's strictly irrelevant to this discussion, but I'm curious why you choose to licence your work to your clients rather than just working for hire and assigning copyright to them. In the past, work-for-hire was practically the rule (during the times I've been an employee). I've been trying to release open stuff from the workplace from over a decade with little traction, but it's finally happening a bit. There are multiple good reasons to open- source, including the hope for coopetition, and the building of a resume. Given that other people who might cooperate with me on an open source project are often similarly situated (working for proprietary employers who wouldn't necessarily want to worry about the GPL), using a permissive license makes great sense. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 8:58 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message mailman.158.1273844352.32709.python-l...@python.org, Ed Keith wrote: Yes, under the GPL every one has one set of freedoms, under the MIT or Boost license every one has more freedoms. Under other licenses they have fewer freedoms. But what about the “freedom” to take away other people’s freedom? Is that really “freedom”? Only if they love or fear you enough to not try to overthrow you. Otherwise, you have to be always on your guard. It's still probably a pretty good life. -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 9:17 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message e5a031a3-d097-4a63-b87a-7ddfb9e90...@n15g2000yqf.googlegroups.com, Patrick Maupin wrote: After all, lots of software ideas proved their worth in proprietary systems, and then were later cloned by FOSS developers. And vice versa. Everybody, whether working in closed or open environments, builds on the work of everybody else. Rsync pioneered the idea of doing transfers of incremental changes to a large file across a network without being able to have the two versions of the file on the same machine to do a direct side-by-side comparison; Microsoft copied the idea in more recent versions of its server software. Andrew Tridgell could easily have patented his idea, but he chose not to. Apple pioneered the idea of using 3D graphics hardware to do window compositing on the desktop; the Compiz folks went on to figure out how to do this efficiently. Microsoft also copied the idea, but forgot the “efficiently” part. Free Software also benefits from networking effects that are not available to proprietary developers. The resources available to proprietary developers are proportional to the size of the company they work for; typically they do not share software with competitors. Whereas the Free Software community is like one huge company in this regard, available to freely pass ideas and code back and forth. This has led to the creation of ideas that proprietary companies simply cannot match. Well said. Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 14, 9:59 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: I think this talk about freedoms is dangerously incomplete, and is confusing the issue rather than shedding more light. Both licences grant the same positive freedoms (freedom to do something). MIT-style licences grant permission to: * make copies of the work; * make derivative works based on the work; and * distribute those derivative works to others. The GPL grants precisely the same three rights. There is no difference in the rights granted. The MIT licence imposes an obligation on the licencee: * you must include a copy of the licence and copyright notice with the work and/or any derivative works. The GPL adds a further obligation: * any derivative works must also be licenced under the GPL. If we want to talk about freedoms, rather than rights and obligations, we need to distinguish between positive freedoms (freedom to do something) and negative freedoms (freedoms from something) and not just blithely mix them up. That is well-put, and of course the whole purpose of the extra obligation or negative freedom is to ensure the rights or positive freedoms of downstream recipients of the software. In theoretical terms, everybody who redistributes software under the GPL has the same obligations imposed, but as I have shown in other posts, this obligation is unevenly enforced, and probably by design. In practical terms, the additional obligations of the GPL license are imposed on those who distribute huge quantities of software (Ubuntu, Red Hat) and those who distribute derivative works (by combining other software with the GPLed software). It is questionable whether distributors such as Ubuntu and Red Hat truly see this as an obligation; certainly they also distribute source for permissively-licensed programs, and certainly other parties happily provide source for fully BSD-licensed distributions for free. Nonetheless, some of the smaller derivative distributors undoubtedly wind up paying for more bandwidth than they would like. So, the bulk of the additional obligations fall squarely on people who distribute derivative works. This is by design. It is what keeps the Microsofts of this world from appropriating GPLed software. As I have said many times, for people who worry about this stuff, the GPL is absolutely the right license, because any license that gets them writing free software rather than worrying about freeloaders is a great license. But for someone (let's call him Fred) who distributes derivative works to a customer, the additional obligation you mention for the GPL actually has 4 separate components: 1) Full source for the original program must be provided 2) Fred's own additional source code must also be provided 3) Fred can't link to any proprietary software at all. 4) Fred must be sure that his customer is OK with the resultant work product being under the GPL. Now, if Fred was going to provide source anyway, the only possible sticking points are really #3 and #4. But those can be very sticky. Let's start with #3. If the proprietary software that is being linked to is, for example, Oracle, Fred can't legally use GPLed software. Well, actually he might be able to, if he writes the software as a work-for-hire (as a contractor for the customer), because then there might not be a true distribution of the final package. So that might actually reduce the amount of free software in the world -- if Fred writes it as work for hire, he can't distribute it to anybody else, and the customer is not about to make a distribution of any of the software, so this is a case where, if Fred can find and leverage permissively licensed software instead of GPLed software, the amount of free software available in the world can actually go up. Now for #4, where Fred just has to communicate with and educate the customer. Even if the customer is just going to use the software in- house with no plans to ever distribute it, the act of merely *asking* a customer if it is OK to use GPLed software in the solution can, in some cases, mean the difference between being able to sign a contract and get started right away, or needing a review by the lawyers that won't conclude for a month and then being told no or, even worse, that business conditions have changed. Obviously, if there were a GPLed solution already available that was the best tool for the job, it might be a good tactic for Fred (if he weren't too worried about the interminable lawyer review) to explain that it will cost $X for a GPL solution, and $X+Y for a non-GPL solution. Or even a good tactic to precede that with a simple question of if the customer ever uses GPL software, and if they already do, do they have a policy. (But that has to be asked in such a way as to not provide an original research question for the lawyer.) But if, starting out, there is no compelling GPLed solution, then there is no good reason to even ask things like
Re: Picking a license
On May 14, 11:19 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Fri, 14 May 2010 07:10:50 -0700, Ed Keith wrote: But if my client give someone else a copy of the binary I gave them, they are now in violation. I do not want to put my client in this position. If your client is distributing software without reading and obeying the licence terms, then they are either idiots, or unethical, or possibly both. How about just ignorant. Maybe even blissfully ignorant as in, you just used permissively-licensed software, and since you're not Microsoft and they paid you a fair amount of money for the software and you both agreed on a handshake or a back of the napkin contract that you could both do whatever you wanted with the software (except stripping copyright notices), they go and do exactly that. If you want to make life easier on them by reducing the consequences of such foolish and/or unethical behaviour, that of course is your right. There are good reasons for doing so, and equally good reasons for not. Well, for people who don't feel the imperative of the FSF's prime directive, the only really good reason for not is if you found some super-cool GPL-licensed software that will greatly reduce the cost of the contract, *and* you can leverage some of the savings into your own pocket. It's also their right to ask you to assign copyright to them, or to licence the work using the MIT licence (or similar), or to ask for an exclusive licence. Or even to ask you to sign a no compete agreement which prevents you from ever writing code again. It's your choice whether to say Yay or Nay, and if you agree, how much you will charge for it. Sure, contracts can be made as simple or complex as the parties want. In most cases, reuse of preexisting GPLed software certainly won't simplify the negotiations, though. In Texas, though, that particular no-compete wouldn't fly. I'll sign non-compete clauses like that in the blink of an eye; it's the speciously more limited ones that you have to watch out for because sometimes the courts will uphold at least parts of those: http://www.texasnoncompetelaw.com/ When using the GPL or LGPL you can do anything you want as long as you do not let anyone else use your work, but if you let someone else have a copy of you work you are putting them in a position where that can easily/inadvertently violate the law. I do not want to put clients in legal jeopardy, so I do not use GPL, or LGPLed code. You're not putting them in legal jeopardy, they are. It is their decision whether or not to violate the licence. Uh-huh. If they're in legal jeopardy, you are too (at least in the USA) because the first thing they are going to do is to cross-sue you for failure to explain to them that you were using GPLed software. Doesn't matter if it's not true. Doesn't even matter if you have signed contracts that prove it's not true. It's still going to cost you a pretty penny to get away from the lawsuit. So, really, why go through all that unless it's going to save enough on the contract to justify it? Seriously, a software contract can be less than half a page under some circumstances, and written so that basically you and they can both do whatever you want, and neither is going to sue the other. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 13, 2:58 am, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Wed, 12 May 2010 22:16:29 -0700, Patrick Maupin wrote: On May 12, 10:48 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message mailman.121.1273693278.32709.python-l...@python.org, Ed Keith wrote: ... but to claim that putting more restrictions on someone give them more freedom is pure Orwellian double speak. What about the freedom to take away other people’s freedom? The freedom to take away other people's freedom is a very serious power that should only be used sparingly. What tuple of speak would that be? Well, if my friend has a slow internet connection, so I give him a Linux CD which lets him get out of Windows hell (me taking advantage of RMS's freedom 2, and my friend taking advantage of RMS's freedom 0), and I don't give my friend all the source code (or a written offer) because, frankly, he wouldn't know what to do with the source anyway, and it doesn't fit on the CD, and I didn't even bother downloading the source, at that point I would apparently be in violation of the GPL license on hundreds of programs, because I would be violating what the FSF calls freedom 1. If you used an existing Linux distribution, then the offer to provide source code will already be there. No, there is no written offer, e.g. with Ubuntu, simply because they take advantage of the ability to provide a download of the source from the same place as a download of the object. If I download an Ubuntu ISO, burn it and give it away (let's say I give away 100 copies, just to remove the fair use defense), then I have violated the GPL. I provided chapter and verse on this; go look it up. If you compiled the CD yourself, and failed to provide a written offer on the CD, then yes absolutely you would be in violation of the licence terms, and shame on you. Not relevant. The GPL doesn't require you to force source code on those who don't want it, but it does require you to make it available if they ask, and for you to notify them appropriately of this fact. You don't even have to explicitly tell your friend he can have the source code. You just have to make sure that the written offer is available on the disk you give him. There is no written offer on the disk, because I burned it from Ubuntu's repository. It really is that simple -- if I give away copies I've made of Ubuntu, I've violated the GPL. Unless you can cite some authority that tells me I'm wrong and gives real reasons. I actually quoted chapter and verse from the license, but you chose to ignore that and make unsubstantiated claims. Now I know none of us would ever violate the license like this, but if, hypothetically speaking, I had made such a CD for my friend, and then someone came along and explained to me that, by helping wean my friend from MS Windows in this fashion, I had taken away his freedom (specifically RMS's freedom 1), I would probably conclude that the person making this accusation was a moron Well, yes, you probably would draw that conclusion. Doesn't mean that you are right to do so, because quite frankly you would have taken away your friend's freedom (albeit in a very small fashion). Access to the source code is a freedom that the GPLed software on the disk *explicitly* grants to your friend, and by failing to pass the offer on, you have taken away that freedom in a very real sense. I was going to say moron but you're obviously not, so I'll change my opinion to brainwashed. :-) We are talking about a small technical violation of the licence terms here. No. It's fundamental. The license deliberately makes not sharing the source *the* principal way to violate it. but imagine if everyone did it, if Red Hat and Debian and Ubuntu etc didn't bother passing on the source code (or a written offer). Then somebody else would. How does Apache work? Only a tiny proportion of people would discover by their own efforts that the source code was available No, I tell my friends that source is available, and they can come and see me if they want to know more. This may have been a viable argument in 1989 (doubtful) but it's extremely silly today. , and only a proportion of them would learn where it was available from. The result in practical terms would be a major decrease in the number of people granted the freedom to modify the source code, and a correspondingly larger decrease in the number of people both free and able to modify the source code. I sincerely doubt your dystopian vision, which, like the GPL and many laws, is predicated on some outmoded views about how humans interact. The reason some people say that the GPL protects the freedom of the code is because the GPL assumes that code needs to be nurtured, instead of taking the viewpoint that, while there may be some freeloaders, sharing code is obviously so valuable to most of humanity
Re: Picking a license
On May 13, 7:25 am, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 155f1683-9bfd-4a83-b63f-7fb0fc2f5...@g21g2000yqk.googlegroups.com, Patrick Maupin wrote: On May 12, 10:48 pm, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.121.1273693278.32709.python-l...@python.org, Ed Keith wrote: ... but to claim that putting more restrictions on someone give them more freedom is pure Orwellian double speak. What about the freedom to take away other people’s freedom? The freedom to take away other people's freedom is a very serious power that should only be used sparingly. Given that the GPL restricts that power, then it must be all right. But the freedom to take away other people's freedom to take away other people's freedom is an even *more* serious power (as many communities which have straight-jacketed their law enforcement officers have found out), that should be used *very sparingly*, so your conclusion doesn't necessarily follow. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 13, 9:53 am, Paul Boddie p...@boddie.org.uk wrote: On 13 Mai, 01:36, Patrick Maupin pmau...@gmail.com wrote: Once the court reaches that conclusion, it would only be a tiny step to find that the FSF's attempt to claim that clisp infringes the readline copyright to be a misuse of that same readline copyright. See, e.g. LaserComb v Reynolds, where the defendant (IMHO) acted much more egregiously than anybody who is delivering free software like clisp is acting, and nevertheless won on that issue. In that very case you mention, LaserComb did not lose the copyright protection on their work, were free to bring an infringement suit once it had cured the misuse [1], and the clause which led to a defence based on copyright misuse was one which forbade licensees from making competing products. Yes. You make 3 points here, which I will address in order 1) They did not lose the copyright protection on their work. To be clear, what I meant by losing copyright protection is not at all the same as losing the copyright itself. The loss of protections simply means that you can't necessarily prevail in a lawsuit for infringement against people who infringed while you were misusing the copyright. This could be true, even if while the copyright was being misused, RMS attempted to sue someone else, and even if he had a solid case. From Lasercomb: However, again analogizing to patent misuse, the defense of copyright misuse is available even if the defendants themselves have not been injured by the misuse. So, during the time of the misuse, yes, they lost their copyright protections, but the loss was only temporary and could be cured going forward by not overreaching in their license agreement. 2) Were free to bring an infringement suit once they cured the misuse. Yes, if you read the actual footnote you are referencing, it cites United States Gypsum Co. v National Gypsum Co., which was a patent case. In that case, there was a price-fixing cartel based on patents, and the cartel lost its ability to use the patents until they changed their illegal patent licensing scheme. Once they changed how they licensed their patents to the court's satisfaction, they were then free to go after patent infringers. BUT, only for infringements that occurred *after* they cured the infringement. Curing the infringement is not a magic wand that allows you a mulligan for your original cause of action, otherwise the patent/copyright misuse defense would be meaningless. 3) and the clause which led to a defence based on copyright misuse was one which forbade licensees from making competing products. Yes, but if you read the reasoning in the decision, almost any attempt to stretch a copyright (or patent) to cover things it doesn't really cover could be viewed as a misuse. So, to the extent that the GPL claims that the distribution of something that links to readline violates readline's copyright by being a derivative work, if a court finds this to be untrue, it could also find that the readline copyright was being misused, at least until the license were modified to make it clear that distributing a program that could use readline (without distributing readline) did not impose any specific licensing requirements on the readline-using program. To follow this logic, all you have to do is to read the LaserComb decision very carefully (it analogizes copyright misuse to patent misuse), and then read the myriad ways it is possible to misuse patents. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 13, 11:19 am, Paul Boddie p...@boddie.org.uk wrote: People only have to honour requests for the corresponding source if asked for it. They are not violating copyright by default. Well, the gospel according to the FSF says otherwise: http://www.gnu.org/licenses/gpl-faq.html#UnchangedJustBinary If you think Ubuntu are exposing people to legal peril by advocating that people make copies of Ubuntu for their friends, why don't you tell Mark Shuttleworth about it? Because I don't really think the peril is real -- a) nobody's going to sue because of the negative PR consequences; and b) fair use would nip the lawsuit in the bud. In fact, the very *lack* of warning on the Ubuntu site would help the end user in the lawsuit. Negative consequences for people who don't want to touch GPL-licensed software and who reserve the right to make proprietary versions of rst2pdf. Negative consequences for people who don't want to tell other people what to do. Well, you effectively said that you didn't like being asked to share alike, which is what the GPL achieves. I give away lots of software. Free to all comers. Come and get some. Yes, but you don't insist that people share alike. I don't demand that you insist that, either, but you clearly object to other people putting that condition on their own works. You're still not paying attention. I think it's fine if people want to do that, but I still think there is force involved, and that it is not the best solution for all situations. I also believe that legally, the GPL license tries to overreach in its control of other people's software, but that morally that may not matter, because the intentions of the license's author are clear. Your assumptions are so far away from reality that there is really no good reason why you shouldn't assume that I'm a 10 foot tall purple monster. Then you've done a very bad job communicating them. Laying off the bizarre imagery might help remedy that somewhat. I didn't start off with bizarre imagery. That only came about when people started trying to use really lame excuses about why my initial statement was wrong. [...] Yes, but you have to choose to do something (X) to start with. Which is actually what you wrote later in that exchange: Again, the force is applied once you choose to do a particular thing with the software -- is is really that hard to understand that concept? I didn't just write that later. I wrote it in my very first post, which you just quoted a few lines up, apparently without even bothering to read it closely. I did read it closely. Now read your own comment closely and take particular notice of the word choose. In my initial post, I mentioned that the force kicks in once the decision is made... That implies a choice. Knowingly or not, you have finally acknowledged that my initial post on this issue is reasonably accurate, but even in so doing, you keep pointing to specific words there to try to show that I'm contradicting myself. Which, if I am, is only because I'm overreaching to try to combat the overreaching on the other side. I fully stand by my first post on this issue, and most of the posting since then has been to correct misunderstandings and apparently willful misinterpretations of that. I think Ubuntu can maybe see the case for moving their notice on their legal page to the download page if you can make it successfully. The point, which I have made in another post, is that a fairly normal way of acquiring Ubuntu -- giving a friend a CD -- violates the GPL as written, and this is by design. The goal is to get more free software users even if they are abusing the license, and only punish those who are abusing the license in particular ways. BTW, there is nothing even on Ubuntu's legal page warning about this possible consequence for sharing a CD, or at least not in a very clear fashion. Or is your point that people have to be warned about that inconvenient GPL licence? I don't think that would be a bad idea at all. Say what you want about Microsoft; if you install Windows, their software is quick to explain all the licensing terms in gory detail. Mind you, even that's not really in English, but they get more points for the attempt than Ubuntu. What have you been smoking and where can I get some? Yes, always ready with a pertinent response, I see. I am ready with pertinent responses to well thought-out arguments, and with impertinent responses to silly arguments. From a practical perspective, Microsoft turning a blind eye to increase market share, and GPL authors turning a blind eye to increase market share and/or goodwill are identical. The fact that money is involved in one instance and not in the other is immaterial. The fact that you believe in the goals of one and not the goals of the other is immaterial. The true fact is that, in both cases, copyright law in conjunction with the license would allow the
Re: Picking a license
On May 13, 6:30 pm, Brendan Abel 007bren...@gmail.com wrote: While I think most of the disagreement in this long thread results from different beliefs in what freedom means, I wanted to add, that most of the responses that argue that the MIT license permits the user more freedom than the GPL, suffer from the broken window fallacy. This fallacy results from the short-sided-ness of the user base, as it is only considering the first generation of derivative works. The broken window fallacy is about labor that could have been spent elsewhere if someone else had done something differently. The only time that comes into play in my programming life is when I have to recode something that is nominally available under the GPL, so I'm not sure this is really making the point you think it is. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 13, 6:39 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Thu, 13 May 2010 08:06:52 -0700, Patrick Maupin wrote: If I download an Ubuntu ISO, burn it and give it away (let's say I give away 100 copies, just to remove the fair use defense), then I have violated the GPL. I provided chapter and verse on this; go look it up. I'm sorry, I can't see where you have provided chapter and verse, or even a URL. In the original message, I wrote In the case of GPL v3, for example, Ubuntu lets me download code under 6d, so if I download it and burn it, I would have to use 6a or 6b; if I had actually received a CD from Ubuntu, I might be able to use 6c, but not if I downloaded it. I thought it was clear those were references to the license clauses. If you compiled the CD yourself, and failed to provide a written offer on the CD, then yes absolutely you would be in violation of the licence terms, and shame on you. Not relevant. You didn't specify whether the Linux CD you were distributing was a mere copy of an existing CD , or one you created yourself, so you will pardon me for covering both possibilities. Well, in the section I just quoted, I did mention Ubuntu... The GPL doesn't require you to force source code on those who don't want it, but it does require you to make it available if they ask, and for you to notify them appropriately of this fact. You don't even have to explicitly tell your friend he can have the source code. You just have to make sure that the written offer is available on the disk you give him. There is no written offer on the disk, because I burned it from Ubuntu's repository. It really is that simple -- if I give away copies I've made of Ubuntu, I've violated the GPL. No, I think this use-case would count as propagation without conveying, since you are merely acting as a mechanical proxy between your friend(s) and Ubuntu. No, I'm actually creating a copy and distributing it (in GPL v3 terminology, conveying it), especially since my friends don't specifically ask for Ubuntu, and I'm foisting it off on them (especially if I burn 10 CDs at a time so I have one if I need it). GPL v2 also has similar rules, and there's lots of v2 licensed software on the Ubuntu CD. I will admit that the GPL FAQs are not as clear about this matter as they should be. I think it's quite clear, although a bit of a tedious slog. But since you want a URL, try this: http://www.gnu.org/licenses/gpl-faq.html#UnchangedJustBinary Unless you can cite some authority that tells me I'm wrong and gives real reasons. I actually quoted chapter and verse from the license, but you chose to ignore that and make unsubstantiated claims. I'm sorry, I can't find where you have quoted chapter and verse from the licence, so I can't comment. Well, I just re-copied what I posted, and added a URL from the FAQ. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 13, 6:39 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Thu, 13 May 2010 08:06:52 -0700, Patrick Maupin wrote: [...] Only a tiny proportion of people would discover by their own efforts that the source code was available No, I tell my friends that source is available, and they can come and see me if they want to know more. That doesn't scale to distributing hundreds of copies of the CD, let alone tens of thousands. Sure it does. Each one of those CD distributions is friend-to- friend. And if my friend gives a CD to someone interested in programming, I might wind up with a new friend. If you're handing over a single copy to a friend (which is the example you gave earlier) then a verbal offer works well, and is only a technical breach of the GPL. If you're distributing hundreds of copies, I don't believe any such verbal offer is practical. Right. And lots of Linux Users Groups are in breach of the GPL on many software packages. But guess what? It really doesn't matter, because the source is sitting there on the internet, for the taking. This may have been a viable argument in 1989 (doubtful) but it's extremely silly today. So you say. Yes, that what's I believe. More anon. , and only a proportion of them would learn where it was available from. The result in practical terms would be a major decrease in the number of people granted the freedom to modify the source code, and a correspondingly larger decrease in the number of people both free and able to modify the source code. I sincerely doubt your dystopian vision, which, like the GPL and many laws, is predicated on some outmoded views about how humans interact. The reason some people say that the GPL protects the freedom of the code is because the GPL assumes that code needs to be nurtured, instead of taking the viewpoint that, while there may be some freeloaders, sharing code is obviously so valuable to most of humanity that it will just happen. We don't live in medieval Europe any more where the rules of glassmaking are so secret that you'll be hunted down like a dog if you try to leave. We live in a world where co- opetition has been shown to be so valuable we had to make up a word for it, and even for those secrets that people are willing to kill to keep, we have wikileaks. I admire your optimism, but don't share it. I understand that. There are a lot of people out there who will attempt to profit off of other peoples' labor without any value-add. But it's getting more difficult to do that. A key element in any kind of arbitrage is imperfect communications, and the internet is rapidly perfecting almost all communications. Let's face it -- a software freeloader is not the most evil thing in the world. *A* software freeloader certainly isn't a big problem. Cutting down *a* tree is no big deal either, but consider what happened to the people of Easter Island, Ethiopia and Haiti when *everyone* did so. In a different context, you would probably be arguing about how software is not like physical goods, and nobody is made poorer if I make my own copy of it. The terms of the GPL exist to discourage freeloaders, lest everyone does so. The obligations it imposes are not onerous by any stretch of the exaggeration. Well, you still don't believe that if I download a CD and give it to a friend I legally have to download a DVD's worth of source to go with it :-) (Mind you, I don't believe for a minute anybody would be stupid enough to try to sue over that, or that copying a few CDs wouldn't be covered by fair use, but I *do* believe that the license attempts to require the source to be distributed.) It's not enough to be granted freedom to modify source code in theory, if you know about it, if you can find some hard-to-locate website which may or may not be running. The practicalities are equally important. That's another thing. Even if I downloaded all the source from Ubuntu, what assurances do I really have that I have all the source? I could be in technical violation of the GPL without even knowing it, even after wasting an extra two days grabbing the source. Best to use Gentoo to be sure, and even then, I need to build it twice running strace just to make sure that I really built everything. That's a silly objection to the GPL. When you include an MIT-licenced library in your project, you can't be sure that the library wasn't stolen from Microsoft and you've therefore accidentally infringed Microsoft's copyright. This isn't an argument against the MIT licence any more than your hypothetical is an argument against the GPL. Well, OK, it's a bit silly, but not really the same as your example, and certainly much more likely. I have never downloaded any FOSS that had any licensing issues I know of (and trust me, SCO tried really hard on that front :-), but I have often downloaded .deb files and tried to build
Re: Picking a license
On May 13, 6:39 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Thu, 13 May 2010 08:06:52 -0700, Patrick Maupin wrote: Perhaps the Apache model doesn't work quite as well as you think? Apparently it's 66 percent of the web servers for the million busiest sites, and presumably 65 for the next million, etc... When I look at the netcraft graphs, the only thing that seemed to cause a decline before last year was Microsoft and their marketing muscle. For example, they incentivize godaddy and others to run all the parked sites on IIS. In the graphs, there was a sudden spike in other at the beginning of last year. My gut tells me this is ROR, django, and other similarly permissively licensed software. In any case, back when GPL take-up was quite small, RMS was very dismissive of market numbers, but I really have to ask: where are all the GPL-licensed web servers? As far as not-so-niche software goes, the GPLed Linux OS is far more popular on the desktop than FreeBSD and OpenBSD together, and about equal in popularity to Mac OS. I'm not suggesting that the popularity of an OS is *entirely* dependent on the licence, but it may be a factor. Well, despite what others have said here, I think the lingering effects of the Unix lawsuit helped give Linux a push. Torvalds himself was a huge factor, and I'm willing to concede that the GPL didn't hinder the quest for contributors. The fact is that, in reality (Darwinian competition to determine the best architecture aside) it's very nice to have a single primary point of focus for an OS, and Unix was perceived to be hopelessly fragmented by many would-be contributors who wouldn't know where to start. I also firmly believe, as I have stated before, that the GPL is a much more commercial license. If you want to make money off something, then, no doubt, GPL keeps your competitors from being able to take what you wrote and redistribute it as closed source. But, frankly I view that as more of a business issue than a moral issue. In any case, if you want to look, as a marketer would, at TAM (Total Available Market), free software is completely floundering in the OS space, and permissively licensed software owns the serious web server space. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 13, 10:07 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: How exactly does the LGPL lead to a requirement to “relink”? I think this might be a misconception, but I'm not 100% sure. Since Ed gives his customers full source code, there may not be the requirement to directly provide the ability to relink, because The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application. and section 4d0 requires you to permit the user to recombine or relink where recombine isn't defined directly (perhaps in the underlying GPL?) Nonetheless, all the dotting of i's and crossing of t's to satisfy section 4 and the underlying GPL probably require a lawyer to check your source code distribution. For example, what is prominent notice? And I love the gem at 4e: Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) I mean, it's in English and very technically precise, but if you follow all the references, you quickly come to realize that the license is a patch to the GPL. It was deliberately made in patch format to make it smaller, but as we all know, reading source code and the accompanying patch is almost always more difficult than reading the patched source. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 13, 10:03 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message 72888d2c-4b1a-4b08-a3aa- f4021d2ed...@e2g2000yqn.googlegroups.com, Patrick Maupin wrote: If I download an Ubuntu ISO, burn it and give it away (let's say I give away 100 copies, just to remove the fair use defense), then I have violated the GPL. I provided chapter and verse on this; go look it up. I have looked it up http://www.gnu.org/licenses/gpl-2.0.html, and sections 3b or 3c would seem to apply. Or alternatively http://www.gnu.org/licenses/gpl.html, 6b or 6c. If the source you got it from didn’t violate the GPL, then obviously you didn’t either. I don't think that's necessarily true. As I've posted before: In the case of GPL v3, for example, Ubuntu lets me download code under 6d, so if I download it and burn it, I would have to use 6a or 6b; if I had actually received a CD from Ubuntu, I might be able to use 6c, but not if I downloaded it. That's because to use 6c, the initial underlying distribution had to be done with 6b, not 6d. Also the FAQ is very clear: http://www.gnu.org/licenses/gpl-faq.html#UnchangedJustBinary Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 13, 10:04 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message mailman.142.1273767256.32709.python-l...@python.org, Ed Keith wrote: The claim is being made that [the GPL] restricts freedom. What about the “freedom” to restrict other people’s freedom? Should that be restricted or not? It's interesting that some people don't like the comparison of the Free Software movement to a religion, yet the main argument of the movement, and the deliberate co-opting of words like Free and Free Software are done in an attempt to guilt others into accepting RMS's vision of morality. He's perfectly welcome have that vision. But I don't let it affect my own moral compass -- I reject it as just another post-modern religion, AKA cult. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 13, 10:06 pm, Lawrence D'Oliveiro l...@geek- central.gen.new_zealand wrote: In message mailman.141.1273767256.32709.python-l...@python.org, Ed Keith wrote: Assertion I: If person A is free to do more than person B, then person A has more freedom then person B. Assertion II: If person A is free do perform an action person B is not free to perform then person A is free to do more than person B. Assertion III: If person B is restricted in some way that person A is not them Person A is free to do something Person B is not free to do. Conclusion: If person B is more resticted than Peston A, Person A has mor freedom than person B. Which step in this reasoning do you disagree with? Under the GPL, everybody has exactly the same freedoms. So which of your assertions is supposedly a criticism of the GPL? That's absolutely not true. For a start, the original author can dual- license. This is not a theoretical issue -- it is a multi-million dollar issue. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 12, 7:10 am, Paul Boddie p...@boddie.org.uk wrote: On 11 Mai, 22:39, Patrick Maupin pmau...@gmail.com wrote: OK. Now I'm REALLY confused. I said Certainly RMS carefully lays out that the LGPL should be used sparingly in his Why you shouldn't use the Lesser GPL for your next library post. (Hint: he's not suggesting a permissive license instead.) to which you replied: Sure, but all he's asking you to do is to make the software available under a GPL-compatible licence. Alright, then, all he's asking you to do is to make *your* software available under a GPL-compatible licence. That's what I meant in the context of the discussion. Usually, people complain about how the GPL dictates a single licence, forbidding all others, that is then inseparable from their work (It's my work but they make me GPL it! I can't even control my own work any more! The FSF owns it! and such nonsense), but I've already given examples of this not being the case at all. In that post, specifically, RMS says to use the GPL in some cases, rather than the LGPL, for libraries. Any other interpretation of *that post* is disingenuous. and then I tried to politely show that you were wrong about RMS's intentions, but now, but you're saying oh, of course, he'd say that -- he wrote the license which is basically what I've been saying all along. But if you have read it like you say, then it appears you were being very disingenuous in your original reply! What the licence asks you to do and what the author of the licence wants you to do are two separate things. But the whole context was about what RMS wanted me to do and you disagreed! NO. If you are building an application, and distributing GPLed stuff as part of it, the FSF still maintains that the license is such that the entire application must be GPLed. You keep acting like this isn't true, but it absolutely is if you're distributing the entire application. I wrote the software above when I meant your software, but I have not pretended that the whole system need not be available under the GPL. You say you have not pretended but you've never mentioned that it would or even acknowledged the correctness of my assertions about this until now, just claiming that what I said was false. On May 11, 5:24 am, Paul Boddie p...@boddie.org.uk wrote: Again, you have to consider the intent of the licensing: that some software which links to readline results in a software system that should offer the four freedoms, because that's the price of linking to readline whose licence has promised that any system which builds upon it shall offer those privileges. But I did consider the intent, and as I have made clear, I think that's a bullying tactic that fragments the software world unnecessarily. Obviously YMMV. More loaded terms to replace the last set, I see. IMO Bullying is the correct term for some of Stallman's actions, including in the clisp debacle. I knew you wouldn't agree -- that's why YMMV. And I'm not replacing any set of terms -- part of the bullying is the forcing. As for rst2pdf, what your modifications would mean is that the software would need to be redistributed under a GPL-compatible licence. NO. You're still not paying attention. The FSF's clear position is that if you actually *redistribute* software under the GPL as *part of a system* then the full package must be licensed *under the GPL*. Again, what I meant was your software, not the whole software system. As I more or less state below... BUT THAT DOESN'T MATTER. Once the whole package is licensed under the GPL, for someone downstream to try to scrape the GPL off and get to just the underlying non-GPL parts is harder than scraping bubblegum off your shoe on a hot Texas day. Once again, I refer you to the intent of the licensing: if someone has the software in front of them which uses svglib, then they need to have the privileges granted to them by the GPL. Yes, if the software also uses some component with a GPL-incompatible licence, then this causes a problem. It appears that the FSF's position is the ability to link to svglib would require software to be licensed under the GPL. It would require the resulting system to be licensed under the GPL. As it stands by itself, rst2pdf would need to be licensed compatibly with the GPL. They've softened their stance considerably over the last few years, and don't overreach nearly as much as they used to, I agree. [...] You mentioned WebKit as a non-GPL-licensed project which attracted contributions from hard-nosed business. WebKit started life as KHTML and was (and still is) LGPL-licensed, but for all practical purposes, KHTML was only ever experienced by KDE users whilst linked to the Qt framework, then available under the GPL. Now, given that WebKit now works with other GUI frameworks, yet is still LGPL-licensed (and this has
Re: Picking a license
On May 11, 10:06 pm, Lie Ryan lie.1...@gmail.com wrote: The point is, GPL (and OWL) is for programmers who just don't care about the legal stuffs and would want to spend more time writing code than writing license. Absolutely. When I wrote permissive license I was not trying to imply that everybody should roll their own. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 12, 7:26 am, Paul Boddie p...@boddie.org.uk wrote: On 11 Mai, 23:02, Patrick Maupin pmau...@gmail.com wrote: Huh? Permissive licenses offer much better certainty for someone attempting a creative mash-up. Different versions of the Apache license don't conflict with each other. If I use an MIT-licensed component, it doesn't attempt to make me offer my whole work under MIT. What certainty does the MIT licence give contributors to a project against patent infringement claims initiated by another contributor? None. If I was worried about that, I'd probably use the Apache license instead. Oh, I get it. You were discussing the certainty that an author can control what downstream users do with the software to some extent. Yes, I fully agree. The GPL is for angry idealists who have an easily outraged sense of justice, who don't have enough real problems to work on. Again, the author does not exercise control when people must voluntarily choose to use that author's work and thereby agree to adhere to that author's set of terms. So you're saying that Microsoft doesn't exercise control about keeping me from using a copy of Windows on more than one machine -- it's not control because I agreed to it up front. Sorry, my mileage varies. In fact, I would (and do) say that Microsoft forces me to buy one copy of Windows for every machine I want to run it on. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 12, 7:43 am, Paul Boddie p...@boddie.org.uk wrote: On 11 Mai, 22:50, Patrick Maupin pmau...@gmail.com wrote: On May 11, 5:34 am, Paul Boddie p...@boddie.org.uk wrote: Yes, *if* you took it. He isn't forcing you to take it, though, is he? No, but he said a lot of words that I didn't immediately understand about what it meant to be free and that it was free, and then after I bit into it he told me he owned my soul now. Thus, owned my soul joins holy war and Bin Laden on the list. That rhetorical toolbox is looking pretty empty at this point. Not emptier than you analogy toolbox. This is really a pretty stupid analogy, but I guess my lame attempts at showing that are wasted. It is whining if someone says, I really want that chocolate, but that nasty man is going to make me pay for it! But that's not what happened. I mean, he just told me that I might have to give some of it to others later. He didn't mention that if I spread peanut butter on mine before I ate it that I'd have to give people Reese's Peanut Butter cups. He isn't, though. He's telling you that you can't force other people to lick the chocolate off whatever Reese's Peanut Butter cups are, rather than actually eating the combination of the two, when you offer such a combination to someone else. No. That's not what is happening, and you've now officially stretched the analogy way past the breaking point. In any case, he's telling me I have to give the recipe for my homemade peanut butter. Is the Creative Commons share- alike clause just as objectionable to you, because it's that principle we're talking about here? I have explained that, in some cases, I will use GPL software, and in other cases I won't, and tried to explain why and what the difference is. Anybody can re-read my posts and figure out that the same might apply to the various Creative Commons licenses. If the man said, please take the chocolate, but I want you to share it with your friends, and you refused to do so because you couldn't accept that condition, would it be right to say, that man is forcing me to share chocolate with my friends? But the thing is, he's *not* making me share the chocolate with any of my friends. He's not even making me share my special peanut butter and chocolate. What he's making me do is, if I give my peanut butter and chocolate to one of my friends, he's making me make *that* friend promise to share. I try not to impose obligations like that on my friends, so obviously the nice man with the chocolate isn't my friend! Yes, he's making everyone commit to sharing, and yes, it's like a snowball effect once people agree to join in. Sorry, I sometimes have a hard time distinguishing the semantic difference between make and force. Could you elucidate? But unless you hide that commitment, no-one imposes anything on anyone. They can get their chocolate elsewhere. They join in; they are not conscripted. And I've already explained why, in some cases, someone might refuse the tastiest chocolate in the world to not join in. I explained this very carefully before multiple times. Let me give concrete examples -- (1) I have told my children before if we take that candy, then they will make us pay for it and (2) if we included (GPLed software) in this (MIT-licensed software) then we will have to change the license. In both these cases, once the decision has been made, then yes, force enters into it. And no, I don't think the average shop keeper is nearly as evil as Darth, or even RMS. Entering an agreement voluntarily does not mean that you are forced to enter that agreement, even if the agreement then involves obligations (as agreements inevitably do). No, but copyright licenses are funny things, not like contracts where there is a meeting of the minds up front. For example, while the Ciscos of the world have no excuse, I bet a lot of people who download Ubuntu and make copies for their friends are unaware of this section of the GPL FAQ: I downloaded just the binary from the net. If I distribute copies, do I have to get the source and distribute that too? Yes. The general rule is, if you distribute binaries, you must distribute the complete corresponding source code too. The exception for the case where you received a written offer for source code is quite limited. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 12, 2:19 am, Lie Ryan lie.1...@gmail.com wrote: On 05/12/10 06:50, Patrick Maupin wrote: On May 11, 5:34 am, Paul Boddie p...@boddie.org.uk wrote: On 10 Mai, 20:36, Patrick Maupin pmau...@gmail.com wrote: The fact is, I know the man would force me to pay for the chocolate, so in some cases that enters into the equation and keeps me from wanting the chocolate. If the man said, please take the chocolate, but I want you to share it with your friends, and you refused to do so because you couldn't accept that condition, would it be right to say, that man is forcing me to share chocolate with my friends? But the thing is, he's *not* making me share the chocolate with any of my friends. He's not even making me share my special peanut butter and chocolate. What he's making me do is, if I give my peanut butter and chocolate to one of my friends, he's making me make *that* friend promise to share. I try not to impose obligations like that on my friends, so obviously the nice man with the chocolate isn't my friend! The analogy breaks here; unlike chocolate, the value of software/source code, if shared, doesn't decrease (in fact, many software increases its value when shared liberally, e.g. p2p apps). Absolutely true. Actually, the analogy was really pretty broken to start with. It wasn't my analogy -- I was just trying to play along :-) There might be certain cases where the software contains some trade secret whose value decreases the more people knows about it; but sharing does not decrease the value of the software, at least not directly, it is the value of the secret that decreases because of the sharing. Sure. But in general, people will share, often even when doing so is legally questionable. Just look at the RIAA's woes if you don't believe me. The only real question here is whether the marginal value achieved by adding constraints to force people to share (which most would have done anyway) outweighs the costs to people who, for whatever reason (perhaps a trade secret obligation) *can't* share. The answer to that question may well vary depending on several factors. The fact that GPL and Apache and MIT and BSD are available is a good thing -- whichever license an author feels best fits his project is definitely the one he should use. Regards, Pat -- http://mail.python.org/mailman/listinfo/python-list
Re: Picking a license
On May 12, 12:17 pm, Paul Boddie p...@boddie.org.uk wrote: On 12 Mai, 16:45, Patrick Maupin pmau...@gmail.com wrote: On May 12, 7:43 am, Paul Boddie p...@boddie.org.uk wrote: Thus, owned my soul joins holy war and Bin Laden on the list. That rhetorical toolbox is looking pretty empty at this point. Not emptier than you analogy toolbox. This is really a pretty stupid analogy, but I guess my lame attempts at showing that are wasted. Yes they are. The analogy was to point out that someone can really want something, but if they are not prepared to accept the price of acquiring it, then there is no point in them whining about someone withholding that thing from them, or whining about someone forcing them to do stuff, especially when there is clearly no force involved at all. But nobody's whining about the strings attached to the software. Just pointing out why they sometimes won't use a particular piece of software, and pointing out that some other people (e.g. random Ubuntu users) might not understand the full cost of the software, and that that is because the cost of the software has been deliberately obscured by using unqualified terms like all-caps Free Software. He isn't, though. He's telling you that you can't force other people to lick the chocolate off whatever Reese's Peanut Butter cups are, rather than actually eating the combination of the two, when you offer such a combination to someone else. No. That's not what is happening, and you've now officially stretched the analogy way past the breaking point. In any case, he's telling me I have to give the recipe for my homemade peanut butter. If you want to redefine the basis of the analogy, then you can talk about the recipe all you like, yes. Otherwise, no: the analogy was only about people whining about not being able to get stuff with no strings attached. I could swap that analogy with one that has someone really wanting a ride on a bus, or wanting to go to the moon, where they don't like it when someone tells them that they can't get do that stuff without agreeing to something or other first. Feel free to start discussing the shape of the bus ticket or who pays for spacesuits if you want, but to say, I really want to use that thing, but that nasty man has licensed it under the GPL is whining in precisely the same way as featured in the analogy. Oh, no wonder I didn't understand what you were getting at with the analogy. I'm not whining about people licensing stuff under the GPL, just about its apologists pretending there are never any negative consequences from it. Is the Creative Commons share- alike clause just as objectionable to you, because it's that principle we're talking about here? I have explained that, in some cases, I will use GPL software, and in other cases I won't, and tried to explain why and what the difference is. Anybody can re-read my posts and figure out that the same might apply to the various Creative Commons licenses. So it is objectionable to you as well, then. I somehow knew that is how you would read my posts, but no. It's people like you putting words in my month that is objectionable. [...] Yes, he's making everyone commit to sharing, and yes, it's like a snowball effect once people agree to join in. Sorry, I sometimes have a hard time distinguishing the semantic difference between make and force. Could you elucidate? Yes: once they've agreed to join in, they have to go along with the whole scheme. Sorry, that is absolutely no different than what I originally said when I was first defending Aahz's use of the word force to Ben Finney back on the 7th: Perhaps you feel forces is too loaded of a word. There is no question, however, that a copyright license can require that if you do X with some code, you must also do Y. There is also no question that the GPL uses this capability in copyright law to require anybody who distributes a derivative work to provide the source. Thus, forced to contribute back any changes is definitely what happens once the decision is made to distribute said changes in object form. Both your make and my force mean to compel. We've come full circle. The English language makes no real distinction between making everyone commit and forcing everyone [to] commit. But unless you hide that commitment, no-one imposes anything on anyone. They can get their chocolate elsewhere. They join in; they are not conscripted. And I've already explained why, in some cases, someone might refuse the tastiest chocolate in the world to not join in. Well, great for them. I thought they were forced to join in. I guess not. That's because you use selective quoting of forced and deliberately ignore the context it was used in. No, but copyright licenses are funny things, not like contracts where there is a meeting of the minds up front. For example, while the Ciscos of the world have
Re: Picking a license
On May 12, 1:00 pm, Paul Boddie p...@boddie.org.uk wrote: On 12 Mai, 16:10, Patrick Maupin pmau...@gmail.com wrote: On May 12, 7:10 am, Paul Boddie p...@boddie.org.uk wrote: What the licence asks you to do and what the author of the licence wants you to do are two separate things. But the whole context was about what RMS wanted me to do and you disagreed! What RMS as an activist wants is that everyone releases GPL-licensed code, except where permissively licensed code might encourage open standards proliferation. What RMS the licence author requests is that your work is licensed in a way which is compatible with the GPL. Sorry, didn't know they were twins. [...] I wrote the software above when I meant your software, but I have not pretended that the whole system need not be available under the GPL. You say you have not pretended but you've never mentioned that it would or even acknowledged the correctness of my assertions about this until now, just claiming that what I said was false. Well, excuse me! I think we both know that combining something with a GPL-licensed work and redistributing it means that the four freedoms must apply, and that recipients get the work under the GPL. You can insist that I said something else, but I spell it out in this post: http://groups.google.com/group/comp.lang.python/msg/034fbc8289a4d555 Specifically the part... Not least because people are only obliged to make their work available under a GPL-compatible licence so that people who are using the combined work may redistribute it under the GPL. In case you don't find this satisfactory, their work means their own work. OK, but in the last several threads on this sub-part, you kept contradicting me for some supposed technicality (how was I to know there were two RMS's?) when I was trying to make the same point. [...] More loaded terms to replace the last set, I see. IMO Bullying is the correct term for some of Stallman's actions, including in the clisp debacle. I knew you wouldn't agree -- that's why YMMV. And I'm not replacing any set of terms -- part of the bullying is the forcing. Stallman gave Haible the choice to not use readline. Maybe that wasn't very nice, It wasn't even legally correct. At that point, Stallman had access to counsel, etc. and should have known better. and maybe Haible didn't believe that using readline would incur any consequences, He wasn't distributing it! It didn't incur any legal consequences; only the consequence due to not realizing that using readline placed him squarely inside RMS's chess game. but that's what you get when you use a copyrighted work. No. That's what you get when you use a copyrighted work authored by an idealist who is trying to spread his choice of license. Your language is all about portraying the FSF as operating in some kind of illegal or unethical way. Sorry, didn't mean to be that subtle. RMS and others at the FSF have, on multiple occasions, made statements about how licenses work which are legally false. This is not illegal, but it is, in my opinion, unethical. Some of these claims appear to not be made so boldly any more, so perhaps they are catching on that others have caught on. I guess you believe that if you throw enough mud, some of it will stick. I don't care about mud or sticking. I am happy to see that the current wording of the FAQ probably means that another clisp/readline scenario won't happen, and like to believe that the public outcry over this sort of thing, and reminders of it in this sort of discussion, help to remind the FSF that others are watching them. Again, what I meant was your software, not the whole software system. As I more or less state below... BUT THAT DOESN'T MATTER. Once the whole package is licensed under the GPL, for someone downstream to try to scrape the GPL off and get to just the underlying non-GPL parts is harder than scraping bubblegum off your shoe on a hot Texas day. Big deal. If a project wants to avoid even looking at GPL-licensed code for the reason that someone might end up getting the code under the GPL, and that they're so bothered that the opportunity to not grant such recipients the privileges of modification and redistribution disappears because of the GPL, then that's their problem. Yes, I understand it's no big deal to you. However, what you have said is not quite right. If I license something under the MIT license, I cannot guarantee that no one will ever get it under the GPL, because it could be redistributed downstream under the GPL (but then I don't care to in any case). However, I *can* guarantee that the code I write (and all the underlying code it relies on) will remain freely available from me for people who need the ability to, for example, link with proprietary code. Despite this not being a very big deal to you, the whole tempest in a teacup here is about this very issue