Re: Python evolution: Unease

2005-01-05 Thread Paul Rubin
[EMAIL PROTECTED] writes: Dunno about Fedora, I stopped using Red Hat just because they were *not* using the standard Python distribution, and the version they shipped was cripped in various ways. Eh? I used Red Hat for a long while and don't remember their crippling the Python distribution.

Re: Python evolution: Unease

2005-01-05 Thread Paul Rubin
EP [EMAIL PROTECTED] writes: Python: it tastes so good it makes you hungrier. QOTW -- http://mail.python.org/mailman/listinfo/python-list

Re: Concepts RE: Python evolution: Unease

2005-01-05 Thread Paul Rubin
Roman Suzi [EMAIL PROTECTED] writes: As for concepts, they are from Generic Programming (by Musser and Stepanov) and I feel that Python is in position to implement them to the fullest extent. And IMHO it will be nicer than just Java-like interfaces or Eiffel's contract approach. I keep

Re: Concepts RE: Python evolution: Unease

2005-01-05 Thread Paul Rubin
Paul Rubin http://[EMAIL PROTECTED] writes: There is nothing in Wikipedia about [Generic programming]. Oops: http://en.wikipedia.org/wiki/Generic_programming This helps. But I don't see how it's different from what used to be called polymorphism. -- http://mail.python.org/mailman/listinfo

Re: Python evolution: Unease

2005-01-05 Thread Paul Rubin
Ville Vainio [EMAIL PROTECTED] writes: Paul I can't parse that. It says two contradictory things. Paul Sentence 2 says that if something essential is not in the Paul (Python) distro then the (Python) distro maintainers have Paul screwed up. Sentence 1 says it's the Fedora

Re: is python more popular than coldfusion?

2005-01-05 Thread Paul Rubin
[EMAIL PROTECTED] writes: But Python IS tied for first. This may indicate that the relatively small number of jobs listing Python as a requirement is due in part to a relatively small supply of Python programmers, not lack of demand for such programmers. I think it mostly means Python

Re: Python evolution: Unease

2005-01-05 Thread Paul Rubin
Skip Montanaro [EMAIL PROTECTED] writes: Okay, then start doing the work necessary to incorporate that stuff into the core. Get Fredrik to say okay to including his Tkinter docs, then do what it takes to incorporate it. The fact that Fredrik can check those docs in himself but hasn't after

Re: Securing a future for anonymous functions in Python

2005-01-05 Thread Paul Rubin
Nick Coghlan [EMAIL PROTECTED] writes: Do you consider generator expressions or list comprehensions deficient because they don't allow several statements in the body of the for loop? I don't see what it would mean to do otherwise. -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting on keys in a list of dicts

2005-01-06 Thread Paul Rubin
J Berends [EMAIL PROTECTED] writes: Suppose I have a list of dictionaries and each dict has a common keyname with a (sortable) value in it. How can I shuffle their position in the list in such way that they become sorted. Do I understand the question right? Can't you just say

Re: Embedding a restricted python interpreter

2005-01-06 Thread Paul Rubin
Jp Calderone [EMAIL PROTECTED] writes: A Python sandbox would be useful, but the hosting provider's excuse for not allowing you to use mod_python is completely bogus. All the necessary security tools for that situation are provided by the platform in the form of process and user

Re: The Industry choice

2005-01-06 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: Yes, apart from libraries and similar cases (frameworks etc), it's no doubt rare for closed-source end-user packages to be sold with licenses that include source and allow you to do anything with it. However, allowing customization (at least for

Re: Embedding a restricted python interpreter

2005-01-06 Thread Paul Rubin
Peter Maas [EMAIL PROTECTED] writes: I think PHP has a safe mode which solves the probem of isolating scripts of different users on application level. This is not optimal but better than nothing. Best solution would probably be to create a thread for each request that can operate only with the

Re: Embedding a restricted python interpreter

