Re: Most efficient way of storing 1024*1024 bits

2005-11-02 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > Six megabytes is pretty much nothing on a modern computer. I'd store > the things as a string of "0" and "1", and then use .find (or maybe > the in keyword) for doing the searches. > > This doesn't work very well if you're going to mutate the string, > thou

Re: where to download md5.py?

2005-11-02 Thread Paul Rubin
"Bell, Kevin" <[EMAIL PROTECTED]> writes: > I've been looking around, but haven't found a place to download the > md5.py module. I need it to run the dupinator.py It's part of the standard Python distro. There is a C module that you need along with it. -- http://mail.python.org/mailman/listinfo

Re: Class Variable Access and Assignment

2005-11-03 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > > class A: > > a = 1 > > b = A() > > b.a += 2 > > print b.a > > print A.a > > Which results in > > 3 > > 1 > > > I don't suppose you'd care to enlighten us on what you'd regard as the > superior outcome? class A: a = [] b = A() b.appen

Re: Class Variable Access and Assignment

2005-11-03 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Then you don't approve of inheritance? That's fine, it is your choice, but > as far as I know, all OO languages include inheritance. Some OO languages only implement inheritance for method calls. Class variables don't get inherited. -- http://mail.py

Re: OT - Re: Microsoft Hatred FAQ

2005-11-03 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > > There is a difference between what is *illegal* and what constitutes > > a *crime*. > > Why thank you, you've really made my day. That's the funniest thing I've > heard in months. Please, do tell, which brand of corn flakes was it that > you got your

Re: Class Variable Access and Assignment

2005-11-04 Thread Paul Rubin
Stefan Arentz <[EMAIL PROTECTED]> writes: > > Would it be too much to ask that in a line like. > > x = x + 1. > > both x's would resolve to the same namespace? > ... > Consider changing the semantics of what you are proposing and > think about all those Python projects that will break because the

Re: Class Variable Access and Assignment

2005-11-04 Thread Paul Rubin
Stefan Arentz <[EMAIL PROTECTED]> writes: > > Are you seriously saying there's lots of Python projects that would > > break if this particular weirdness were fixed? > > I have no numbers of course. But, why is this a weirdness? Do you seriously think the number is larger than zero? Do you think

Re: Class Variable Access and Assignment

2005-11-04 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > I've already argued that the kludges suggested to "solve" this problem > create worse problems than this. The most obvious solution is to permit (or even require) the programmer to list the instance variables as part of the class definition. Anything not i

Re: Class Variable Access and Assignment

2005-11-04 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > There are good usage cases for the current inheritance behaviour. Can you name one? Any code that relies on it seems extremely dangerous to me. -- http://mail.python.org/mailman/listinfo/python-list

Re: Class Variable Access and Assignment

2005-11-04 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Follow the logical implications of this proposed behaviour. > > class Game: > current_level = 1 > # by default, games start at level one That's bogus. Initialize the current level in the __init__ method where it belongs. -- http://mail.pyt

Re: Class Variable Access and Assignment

2005-11-04 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > A basic usage case: > > class Paper: > size = A4 > def __init__(self, contents): > # it makes no sense to have class contents, > # so contents go straight into the instance > self.contents = contents So add: s

Re: python gc performance in large apps

2005-11-04 Thread Paul Rubin
Robby Dermody <[EMAIL PROTECTED]> writes: > t = 120 seconds (1st run after being fully initialized): > list alloced: 2394620, freed: 17565, max in use: 2377056 > dict alloced: 2447968, freed: 67999, max in use: 2379969 This looks like a garden variety memory leak. I think the next thi

Re: C extension + libm oddity [fmod(2.0, 2.0) == nan ?!]

2005-11-04 Thread Paul Rubin
"Lonnie Princehouse" <[EMAIL PROTECTED]> writes: > Now, fmod(2.0, 2.0) should be 0.0. The problem? ans is getting > assigned nan! I have stepped through it in the debugger now dozens of > times. Either fmod is putting the wrong return value on the stack, or > the stack is getting corrupted by s

Re: Class Variable Access and Assignment

2005-11-04 Thread Paul Rubin
[EMAIL PROTECTED] (Bengt Richter) writes: > Hm, "the" fix? Why wouldn't e.g. treating augassign as shorthand for > a source transformation (i.e., asstgt = expr becomes by simple > text substitution asstgt = asstgt expr) be as good a fix? Then > we could discuss what Consider "a[f()] += 3". You d

Re: Class Variable Access and Assignment

2005-11-04 Thread Paul Rubin
-- http://mail.python.org/mailman/listinfo/python-list

Re: Class Variable Access and Assignment

2005-11-04 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > It also allows you to do something like this: > > class ExpertGame(Game): > current_level = 100 > and then use ExpertGame anywhere you would have used Game with no problems. Well, let's say you set, hmm, current_score = 100 instead of current_lev

Re: Class Variable Access and Assignment

2005-11-04 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > > Next you get some performance gain by using gmpy to handle the long int > > arithmetic, > > Then whatever happens next will be my own stupid fault for prematurely > optimising code. Huh? There's nothing premature about using gmpy if you need bett

Re: Class Variable Access and Assignment

2005-11-05 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > But do you want x += y to work for immutable objects as well? Then > __iadd__ cannot be a statement, because x can't be modified in place. It never occurred to me that immutable objects could implement __iadd__. If they can, I'm puzzled as to why. >

Re: Python doc problem example: gzip module (reprise)

2005-11-05 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > The thing is, the library documentation that Xah Lee is complaining > about is a *reference document*. It says so right in the title: > "Python Library Reference". As such, it makes lousy tutorial > documentation. I'm not sure which particular library Xah L

Re: Class Variable Access and Assignment

2005-11-05 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > > It never occurred to me that immutable objects could implement __iadd__. > > If they can, I'm puzzled as to why. > I'm surprised that it never occurred to you that people might > want to do something like x = 1; x += 1 in Python, But I wouldn't ex

Re: Python doc problem example: gzip module (reprise)

2005-11-05 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > To my knowledge the PSF isn't doing anything about including the > documentation with their distribution, so they shouldn't care about > the licenses. Wanting to bundle a good tutorial for everything in > the library might be on the list, but the licenses on

Re: Python doc problem example: gzip module (reprise)

2005-11-05 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > > It's only -because- of those licenses that there's any reason not to > > bundle. > > Actually, there are other reasons, just as there are reasons besides > licensing for not simply including third party libraries into the > standard library. I'm not talk

Re: Learning multiple languages (question for general discussion)

2005-11-06 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > I can't imagine NOT getting enthusiastic and stimulated by reading Van > Roy and Hariri's book -- it IS quite as good and readable as SICP. It's been on my want-to-read list for a long time. I have the downloaded draft edition (from before the print edi

Re: Learning multiple languages (question for general discussion)

2005-11-06 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > It's a great book - I cetainly owe it the better part of my thesis > about multi level specification for functional languages. If you want > to understand type-systems, its a great comprehensive read. So do I really want to understand type systems?

Re: PyFLTK - an underrated gem for GUI projects

2005-11-06 Thread Paul Rubin
aum <[EMAIL PROTECTED]> writes: > To me, wxPython is like a 12-cylinder Hummer, ... > Whereas PyFLTK feels more like an average suburban 4-door sedan Interesting. What would Tkinter be at that car dealership? What about PyGTK? -- http://mail.python.org/mailman/listinfo/python-list

Re: gmpy 1.01 rc near... anybody wanna test>

2005-11-07 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > gmpy users able to download and build from sourceforge's cvs are > encouraged to test the current CVS version. Oh cool, I wondered whether any gmpy maintenance was still going on. I'll see if I can give the new version a try. -- http://mail.python.org/m

Re: Using python for writing models: How to run models in restricted python mode?