2005-01-06 Thread Paul Rubin
Gerhard Haering [EMAIL PROTECTED] writes: But mod_python is an apache module and runs in the same apache process with other users' scripts. Which is why it's a good idea for each customer to have it's own system user and their virtual hosts running under this uid. Which was the idea for

Re: The Industry choice

2005-01-06 Thread Paul Rubin
Jeff Shannon [EMAIL PROTECTED] writes: Note that the so-called 'viral' nature of GPL code only applies to *modifications you make* to the GPL software. Well, only under an unusually broad notion of modification. The GPL applies to any program incorporating GPL'd components, e.g. if I

Re: The Industry choice

2005-01-06 Thread Paul Rubin
Bulba! [EMAIL PROTECTED] writes: Making derived work proprietary in no way implies that the base work is publicly unavailable anymore. Since you want to be able to incorporate GPL code in your proprietary products, and say there's no problem since the base work is still available from the same

Re: Securing a future for anonymous functions in Python

2005-01-06 Thread Paul Rubin
Jeff Shannon [EMAIL PROTECTED] writes: It seems to me that in other, less-dynamic languages, lambdas are significantly different from functions in that lambdas can be created at runtime. What languages are those, where you can create anonymous functions at runtime, but not named functions?!

Re: The Industry choice

2005-01-06 Thread Paul Rubin
[EMAIL PROTECTED] (Aahz) writes: I don't like what I perceive as end effect of what GPL license writers are attempting to achieve: vendor lock-in. And my counter-argument is that I believe your perception is wrong. If I agreed with your focus on lock-in, I'd say that what the GPL is trying

Re: Python evolution: Unease

2005-01-06 Thread Paul Rubin
Terry Reedy [EMAIL PROTECTED] writes: Would it be possible, at least for Windows, to write a Python script implementing a 'virtual distribution'? IE, download Python, install it, download next package, install it, etc. -- prefereably table driven? I just don't understand why you'd want to

Re: Python evolution: Unease

2005-01-07 Thread Paul Rubin
adamc [EMAIL PROTECTED] writes: I've not experienced problems installing wxPython on Debian (unstable). It just *works* out of the box with apt-get. Perhaps this is more of a problem with the package maintainers? I think the problem I encountered was that the version of WxWidgets currently on

Re: Excluded and other middles in licensing

2005-01-07 Thread Paul Rubin
Robert Kern [EMAIL PROTECTED] writes: http://en.wikipedia.org/wiki/Closed_source any program whose licensing terms do not qualify as open source. A definition with a nice big This article may need to be reworded to conform to a neutral point of view warning at the top. ;-) ... There

Re: Excluded and other middles in licensing

2005-01-07 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: Note also from the Heine-Borel theorem that every closed source program can be covered by some finite collection of open source programs. Every _compact_ one, surely? Quoting by heart from old memories, but, isn't Heine-Borel about (being able

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Paul Rubin
Anna [EMAIL PROTECTED] writes: Having taken some calculus (derivatives, limits, some integrals) but never even heard of lambda calculus, to me, lambda means absolutely NOTHING. Less than nothing. Lambda calculus is from mathematical logic, but more to the point lambda has been the term used in

Re: Python evolution: Unease

2005-01-07 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: Paul Rubin http://[EMAIL PROTECTED] wrote: Really, I just want to buy a new computer, turn it on, and have everything there. That's generally impossible without running satanware from Redmond The princes of insufficient light from Cupertino

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Paul Rubin
Steve Holden [EMAIL PROTECTED] writes: Perhaps what we really need is a good Lisp subsystem for Python? I've thought the other way around, it would be nice to have a Python subsystem for Lisp. -- http://mail.python.org/mailman/listinfo/python-list

Re: The Industry choice

2005-01-07 Thread Paul Rubin
Bulba! [EMAIL PROTECTED] writes: From the viewpoint of looking at availability of source code A, it's completely irrelevant if those guys are fishmongers or make derived work A' and redistribute only binary of A'. Not a single line of publicly available source code appeared or disappeared

Re: Securing a future for anonymous functions in Python

2005-01-07 Thread Paul Rubin
Nick Coghlan [EMAIL PROTECTED] writes: Add in the fact that there are many, many Python programmers with non-CS backgrounds, and the term 'lambda' sticks out like a sore thumb from amongst Python's other English-based keywords. 'def' is probably the second-most cryptic when you first encounter

Re: Python Operating System???

2005-01-07 Thread Paul Rubin
[EMAIL PROTECTED] (Michael Hobbs) writes: The problem when using Python instead of C for OS development is that C was *specifically designed* to create an OS, while Python was designed for completely different purposes. If you want to write an OS, it would be wise to use a language that is

Re: python3: 'where' keyword

2005-01-07 Thread Paul Rubin
Donn Cave [EMAIL PROTECTED] writes: I don't by any means agree that this notation is worth adopting, and in general I think this kind of readability issue is more or less a lost cause for a language with Python's scoping rules, but the motive makes sense to me. But we're talking about the

Re: DOS problem (simple fix??)

2005-01-07 Thread Paul Rubin
Gavin Bauer [EMAIL PROTECTED] writes: Thank you, and please make all answers simple enough to be understood by a highschool student and his father :) . You might like to try IDLE, which is included with Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: A Fundamental Turn Toward Concurrency in Software

2005-01-07 Thread Paul Rubin
aurora [EMAIL PROTECTED] writes: Just gone though an article via Slashdot titled The Free Lunch Is Over: A Fundamental Turn Toward Concurrency in Software [http://www.gotw.ca/publications/concurrency-ddj.htm]. It argues that the continous CPU performance gain we've seen is finally over. And

Re: how to extract columns like awk $1 $5

2005-01-07 Thread Paul Rubin
[EMAIL PROTECTED] (Roy Smith) writes: Something along the lines of: words = input.split() print words[4], words[5] That throws an exception if there are fewer than 6 fields, which might or might not be what you want. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Operating System???

2005-01-07 Thread Paul Rubin
Arich Chanachai [EMAIL PROTECTED] writes: But I thought Python was an all-purpose language. After all, OS's have been written in Lisp before too. Pure Lisp? Or a Lisp/C/Asm combo? Lisp has a compiled flavor by the way. Compiled flavor? Lisp has been compiled since the 1950's. No,

Re: python3: 'where' keyword

2005-01-07 Thread Paul Rubin
Nick Coghlan [EMAIL PROTECTED] writes: Usage could be something like: res = [ f(i) for i in objects ] where: def f(x): #do something Hmm, this is actually a really interesting idea. Avoiding accidental namespace conflicts is certainly one of the advantages of using

Re: Python Operating System???

2005-01-08 Thread Paul Rubin
Roose [EMAIL PROTECTED] writes: An OS is NOT an application. It is a completely different kind of program. Do you guys understand the difference between user and kernel mode? Do you know what address spaces and hardware interrupts are? Python is not equipped to handle these things. You

Re: python3: 'where' keyword

2005-01-08 Thread Paul Rubin
AdSR [EMAIL PROTECTED] writes: Killer app for this keyword: class C(object): x = property(get, set) where: def get(self): return Silly property def set(self, val): self.x = Told you it was silly Hey, this is super-elegant! Heh, even further: z = C()

Re: The best way to do web apps with Python?

2005-01-08 Thread Paul Rubin
worzel [EMAIL PROTECTED] writes: What is the best way to web developemnt with Python? Is there anything close to PHP style in-page script placement that can create and use other Python objects? I am not really interested in Zope (I believe that is more a CMS than anything else?) I am also

Re: Embedding a restricted python interpreter

2005-01-08 Thread Paul Rubin
Dieter Maurer [EMAIL PROTECTED] writes: It uses a specialized compiler that prevents dangerous bytecode operations to be generated and enforces a restricted builtin environment. Does it stop the user from generating his own bytecode strings and demarshalling them? --

Re: Python Operating System???

2005-01-08 Thread Paul Rubin
Roose [EMAIL PROTECTED] writes: Is an OS written in Lisp also ludicrous? Because it's been done. Can you point me to this? I'd like to see how truly Lisp it is. http://en.wikipedia.org/wiki/Lisp_machine My first guess would be -- not very. And I'd like to install it on my PC. Although

Re: Pre/Postconditions with decorators

2005-01-08 Thread Paul Rubin
Stephen Thorne [EMAIL PROTECTED] writes: Unresolved Problems: 1) How do you handle duck types, i.e. a method that accepts StringIO, cStringIO or any other object that has a .readlines(), .seek() and .read() method? That should really be done through having those classes inherit a