2005-11-07 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > I suspect your best bet might be to write a mini-language using > Python, and get your users to use that. You will take a small > performance hit, but security will be very much improved. > > What do others think? That is the only approach that makes

Re: Using python for writing models: How to run models in restricted python mode?

2005-11-07 Thread Paul Rubin
"vinjvinj" <[EMAIL PROTECTED]> writes: > No. I was hoping to leverage the work done for restricted pythonscript > by zope at: > > http://www.zope.org/Control_Panel/Products/PythonScripts/Help/PythonScript.py How does Pythonscript deal with xxx = 'x' * 10 as a memory DOS attack? -- htt

Re: How to convert a number to hex number?

2005-11-08 Thread Paul Rubin
"dcrespo" <[EMAIL PROTECTED]> writes: > >>>hex(255)[2:] > 'ff' '%x'%255 is preferable since the format of hex() output can vary. Try hex(33**33). -- http://mail.python.org/mailman/listinfo/python-list

Re: which feature of python do you like most?

2005-11-08 Thread Paul Rubin
Alex Stapleton <[EMAIL PROTECTED]> writes: > People like Python as a whole usually. It's not like C++ or PHP or > anything where it's generally usable and occasionally pisses you off. As somebody once said about Lisp, "you can feel the bits between your toes". -- http://mail.python.org/mailman/li

Re: How to convert a number to hex number?

2005-11-08 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > > Try hex(33**33). > > You're usually smarter than this, or am I missing some joke? > > >>> hex(33*33) > '0x441' You used only one * (multiplication), I used two *'s (exponentiation). >>> hex(33**33) '0x5857366DCE0162CB5DDCD1BF0FC7C03A6438304

Re: random number generator thread safety

2005-11-08 Thread Paul Rubin
"Raymond Hettinger" <[EMAIL PROTECTED]> writes: > Thread-safety has nothing to do with preserving entropy or guarding > against attack. All of the entropy in an MT sequence is contained in > the seed (upto 624 bytes) and that entropy is preserved through all > subsequent calls. I think the concer

Iterator addition

2005-11-09 Thread Paul Rubin
Is there a good reason to not define iter1+iter2 to be the same as itertools.chain(iter1, iter2)? Examples: # all lines in a collection of files, like perl <> all_lines = file1 + file2 + file3 candidate_primes = (2,) + (1+2*i for i in itertools.count(1)) # candidate_primes is 2,3,5,7

Re: Iterator addition

2005-11-09 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > > Is there a good reason to not define iter1+iter2 to be the same as > If you mean for *ALL* built-in types, such as generators, lists, files, > dicts, etc, etc -- I'm not so sure. Yes, that's what I mean. > Right now, if I mistakenly try to add a list

Re: [ x for x in xrange(10) when p(x) ]