Re: python3: 'where' keyword

2005-01-08 Thread Paul Rubin
Carl Banks [EMAIL PROTECTED] writes: You misunderstand. There where is not part of the expression but the statement. The above example would be a modified print statement, a print...where statement, if you will. Under this suggestion, there would be modified versions of various simple

Re: python3: 'where' keyword

2005-01-08 Thread Paul Rubin
Carl Banks [EMAIL PROTECTED] writes: # compute sqrt(2) + sqrt(3) x = (sqrt(a) where: a = 2.) \ + sqrt (a) where: a = 3. Hmmm. What would be the advantage of that over this? . x = sqrt(a) + sqrt(b) where: . a = 2.0 . b = 3.0 The idea

Re: python3: 'where' keyword

2005-01-08 Thread Paul Rubin
Nick Coghlan [EMAIL PROTECTED] writes: I think having to keep the names unique within the statement you are currently writing is a reasonable request :) Um, you could say the same thing about the function, the module, etc. ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: python3: 'where' keyword

2005-01-08 Thread Paul Rubin
Nick Coghlan [EMAIL PROTECTED] writes: x = (sqrt(a) where (a=2.0)) + (sqrt(b) where (a=3.0)) Hmm, I like that too. -- http://mail.python.org/mailman/listinfo/python-list

Re: The best way to do web apps with Python?

2005-01-09 Thread Paul Rubin
Steve Holden [EMAIL PROTECTED] writes: You can read about it in Philip Eby's excellent PEP at http://www.python.org/peps/pep-0333.html I looked at this and I have the impression that it tries to do something worthwhile, but I can't tell precisely what. The rationale and goals section

Re: Pre/Postconditions with decorators

2005-01-09 Thread Paul Rubin
Stephen Thorne [EMAIL PROTECTED] writes: It should be left on. Leaving it in for development and turning it off for production is like wearing a parachute during ground training and taking it off once you're in the air. So we can't use this for a case where we have an extremely large list

Re: python3: 'where' keyword

2005-01-09 Thread Paul Rubin
Nick Coghlan [EMAIL PROTECTED] writes: Trying to push it a level further (down to expressions) would, IMO, be a lot of effort for something which would hurt readability a lot. I think we should just try to do things in a simple and general way and not try to enforce readability. For example,

Re: Old Paranoia Game in Python

2005-01-09 Thread Paul Rubin
Oh cool, I sort of remember that game from back in the day. I didn't play it very much so never got very far in it. I'll have to try your version. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python3: on removing map, reduce, filter

2005-01-09 Thread Paul Rubin
Andrey Tatarinov [EMAIL PROTECTED] writes: How does GvR suggestions on removing map(), reduce(), filter() correlate with the following that he wrote himself (afaik): http://www.python.org/doc/essays/list2str.html I think that article was written before list comprehensions were added to

Re: Python3: on removing map, reduce, filter

2005-01-09 Thread Paul Rubin
Andrey Tatarinov [EMAIL PROTECTED] writes: anyway list comprehensions are just syntaxic sugar for for var in list: smth = ... res.append(smth) (is that correct?) I would expect lc's to work more like map does. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Operating System???

2005-01-09 Thread Paul Rubin
Roose [EMAIL PROTECTED] writes: I've written file systems in Python, and task schedulers in Javascript, and they were fine for their purposes Uh, not to be rude, but what are you talking about? If I'm not mistaken Javascript is that scripting language that runs inside a browser,

Re: Python Operating System???

2005-01-09 Thread Paul Rubin
Arich Chanachai [EMAIL PROTECTED] writes: Yes, compiled Lisp. There are Python compilers too.\ ??? You mean like Pyrex or some such? I wouldn't exactly call these Python compilers, as that kind of obscures some underlying (critical) facts. Also psyco. And I think Pypy is currently set

Re: Python Operating System???

2005-01-09 Thread Paul Rubin
Roose [EMAIL PROTECTED] writes: Are you actually going to answer any of my questions? Let's see this JavaScript task scheduler you have written! I wrote it at a company and can't release it. It ran inside a browser. There was nothing terribly amazing about it. Obviously the tasks it

Re: Python Operating System???

2005-01-09 Thread Paul Rubin
Arich Chanachai [EMAIL PROTECTED] writes: And I think Pypy is currently set up to compile Python into Pyrex and then run the Pyrex results through GCC. But of course, who's going to argue that Pyrex produces compiled Python? Pyrex produces compiled Python in the same sense that asm

Re: python3: 'where' keyword

2005-01-10 Thread Paul Rubin
Carl Banks [EMAIL PROTECTED] writes: So do you approve of the movement to get rid of the print statement? Any little incremental change in Python you could make by having or not having a print statement would be minor compared to the H-Bomb of ugliness we'd get if suites of statements were

Re: Port blocking

2005-01-10 Thread Paul Rubin
Mark Carter [EMAIL PROTECTED] writes: Supposing I decide to write a server-side application using something like corba or pyro. What's the chance that in big corporations, the client's ports (in both senses of the word: fee-paying, and application) will be blocked, thereby immediately

Re: python3: 'where' keyword

2005-01-10 Thread Paul Rubin
Carl Banks [EMAIL PROTECTED] writes: Paul Rubin wrote: Carl Banks [EMAIL PROTECTED] writes: So do you approve of the movement to get rid of the print statement? Any little incremental change in Python you could make by having or not having a print statement would be minor

Re: python3: 'where' keyword

2005-01-10 Thread Paul Rubin
Carl Banks [EMAIL PROTECTED] writes: When I asked you to do this, it was just a rhetorical way to tell you that I didn't intend to play this game. It's plain as day you're trying to get me to admit something. I'm not falling for it. If you have a point to make, why don't you just make it?

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 want

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 historical issue

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 around

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 your

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? It can

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 a barrier

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 same

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.

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 of English

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

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 one is

Re: Documentation suggestions

2005-12-06 Thread Paul Rubin
Steve Holden [EMAIL PROTECTED] writes: I proposed a documentation sprint for PyCon a couple of years ago, but nobody thought it was important enough to work on. It would be a good idea next year, too. IMO this should definitely be done. That nobody thought docs were important enough to work

Re: Output: Number of digits in exponent?

2005-12-06 Thread Paul Rubin
Jens Bloch Helmers [EMAIL PROTECTED] writes: How can I control the number of digits in the exponent when writing floats to a file? It seems that Python2.4.2(winXP) prints three digits anyway. print 1.0e50 1e+050 That's weird; must be version and/or OS dependent. On Fedora Core 4:

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-07 Thread Paul Rubin
Antoon Pardon [EMAIL PROTECTED] writes: But lately I have been wondering about doing the following: end = None ... if ...: ... end IMO it looks better, but I'm reluctant because it suggest some checking by the compilor, which just doesn't happen. I don't think you can always do

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

2005-12-07 Thread Paul Rubin
Steve Holden [EMAIL PROTECTED] writes: All joking aside, when I have names (temporary variables or scaffolding functions) that I need to initialise a module or data structure, but then outlive their usefulness, I del the name afterwards. Am I the only one? I can't say I've seen anyone else

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