2005-11-10 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > How does a useless generator expression make it more generic? > > xrange is only picked as an example. I may be newbie on python but not > that dumb if all I want is a list of integer(sorted) that meets certain > criteria. > > takewhile(p, (x fo

Re: exceptions, internals (introspection?)

2005-11-10 Thread Paul Rubin
"ej" writes: > I have often wondered how to get at other internals, such as the name of > the current function, file, line number I am in? The arguments to the > current function, etc. It's messy. Look at sys.exc_info() and go from there. -- http://mail.python.org/mailman/listinfo/python-

Re: exceptions, internals (introspection?)

2005-11-10 Thread Paul Rubin
"ej" writes: > for key in dir(traceback_): > print "traceback_.%s =" % key, eval("traceback_.%s" % key) Don't use eval for this. Use getattr(traceback_, key). > traceback_.tb_frame = > traceback_.tb_lasti = 18 > traceback_.tb_lineno = 6 > traceback_.tb_next = None Yeah. As /F men

Re: different binding behavior

2005-11-10 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Imagine that ints could be changed in place. Then you could do this: > > x = 0 > x += 1 No nothing like that. Nothing stops you from having multiple int objects with the same value. Lists, for example, are mutable, but x = [0,1] x += [2,3] doe

Re: LARGE numbers

2005-11-11 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > As the author of gmpy, I'd like to point out that the speed difference > isn't all that large, if all you're doing is ordinary arithmetic -- a > few times at most (it can be better if you need some of GMP's > functionality which gmpy exposes, such as prim

Re: LARGE numbers

2005-11-11 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Python's native longs use Karatsuba multiplication with is O(n^1.585). > My early version of DecInt (BigDecimal) uses 4-way Toom-Cook ... Wow, cool! Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: list of lambda

2005-11-11 Thread Paul Rubin
jena <[EMAIL PROTECTED]> writes: > l=[lambda:x.upper() for x in ['a','b','c']] > then l[0]() returns 'C', i think, it should be 'A' Yeah, this is Python late binding, a standard thing to get confused over. You want: l = [lambda x=x: x.upper() for x in ['a', 'b', 'c']] -- http://mail.python.or

Re: Internal Variables

2005-11-11 Thread Paul Rubin
James Colannino <[EMAIL PROTECTED]> writes: > Basically, I just want to know how from within a script I can get > information about the python interpreter that I'm running. Thanks in > advance. import sys print sys.version -- http://mail.python.org/mailman/listinfo/python-list

Re: Python obfuscation

2005-11-12 Thread Paul Rubin
"The Eternal Squire" <[EMAIL PROTECTED]> writes: > Without copyright, how could one possibly earn a living writing a > novel? This guy seems to be doing ok: http://craphound.com His publishers are the only ones allowed to sell his novels commercially, but you can download them all and print the

Re: Addressing the last element of a list

2005-11-14 Thread Paul Rubin
Antoon Pardon <[EMAIL PROTECTED]> writes: > We could then have something like the following. > > a = 5 > b = a > a @= 7 > b ==> would result in 7. Ouch! :-((( Can't you live with a = [5] b = a a[0] = 7 so b[0] is now 7. -- http://mail.python.org/mailman/listinfo/python-list

Re: best cumulative sum

2005-11-22 Thread Paul Rubin
Here's a silly recursive version (don't really use, it's too slow): def csum(s): if len(s)==0: return s return csum(s[:-1]) + [sum(s)] -- http://mail.python.org/mailman/listinfo/python-list

Re: matching a string to extract substrings for which some function returns true

2005-11-22 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > > put in a html page as the value of a hidden variable. And when i get > > the string again, i want to cast it back as list of tuples:... > This is a serious security risk, as you can't trust the data not to do > arbitrary things to your system when eval'ed.

Re: the PHP ternary operator equivalent on Python

2005-11-23 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > dNewDataFields['CODE'] = dOldDataFields['CODEDATA'] > dNewDataFields['DATE'] = dOldDataFields['DATE'] > if dOldDataFields['CONTACTTYPE'] == 2: > dNewDataFields['CONTACT'] = dOldDataFields['FIRSTCONTACT'] > else: > dNewDataFields['CONTACT'] = dOl

Re: FTP over TLS

2005-11-23 Thread Paul Rubin
Carl Waldbieser <[EMAIL PROTECTED]> writes: > Does anyone know of any good examples for writing client side code > to upload files over a secure FTP connection? I am referring to > FTPS, *not* SFTP, which I found out the hard way are two different > things. I am not really all that familiar with

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > Peano's axioms are perfectly abstract, as far as I recall. Russell and > Whitehead did try to construct naturals from sets (defining, e.g., '5' > as "the set of all sets with five items"), but that was before the > inherent contradictions of set theory w

Re: wxPython Licence vs GPL

2005-11-24 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > On the other hand, so long as the price is lower than the cost of > recreating the software for someone, then it's better for society as > a whole if it exists at all. I don't think that's correct. Having nothing can be better than having something, becaus

Re: Making immutable instances

2005-11-24 Thread Paul Rubin
[EMAIL PROTECTED] (Björn Lindström) writes: > As I said before, I think you're confusing the (in Python pretty > non-existent) concept of encapsulation with Python's immutable types, > which are immutable because the implementation demands it. (A fact I > hope will disappear at some point.) What i

Re: Making immutable instances

2005-11-24 Thread Paul Rubin
"Giovanni Bajo" <[EMAIL PROTECTED]> writes: > > However, when you prevent a client from adding an attribute, you're > > not merely making your objects immutable, you're making them > > static. No I don't believe that. If an object is immutable, then obj.serialize() should return the same string e

Re: Making immutable instances

2005-11-25 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > There isn't a standard serialize method in Python, so I don't know how > you want to define it. Well, consider pickle, for example. > I can think of perfectly reasonable definitions > of serialize where obj.serialize() won't always return the same string >

Re: wxPython Licence vs GPL

2005-11-25 Thread Paul Rubin
Ed Jensen <[EMAIL PROTECTED]> writes: > I think free software/open source has existed long enough and with > enough varied licenses (GPL, LGPL, modified LGPL (see wxWidgets), BSD, > X11, MIT, Apache, etc.) that we'd basically know without question if > less restritive licenses (like BSD) were causi

Re: Python as Guido Intended

2005-11-26 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > Those two statements say the same thing. Part of the Python philosphy, > from "import this", is that there should only be one obvious way to do > it. By enabling that part of Python's philosphy, you're automatically > limiting python to not allow other - spe

Re: General question about Python design goals

2005-11-27 Thread Paul Rubin
Robert Kern <[EMAIL PROTECTED]> writes: > Yes. If it's not going to be used, then there's not much point. > Practicality beats purity, and all that. Geez man, "practicality beats purity" only means that if maintaining purity of something is impractical, you can judiciously let purity slide. It do

Re: General question about Python design goals

2005-11-27 Thread Paul Rubin
Robert Kern <[EMAIL PROTECTED]> writes: > Fine. Allow me to rephrase. Development is primarily motivated by > practical needs and guided by notions of purity. That's bogus; if there was a discrepancy someone noticed and had to work around, there's already been a practical failure, just not a seve

Re: General question about Python design goals

2005-11-27 Thread Paul Rubin
Jean-Paul Calderone <[EMAIL PROTECTED]> writes: > >I can't think of a single use case for the addition (+) operator > >working where either of the operands happens to be the number > >0x15f1ef02d9f0c2297e37d44236d8e8ddde4a34c96a8200561de00492cb94b82 (a > >random number I just got out of /dev/urando

Re: Death to tuples!

2005-11-27 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > The new intended use is as an immutable sequence type, not a > "lightweight C struct". The new name to denote this new use - > following in the footsteps of the set type - is "frozenlist". The > changes to the implementation would be adding any non-mutating

Re: wxPython Licence vs GPL

2005-11-28 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > If you want me to agree that the GPL puts more conditions on distribution > than the MIT/BSD licence, then I'll happily agree. If you want me to > describe that as a "restrictive licence", then I refuse. With the GPL, you get a slight restriction from

Re: wxPython Licence vs GPL

2005-11-28 Thread Paul Rubin
Paul Rubin <http://[EMAIL PROTECTED]> writes: > With the GPL, you get a slight restriction from the GPL author (you're > not allowed to redistribute the binary unless you offer source). Forgot to add: and under the GPL, you must not threaten to have the goverment c

Re: Death to tuples!

2005-11-28 Thread Paul Rubin
[EMAIL PROTECTED] writes: > For those of us not following this thread closely, can you identify cases > where tuples are mutable, not hashable or can't be used as dictionary keys? > I've never encountered any such cases. t = ([1,2], [3,4]) -- http://mail.python.org/mailman/listinfo/python-list

Re: FTP over TLS

2005-11-28 Thread Paul Rubin
"adam" <[EMAIL PROTECTED]> writes: > I'm not 100% sure whether this answers your problem, but I would ignore > getting a special TLS module and just concentrate on the ftp side of > the protocol. If your connection to your ftp server must be in TLS, you > could modify you socket module similar to h

Re: Death to tuples!

2005-11-28 Thread Paul Rubin
"Paddy" <[EMAIL PROTECTED]> writes: > I would consider > t = ([1,2], [3,4]) > to be assigning a tuple with two list elements to t. > The inner lists will be mutable but I did not know you could change the > outer tuple and still have the same tuple object. Whether t is mutable is a question of d

Re: return in loop for ?

2005-11-28 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > Which means you can't create a verifier which will verify all > programs. Is there a reason to believe that you can't have a verifier > with three possible outcomes: Correct, Incorrect, and I don't know, > and it is always correct in doing so? Note that "I d

Re: return in loop for ?

2005-11-28 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > >> Which means you can't create a verifier which will verify all > >> programs. Is there a reason to believe that you can't have a verifier > >> with three possible outcomes: Correct, Incorrect, and I don't know, > >> and it is always correct in doing so? No

Re: return in loop for ?

2005-11-28 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > I don't know what the state of the art is, but I suspect it > will be a long, long time before it is as easy as running "import > mymodule; verify(mymodule)". Some pretty significant pieces of software have been formally verified to meet their formal s

Re: General question about Python design goals

2005-11-28 Thread Paul Rubin
Peter Hansen <[EMAIL PROTECTED]> writes: > Christoph Zwerschke wrote: > > Ok, these are nice aphorisms with some truth. But I had to think of > > the German excuse "Wer Ordnung hält ist nur zu Faul zum Suchen - ein > > Genie überblickt das Chaos." ("Those who try to keep things tidy are > > just to

Re: Instantiating classes which are derived from built-in types.

2005-11-28 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > A is oldstyle -- a wart existing for backwards compatibility. I think it's time for "from __future__ import newclasses" since I hate having to type "class A(object):" instead of "class A:" all over the place. -- http://mail.python.org/mailman/listinfo/p

Re: Which License Should I Use?

2005-11-29 Thread Paul Rubin
Robert Kern <[EMAIL PROTECTED]> writes: > It's a draft, but it contains useful information. Also, Larry Rosen's > book _Open Source Licensing_ is quite helpful (and free!). > > http://rosenlaw.com/oslbook.htm That is the guy who claims it is impossible to release anything into the public domain

Re: Which License Should I Use?

2005-11-29 Thread Paul Rubin
"mojosam" <[EMAIL PROTECTED]> writes: > I will be doing the bulk of the coding on my own time, because I need > to be able to take these tools with me when I change employers. > However, I'm sure that in the course of using these tools, I will need > to spend time on the job debugging or tweaking t

Re: Which License Should I Use?

2005-11-29 Thread Paul Rubin
"Andrew Koenig" <[EMAIL PROTECTED]> writes: > > Definitely not. The most recent change to the copyright laws made > > works of music recorded to fullfill a contract "work for hire" by > > default. > > If there's a contract -- i.e., a written agreement, then why does it matter? Music recordings of

Re: Which License Should I Use?

2005-11-29 Thread Paul Rubin
Robert Kern <[EMAIL PROTECTED]> writes: > Is that why the CC Public Domain Dedication has the subtitle > "Copyright-Only Dedication (based on United States law) or Public Domain > Certification"? > > Lessig isn't sure. E.g. http://www.lessig.org/blog/archives/001066.shtml Hmm, interesting, thanks

Re: Which License Should I Use?

2005-11-29 Thread Paul Rubin
Paul Rubin <http://[EMAIL PROTECTED]> writes: > > Lessig isn't sure. E.g. http://www.lessig.org/blog/archives/001066.shtml > Hmm, interesting, thanks. Bah, the CC link from there leads to a Zope crash (at least right now): http://creativecommons.org/license/publicdomain-

Re: Which License Should I Use?

2005-11-29 Thread Paul Rubin
Robert Kern <[EMAIL PROTECTED]> writes: > This is the current URL: > http://creativecommons.org/licenses/publicdomain/ Thanks, yeah, I remember seeing that, which is what made me say that CC recognized PD dedications (at least in the US--it's unreasonable to expect to account for every weird law

Re: wxPython Licence vs GPL

2005-11-29 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > > if I owned a company making profit on software sales (sale =! > > support) you sign a death wish for using GPL > > Apart from Microsoft, and possibly Quark (makers of Quark Express desktop > packaging software), and perhaps a few console game develop

Re: python number handling - tiny encryption algorithm

2005-11-29 Thread Paul Rubin
Kinsley Turner <[EMAIL PROTECTED]> writes: > In my version, I end up with hugely long integers, which have obviously > not be constrained into the 4-byte unsigned longs that TEA is expecting. Yeah, Python promotes to long int now. The simplest way to do the 32-bit arithmetic you need is probably

Re: Dive into Python PDF

2005-11-29 Thread Paul Rubin
"Franz Mueller" <[EMAIL PROTECTED]> writes: > is there a nicer looking version of the "Dive into Python" PDF? > The one from diveintopython.org looks horrible, much worse than the > web-version; also the images aren't where they should be. The one there looks ok to me, though I'm not sure what it'

Re: Making immutable instances

2005-11-29 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > When it was suggested that a facility for doing this be added to the > language, I asked for a use case for it. Nobodies come up with a > reason for placing such restriction on the client yet. If you've got a > use case, I'd be interested in hearing it. I s

Re: Which License Should I Use?

2005-11-29 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Then probably the best licence to use is just to follow the lead of > Python. For that sort of small program of limited value, I put something > like this in the code: > > Copyright (c) 2005 Steven D'Aprano. > Released under the same license as used by

Re: General question about Python design goals

2005-11-29 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > But a programming language (or UI) is not just a collection of syntax > and and interfaces - it's an implementation. You need to keep in mind > that "practicality beats purity". An awful lot of the time in this newsgroup, "practicality beats purity" transl

Re: Which License Should I Use?

2005-11-29 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > >> Definitely not. The most recent change to the copyright laws made > >> works of music recorded to fullfill a contract "work for hire" by > >> default > The default applies if the contract doesn't say who owns the > work. This was a move by the recordi

Re: Making immutable instances

2005-11-29 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > Letting the class author declare whether or not the client can add > attributes is wrong for the same reasons - and in the same places - > that letting the class author declare that the client shouldn't be > allowed to access specific attributes, and so on,

Re: General question about Python design goals

2005-11-29 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > > An awful lot of the time in this newsgroup, "practicality beats > > purity" translates as "the programmer can just be a lazy slob". > > You post that as if it were a bad thing. Yes. The idea of using a program that someone else wrote, is that they do th

Re: sha1,256,512 on files

2005-11-30 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I see that Python supports the sha-1. But I need to make sha value in > big files to (swap file, iso-s, etc.). Possible that file size more > than 2 GB, so I cannot read as string... > How to get the sha value of a file ? Use the sha.update method

Re: Making immutable instances

2005-12-01 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > Lots of people seem to want immutable instances. Nobody seems to have > a use case for them. What is the use case for immutable strings? Why shouldn't strings be mutable like they are in Scheme? Generally if I know I don't plan to mutate something, I'd wa

Re: General question about Python design goals

2005-12-01 Thread Paul Rubin
Donn Cave <[EMAIL PROTECTED]> writes: > Right. After devoting a lengthy post to the defense of > tuples as a structured type, I have to admit that they're > not a very good one ... > Another theme that occasionally comes up in advice from the > learned has been "use a class". There's a historic

Re: General question about Python design goals

2005-12-01 Thread Paul Rubin
Donn Cave <[EMAIL PROTECTED]> writes: > > There's a historical issue too: when tuples started first being > > used this way in Python, classes had not yet been introduced. > > When was that, old-timer? It was before my time, but I have the impression that classes arrived with 1.3 or somewhere aro

Re: General question about Python design goals

2005-12-01 Thread Paul Rubin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > fwiw, the tuple and class implementation were both checked into > CVS in october 1990. > > maybe he's talking about ABC? No I think I'm just plain mistaken. For some reason I thought classes came much later. It was way before my time so I defer to

Re: JOB: Telecommute Python Programmer - IMMEDIATE NEED

2005-12-02 Thread Paul Rubin
"Beau Gould" <[EMAIL PROTECTED]> writes: > JOB: Telecommute Python Programmer - IMMEDIATE NEED > Please see www.superiorss.com/jobs.htm I hope this person is not trying to spam web BBS's, wikis, etc. -- http://mail.python.org/mailman/listinfo/python-list

Re: what's wrong with "lambda x : print x/60,x%60"

2005-12-05 Thread Paul Rubin
Sybren Stuvel <[EMAIL PROTECTED]> writes: > > No, it is not merely a shortcut. It often allows one to avoid > > polluting the namespace with a completely superfluous function name, > > thus reducing code smell. > > Which can also be done by using inner functions. Inner functions with no names?

Re: Bitching about the documentation...

2005-12-05 Thread Paul Rubin
François Pinard <[EMAIL PROTECTED]> writes: > > Let me repeat this for the umpteenth time: You do not have to learn > > LaTeX to contribute to docs. Submit plain text. One of us with > > some LaTeX knowledge will do the markup. Content is the hard part. > > Markup is nothing, so don't let it be

Re: what's wrong with "lambda x : print x/60,x%60"

2005-12-05 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > Defining a function, and giving it a name, > isn't "polluting the namespace", any more than assigning > sub-expressions to temporary variables is polluting the namespace. Nor any less. > Why use temporary variables when all you have to do is make your >

Re: Bitching about the documentation...

2005-12-05 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Sounds like a subject matter expert is needed here, not a garden variety > tech writer or Python programmer. Documentation of esoteric stuff requires, > well, esoteric knowledge. Yes, that's what I mean; coding a library module for an esoteric function requires that sa

Re: Bitching about the documentation...

2005-12-05 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > Or, better still, by an accomplished writer who has access to the > code's author. This was indeed my experience in writing the docs for > previously undocumented modules. The author was happy to help me by > answering questions, and this did make the docs

Re: Bitching about the documentation...

2005-12-05 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Redhat's Fedora project seems to have a fairly well developed > program for recruiting and encouraging writers. Frankly I haven't been that impressed with the Fedora docs I've seen. The LDP docs have generally been better. Maybe I'm looking at the wrong Fedora docs. F

Re: Bitching about the documentation...

2005-12-05 Thread Paul Rubin
"BartlebyScrivener" <[EMAIL PROTECTED]> writes: > >>The solution is clear: the distro maintainers should require that all > code contributions must come with good docs. > Well, that might be asking a bit too much of the programmers, who > perhaps don't exactly enjoy mucking about in the lowlands o

Re: Tabs bad

2005-12-05 Thread Paul Rubin
[EMAIL PROTECTED] (Björn Lindström) writes: > Actually using tabs for eight spaces and then filling out with spaces to > the correct indentation is the convention for Emacs Lisp. Of course, > since everyone coding Emacs Lisp does it with the same editor, it's no > problem. The variable `indent-tab

Re: what's wrong with "lambda x : print x/60,x%60"

2005-12-06 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I think there is, for python. Not that I agree with it. The language > doesn't prevent you from using the short one-liner style but the idioms > prefer the line by line(and one single op/action per line) style. Are you serious?!! You're saying idiomatic Python prefers

Re: Bitching about the documentation...

2005-12-06 Thread Paul Rubin
François Pinard <[EMAIL PROTECTED]> writes: > > You may suggest that I should process my e-mail more promptly. > > No, I'm not suggesting you how to work, no more that I would accept > that you force me into working your way. If any of us wants to force > the other to speak through robots, that o

<    2   3   4   5   6   7   8   9   10   11   >