2005-12-08 Thread Paul Rubin
Steve Holden [EMAIL PROTECTED] writes: if cond: my x = 7# make a new scope for x, goes out of scope at end of if If this genuinely troubles you then you can always isolate the scope with a function, though of course you also no longer have the code inline then. I don't

Re: Another newbie question

2005-12-08 Thread Paul Rubin
Steven D'Aprano [EMAIL PROTECTED] writes: Yes. Reaching through objects to do things is usually a bad idea. I don't necessarily disagree, but I don't understand why you say this. Why it is bad? The traditional OOP spirit is to encapsulate the object's entire behavior in the class definition.

Re: Documentation suggestions

2005-12-09 Thread Paul Rubin
Mike Meyer [EMAIL PROTECTED] writes: I'm working on puttingn this up for Python. I'm planning on using AJAX to pass the input string to eval on the server. I.e. - you'll be limited to expressions, which is what it seems like the Ruby thing is limited to. On the other hand, with iterators,

Re: Thoughts on object representation in a dictionary

2005-12-10 Thread Paul Rubin
py [EMAIL PROTECTED] writes: Well the other thing is that I am allowed to store strings in this dictionary...so I can't just store the Engine and Body object and later use them. this is just a requirement (which i dont understand either)...but its what I have to do. Probably so that the

Re: Another newbie question

2005-12-10 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: You could make a case for a 2D coordinate class being sufficiently primitive to have immutable instances, of course (by analogy with numbers and strings) -- in that design, you would provide no mutators, and therefore neither would you provide setters

Re: Another newbie question

2005-12-10 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: I could imagine using Python's built-in complex numbers to represent 2D points. They're immutable, last I checked. I don't see a big conflict. No big conflict at all -- as I recall, last I checked, computation on complex numbers was optimized

Re: Another newbie question

2005-12-10 Thread Paul Rubin
Steven D'Aprano [EMAIL PROTECTED] writes: The fact that sys is a module and not a class is a red herring. If the Law of Demeter makes sense for classes, it makes just as much sense for modules as well -- it is about reducing coupling between pieces of code, not something specific to classes.

Re: lambda (and reduce) are valuable

2005-12-11 Thread Paul Rubin
Chris Mellon [EMAIL PROTECTED] writes: As someone who does a tremendous amount of event-driven GUI programming, I'd like to take a moment to speak out against people using us as a testament to the virtues of lamda. Event handlers are the most important part of event-driven code, and making

Re: lambda (and reduce) are valuable

2005-12-12 Thread Paul Rubin
Fredrik Lundh [EMAIL PROTECTED] writes: a temporary factory function should be sufficient: def digit(label, x, y): def callback(): # print BUTTON PRESS, label # debug! user_pressed(int(label)) Button(label=label, command=callback).grid(column=x,

Re: lambda (and reduce) are valuable

2005-12-12 Thread Paul Rubin
Paul Rubin http://[EMAIL PROTECTED] writes: binops = {'+': (lambda x,y: x+y), '-': (lambda x,y: x-y), '*': (lambda x,y: x*y), '/': (lambda x,y: x/y), '**': (lambda x,y: x**y) } How would you refactor

Re: lambda (and reduce) are valuable

2005-12-12 Thread Paul Rubin
[EMAIL PROTECTED] writes: How would you refactor that, with no lambda? Or, why would you want to refactor that ? I like it the way it was written. I'm not the one saying lambda is bogus. -- http://mail.python.org/mailman/listinfo/python-list

Re: how does exception mechanism work?

2005-12-12 Thread Paul Rubin
[EMAIL PROTECTED] writes: Is this model correct or wrong? Where can I read about the mechanism behind exceptions? Usually you push exception handlers and finally clauses onto the activation stack like you push return addresses for function calls. When something raises an exception, you scan the

Re: lambda (and reduce) are valuable

2005-12-12 Thread Paul Rubin
[EMAIL PROTECTED] (Bengt Richter) writes: for tup in ((str(d+1), d%3+1,3-d//3) for d in xrange(9)): digit(*tup) tweak 'til correct ;-) GMTA. See: http://www.nightsong.com/phr/python/calc.py written a couple years ago. It uses: for i in xrange(1,10):

Re: 0 in [True,False] returns True

2005-12-13 Thread Paul Rubin
Steve Holden [EMAIL PROTECTED] writes: The really interesting question your post raises, though, is Why do you feel it's necessary to test to see whether a variable is a Boolean?. What's the point of having Booleans, if you can't tell them from integers? --

Re: newbie: generate a function based on an expression

2005-12-13 Thread Paul Rubin
Jacob Rael [EMAIL PROTECTED] writes: I read about the security concerns involved in using eval(). I don't expect this project to grow to the point where I require a web interface. However, since I am learning, I might as well learn the right way. I think you're going to have to write an

Re: I want a Python Puppy !

2005-12-13 Thread Paul Rubin
Claudio Grondi [EMAIL PROTECTED] writes: Currently Ubuntu is my favorite, because it seems to be at the moment the only Linux distribution supporting already Python 2.4.2 out of the box, Are you seriously saying that whatever distro came out most recently (and therefore have the latest Python

Re: Bad marshal data

2005-12-13 Thread Paul Rubin
Michael McGarry [EMAIL PROTECTED] writes: Marshal should save the data in a readable text format, but I guess it does not. Any help would be appreciated, RTFM. Marshal is not intended for what you're doing. Use Pickle, which is. -- http://mail.python.org/mailman/listinfo/python-list

Re: Still Loving Python

2005-12-13 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: Try Interface Builder on a Mac: it builds interfaces as _data_ files, not generated code. You can then use the same UI from Objective C, Java, Python (w/PyObjC), AppleScript... interface-painters which generate code are a really bad idea. Glade also

Re: How do (not) I distribute my Python progz?

2005-12-13 Thread Paul Rubin
Tolga [EMAIL PROTECTED] writes: Let's suppose that I have written a Python program and, of course, want to show it to the world ;-) So, do I have to distrubute my source code? Or is there a way to hide my code? You're not really showing it to the world, if you hide the source. --

Re: Developing a network protocol with Python

2005-12-14 Thread Paul Rubin
Laszlo Zsolt Nagy [EMAIL PROTECTED] writes: I already have my own classes. My objects are in object ownership trees, and they are referencing to each other (weakly and strongly). These classes have their own streaming methods, and they can be pickled safely. Standard warning: if you're

Re: Developing a network protocol with Python

2005-12-14 Thread Paul Rubin
Laszlo Zsolt Nagy [EMAIL PROTECTED] writes: But how can I transfer pure python objects otherwise? Pyro also uses Pickle and it also transfers bytecode. Pyro in the past used pickle in an insecure way. I'd heard it had been fixed and I didn't realize it still uses pickle. I read somewhere

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: To put it another way: one reason I love Python is that I strongly subscribe to the idea that there should preferably be only one obvious way to do something. Unfortunately, this principle is very badly broken by the multiplicity of Python web

Re: Enumeration idioms: Values from different enumerations

2005-12-16 Thread Paul Rubin
Ben Finney [EMAIL PROTECTED] writes: This gives meaning to the equal value comparisons, but ensures that other comparisons are errors. Comments so far? What does copy.copy of an enumeration value do? What happens if you have a list with some enumeration values inside, and you make a

Re: Wed Development - Dynamically Generated News Index

2005-12-17 Thread Paul Rubin
[EMAIL PROTECTED] writes: I am building a simple MySQL news database, which would contain, a headline, a date, main story(body) and a graphic associated with each story. I would like to generate an index of the pages in this database ( ie a news index with links to the articles) an to have a

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