Re: The best platform and editor for Python

2007-07-05 Thread Kay Schluehr
On Jul 5, 7:18 pm, kimiraikkonen <[EMAIL PROTECTED]> wrote: > I just wanted a simple answer to my simple question, however topic has > messed up. Think questioner as a beginner and use more understandable > terms to help :) > > Thanks. The problem is simply that the Python community has failed in

Re: Re-raising exceptions with modified message

2007-07-05 Thread Kay Schluehr
On Jul 5, 3:53 pm, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > What is the best way to re-raise any exception with a message > supplemented with additional information (e.g. line number in a > template)? Let's say for simplicity I just want to add "sorry" to every > exception message. My naive

Re: The best platform and editor for Python

2007-07-05 Thread Kay Schluehr
On Jul 5, 4:08 pm, Nicola Musatti <[EMAIL PROTECTED]> wrote: > On Jul 5, 1:23 pm, Gregor Horvath <[EMAIL PROTECTED]> wrote: > [...] > > > That's a property of open source projects. > > Features nobody really needs are not implemented. > > No, no, you got it all wrong. It's in *commercial* projects

Re: The best platform and editor for Python

2007-07-05 Thread Kay Schluehr
On Jul 3, 8:12 pm, [EMAIL PROTECTED] (Cameron Laird) wrote: > Python is simply easier than C++; you might > well find that a debugger, for example, doesn't feel as essential > as it is for you with C++. That's what I love most about the Python community. Whenever there is just a non-standard, pla

Re: is this a valid import sequence ?

2007-06-24 Thread Kay Schluehr
On Jun 24, 2:51 am, [EMAIL PROTECTED] (Alex Martelli) wrote: > Since that global statement is utterly useless > (it's impossible to read and understand any substantial amount of Python > code without realizing that accessing a variable not locally assigned > means you're accessing a global, so the

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-23 Thread Kay Schluehr
On 22 Jun., 08:46, John Nagle <[EMAIL PROTECTED]> wrote: > PEP 3107 seems to add negative value to the language. The > ability to add arbitrary attributes to parameters which can then > be interpreted by some external library yet to be defined is > a "l33t feature", one that's more cute than usef

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-21 Thread Kay Schluehr
On Jun 20, 8:53 pm, Stephen R Laniel <[EMAIL PROTECTED]> wrote: > Reading [1], I wonder: why isn't the compiler making better > use of (purely optional) type labeling? Why not make a compiler > directive so that > > a) it will check the types of all my arguments and return >values, and maybe e

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-15 Thread Kay Schluehr
On 15 Jun., 22:58, Douglas Alan <[EMAIL PROTECTED]> wrote: > For instance, I believe that Python is now too big, and that much of > what is in the language itself should be replaced with more general > Scheme-like features. > Then a good macro mechanism should be > implemented so that all the conv

Re: Multiline lamba implementation in python.

2007-06-12 Thread Kay Schluehr
On 12 Jun., 20:17, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jun 12, 11:36 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > > > > On 12 Jun., 16:54, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > On Jun 12, 10:12 am, Kay Schluehr <[EMAIL PROT

Re: Multiline lamba implementation in python.

2007-06-12 Thread Kay Schluehr
On 12 Jun., 16:54, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jun 12, 10:12 am, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > > On 12 Jun., 14:57, Facundo Batista <[EMAIL PROTECTED]> wrote: > > > > Remember that the *only* difference between the two fun

Re: Convert String to Int and Arithmetic

2007-06-12 Thread Kay Schluehr
On 12 Jun., 16:32, tereglow <[EMAIL PROTECTED]> wrote: > Hello, > > I am a complete newbie to Python and am accustomed to coding in PHP/ > Perl/Shell. I am trying to do the following: > > I have a string: > > cpuSpeed = 'Speed: 10' > > What I would like to do is extract the '10' fr

Re: Multiline lamba implementation in python.

2007-06-12 Thread Kay Schluehr
On 12 Jun., 14:57, Facundo Batista <[EMAIL PROTECTED]> wrote: > Remember that the *only* difference between the two functions is that > one is anonymous, and for other you have to came up with a name (name > that if is well thought, actually adds readibility to your code). The difference is that

Re: Python optimization (was Python's "only one way to do it" philosophy isn't good?)

2007-06-10 Thread Kay Schluehr
On Jun 11, 12:43 am, Steve Howell <[EMAIL PROTECTED]> wrote: > To the extent that some of these optimizations could > be achieved by writing better Python code, it would > nice for optimization tools to have a "suggest" mode. Is anyone out there who uses MS Word and doesn't deactivate the "sugges

Re: Python's "only one way to do it" philosophy isn't good?

2007-06-09 Thread Kay Schluehr
On Jun 9, 12:16 pm, James Stroud <[EMAIL PROTECTED]> wrote: > Terry Reedy wrote: > > In Python, you have a choice of recursion (normal or tail) > > Please explain this. I remember reading on this newsgroup that an > advantage of ruby (wrt python) is that ruby has tail recursion, implying > that pyt

Re: subexpressions

2007-06-01 Thread Kay Schluehr
On Jun 1, 9:51 am, "Sergey Dorofeev" <[EMAIL PROTECTED]> wrote: > Hello all! > > Please help, is there way to use sub-expressions in lambda? > For example, if I want to calculate sin(x^2)+cos(x^2) I must code: > lambda x: sin(x*x)+cos(x*x) > How to make x*x to be evaluated once? lambda x: (lambda

Re: speeding things up with C++

2007-05-28 Thread Kay Schluehr
On May 26, 11:19 am, bullockbefriending bard <[EMAIL PROTECTED]> wrote: > I've done all the requisite profiling and thought fairly deeply about > the efficiency of my python code, but am still going to have to speed > up the innermost guts of what I am doing. > > Essentially, I need to pass a list

Re: ten small Python programs

2007-05-28 Thread Kay Schluehr
Just for the amusement of the audience. The following is a reusable testscript: >>> def add_money(amounts): ... pennies = sum([round(int(amount * 100)) for amount in amounts]) ... return float(pennies / 100.0) ... >>> add_money([0.13, 0.02]) == 0.15 0.14999 >>> add_money([0.13,

Re: totally lost newbie

2007-05-27 Thread Kay Schluehr
On May 27, 12:19 pm, mark <[EMAIL PROTECTED]> wrote: > Hi all > > I posted earlier on this but have changed my approach so here is my > latest attempt at solving a problem. I have been working on this for > around 12 hours straight and am still struggling with it. > > Write a program that reads the

ANN: EasyExtend 2.0 - beta1

2007-05-20 Thread Kay Schluehr
Hi Pythonistas, EasyExtend is a grammar based preprocessor generator, code analysis and synthesis framework and metaprogramming system for Python written in Python. This is the first beta of EE 2.0. As always some novelties are implemented. This time it is Console Test an ultralightweight test fa

Re: List Moderator

2007-05-18 Thread Kay Schluehr
On May 19, 3:51 am, Beliavsky <[EMAIL PROTECTED]> wrote: > On May 18, 9:22 am, [EMAIL PROTECTED] wrote: > > > > > You're probably right, but this week has been pretty bad. Every few > > posts there's another porn or boob related link. Sheesh! > > > Mike > > I wish Google Groups were enhanced to le

Re: Erlang style processes for Python

2007-05-10 Thread Kay Schluehr
On May 10, 8:31 am, Jacob Lee <[EMAIL PROTECTED]> wrote: > Funny enough, I'm working on a project right now that is designed for > exactly that: PARLEY,http://osl.cs.uiuc.edu/parley. (An announcement > should show up in clp-announce as soon as the moderators release it). My > essential thesis is th

Erlang style processes for Python

2007-05-09 Thread Kay Schluehr
Every once in a while Erlang style [1] message passing concurrency [2] is discussed for Python which does not only imply Stackless tasklets [3] but also some process isolation semantics that lets the runtime easily distribute tasklets ( or logical 'processes' ) across physical processes. Syntactica

Re: Towards faster Python implementations - theory

2007-05-08 Thread Kay Schluehr
On May 9, 1:25 pm, John Nagle <[EMAIL PROTECTED]> wrote: > Marc 'BlackJack' Rintsch wrote: > > I don't see how this type inference for static types will work unless some > > of the dynamism of the language will get restricted. But is this really > > necessary? Isn't a JIT compiler and maybe type

New EasyExtend release is out

2007-05-03 Thread Kay Schluehr
Hi folks, EasyExtend is a grammar based preprocessor generator and metaprogramming system for Python written in Python. After reworking an initial release for 11 months (!) it's time to present now EasyExtend 2.0-alpha1. You find EasyExtend on the projects homepage: http://www.fiber-space.de/Eas

Re: My python annoyances so far

2007-04-26 Thread Kay Schluehr
On Apr 26, 6:07 pm, [EMAIL PROTECTED] wrote: > Well, why do some things in the library have to be functions, and > other things have to be class methods? > > Why aren't they all just either functions or class methods? like > perhaps ruby. A good question. Part of the answer might be that their ar

Re: My python annoyances so far

2007-04-26 Thread Kay Schluehr
On Apr 26, 6:07 pm, [EMAIL PROTECTED] wrote: > Well, why do some things in the library have to be functions, and > other things have to be class methods? > > Why aren't they all just either functions or class methods? like > perhaps ruby. A good question. Part of the answer might be that their ar

Re: Coding conventions for class names

2007-04-26 Thread Kay Schluehr
On 25 Apr., 12:32, Michael Hoffman <[EMAIL PROTECTED]> wrote: > Kay Schluehr wrote: > > My question is: does anyone actually follow guidelines here > > Yes. > > > and if yes > > which ones and are they resonable ( e.g. stable with regard to > > refactor

Coding conventions for class names

2007-04-25 Thread Kay Schluehr
set, int, float, list, object,... Don't see any of the basic types following the capitalized word convention for classes covered by PEP 08. This does not hold only for __builtins__ in the strict sense but also for types defined in builtin modules like datetime. My question is: does anyone actuall

Re: Can __init__ not return an object?

2007-04-23 Thread Kay Schluehr
On Apr 22, 4:36 am, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > When I go to create an object I want to be able to decide whether the > object is valid or not in __init__, and if not, I want the constructor to > return something other than an object, (like maybe None). I seem to be > having proble

Re: is laziness a programer's virtue?

2007-04-15 Thread Kay Schluehr
On Apr 15, 6:25 pm, "Xah Lee" <[EMAIL PROTECTED]> wrote: > Laziness, Perl, and Larry Wall > > Xah Lee, 20021124 > > In the unix community there's quite a large confusion and wishful > thinking about the word laziness. In this post, i'd like to make some > clarifications. > > American Heritage Dicti

Re: proposed PEP: iterator splicing

2007-04-15 Thread Kay Schluehr
On Apr 15, 10:23 am, Anton Vredegoor <[EMAIL PROTECTED]> wrote: > I'm currently also fascinated by the new generator possibilities, for > example sending back a value to the generator by making yield return a > value. What I would like to use it for is when I have a very long > generator and I nee

Re: Custom Python Runtime

2007-04-07 Thread Kay Schluehr
On Apr 7, 1:52 am, "Jack" <[EMAIL PROTECTED]> wrote: > Since the full installation of Python (from either the standard installer or > ActiveState installer) is too big for my intended use, I'd like to build a > custom distribution of Python for Windows platform, omitting some lib files, > such as a

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-04-02 Thread Kay Schluehr
On Apr 2, 1:27 pm, "Paul Boddie" <[EMAIL PROTECTED]> wrote: > On 2 Apr, 13:05, [EMAIL PROTECTED] wrote: > > > > > There is some possibility that Python 3.1 will have what you ask > > for:http://www.python.org/dev/peps/pep-3108/ > > Prior to that PEP being written/published, I made this proposal: >

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-04-02 Thread Kay Schluehr
On Apr 2, 9:17 am, John Nagle <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > but in any case, I believe there are several reasons why type > > inference scalability is actually not _that_ important (as long as it > > works and doesn't take infinite time): > > > -I don't think we want to

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-04-01 Thread Kay Schluehr
On Apr 1, 6:07 pm, John Nagle <[EMAIL PROTECTED]> wrote: > Kay Schluehr wrote: > > Indeed. The only serious problem from an acceptance point of view is > > that Mark tried to solve the more difficult problem first and hung on > > it. Instead of integrating a translator/

Re: Shed Skin Python-to-C++ Compiler 0.0.21, Help needed

2007-03-31 Thread Kay Schluehr
On Mar 31, 11:26 pm, "Luis M. González" <[EMAIL PROTECTED]> wrote: > On Mar 31, 8:38 am, Bjoern Schliessmann > > > [EMAIL PROTECTED]> wrote: > > Mark Dufour wrote: > > > Shed Skin allows for translation of pure (unmodified), implicitly > > > statically typed Python programs into optimized C++, and

Re: PyPy 1.0: JIT compilers for free and more

2007-03-28 Thread Kay Schluehr
On Mar 28, 4:34 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > "Kay Schluehr" <[EMAIL PROTECTED]> writes: > > A somewhat unrelated question. With Py3K Python gets optional type > > annotations. Are you already architecting an annotation handler that &g

Re: PyPy 1.0: JIT compilers for free and more

2007-03-28 Thread Kay Schluehr
On Mar 28, 2:54 pm, "Paul Boddie" <[EMAIL PROTECTED]> wrote: > On 28 Mar, 14:12, "Kay Schluehr" <[EMAIL PROTECTED]> wrote: > > > > > A somewhat unrelated question. With Py3K Python gets optional type > > annotations. > > No, I believe

Re: PyPy 1.0: JIT compilers for free and more

2007-03-28 Thread Kay Schluehr
On Mar 27, 11:48 pm, Carl Friedrich Bolz <[EMAIL PROTECTED]> wrote: > == > PyPy 1.0: JIT compilers for free and more > == > > Welcome to the PyPy 1.0 release - a milestone integrating the results > of four years of rese

Re: ANN: java2python 0.2

2007-02-19 Thread Kay Schluehr
On 19 Feb., 15:38, Troy Melhase <[EMAIL PROTECTED]> wrote: > java2python - Java to Python Source Code Translator > --- > java2python 0.2 Released 18 February 2007 > > What is java2python? > -

Re: Does the world need another v0.1 python compiler?

2007-02-07 Thread Kay Schluehr
On 8 Feb., 17:00, John Nagle <[EMAIL PROTECTED]> wrote: > Grant Olson wrote: > > The basic approach I took was compiling to bytecode, and then > > transliterating python bytecode to x86 asm. And it is working a little bit. > > An interesting option might be to generate the byte code used by >

Re: Python does not play well with others

2007-01-24 Thread Kay Schluehr
On 25 Jan., 04:46, "Paul Boddie" <[EMAIL PROTECTED]> wrote: > > That's because, in those worlds, either the > > development team for the language or the development team > > for the subsystem takes responsibility for making them work. > > Only Python doesn't do that.And this is where I'd almost

Re: Overloading assignment operator

2007-01-23 Thread Kay Schluehr
Achim Domma schrieb: > Hi, > > I want to use Python to script some formulas in my application. The user > should be able to write something like > > A = B * C > > where A,B,C are instances of some wrapper classes. Overloading * is no > problem but I cannot overload the assignment of A. I understa

Re: function without brackets ?

2007-01-03 Thread Kay Schluehr
Stef Mientki schrieb: > If I call a parameterless function without brackets at the end, > the function is not performed, but ... > I don't get an error message ??? > > Is this normal behavior ? Yes, this is perfectly o.k. because each function is a first class citizen in Python. The difference

Re: PEP 3107 Function Annotations for review and comment

2007-01-01 Thread Kay Schluehr
Tony Lownds wrote: > On Dec 31, 2006, at 4:26 AM, Kay Schluehr wrote: > > > I have two questions: > > > > 1) I don't understand the clause ('*' [tname] (',' tname ['=' test])* > > in the grammar rule of typedargslist. Does it st

Re: PEP 3107 Function Annotations for review and comment

2006-12-31 Thread Kay Schluehr
I have two questions: 1) I don't understand the clause ('*' [tname] (',' tname ['=' test])* in the grammar rule of typedargslist. Does it stem from another PEP? 2) Is the func_annotation information for def foo(*c: list) stored as {"*c": list} preserving optional argument information or {"c":list

Re: Python-URL! - weekly Python news and links (Dec 18)

2006-12-18 Thread Kay Schluehr
Paul Boddie wrote: > Meanwhile, the EuroPython planners get ahead of themselves, thinking about > conference venues as far in the future as 2010, if not 20010! Python 20010. It was a nice conference although a bit lame on the first day. My favourite talks were: Trevor Stent: "Whitespace

Re: merits of Lisp vs Python

2006-12-16 Thread Kay Schluehr
Ken Tilton schrieb: > Looks promising. How does a generic engine that sees only a solution (a > list of mathematical expressions and for each the transformations, > results, and opnds logged by individual TF functions) build up this > environment such that it has named attributes such as signed-va

Re: Survey environment for Python?

2006-12-14 Thread Kay Schluehr
exhuma.twn schrieb: > Hi, > > Just recently I had to take over support for legacy software written in > Blaise (www.cbs.nl). I don't understand the meaning of the link. Do you mean this language? http://blaise.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Iterating over several lists at once

2006-12-13 Thread Kay Schluehr
Gal Diskin schrieb: > Hi, > I am writing a code that needs to iterate over 3 lists at the same > time, i.e something like this: > > for x1 in l1: > for x2 in l2: > for x3 in l3: > print "do something with", x1, x2, x3 > > What I need to do is go over all n-tuples where the

Re: merits of Lisp vs Python

2006-12-13 Thread Kay Schluehr
Juan R. schrieb: > Kay Schluehr wrote: > > > > You mean a universal language adapter? I guess this is always possible > > using alpha conversion but I don't believe this leads to theoretical or > > practical interesting solutions but is just a limit concep

Re: merits of Lisp vs Python

2006-12-12 Thread Kay Schluehr
I V schrieb: > One of the things I've always found off-putting about lisp as that all the > syntax looks the same. In Algol-derived languages, each syntactic > construct has a fairly distinctive appearance, so when, for instance, I > encounter a for loop, I can quickly recognize that that's what i

Re: merits of Lisp vs Python

2006-12-12 Thread Kay Schluehr
Juan R. schrieb: > > Given two languages L1 = (G1,T1), L2 = (G2, T2 ) where G1, G2 are > > grammars and T1, T2 transformers that transform source written in L1 or > > L2 into some base language > > L0 = (G0, Id ). Can G1 and G2 be combined to create a new grammar G3 > > s.t. the transformers T1 an

Re: merits of Lisp vs Python

2006-12-11 Thread Kay Schluehr
Paul Rubin wrote: > Robert Brown <[EMAIL PROTECTED]> writes: > > Does this make Lisp "less dynamic" than Python? Espen would say it's not > > less dynamic, but rather that a similar level of dynamism is achieved in > > Common Lisp via well defined interfaces. The compiler knows the interfaces, >

Re: merits of Lisp vs Python

2006-12-11 Thread Kay Schluehr
Kaz Kylheku wrote: > Kay Schluehr wrote: > > Juan R. wrote: > > > A bit ambiguous my reading. What is not feasible in general? Achieving > > > compositionality? > > > > Given two languages L1 = (G1,T1), L2 = (G2, T2 ) where G1, G2 are > > grammars

Re: merits of Lisp vs Python

2006-12-11 Thread Kay Schluehr
Juan R. wrote: > Kay Schluehr ha escrito: > > Note also that a homogenous syntax is not that important when > > analyzing parse trees ( on the contrary, the more different structures > > the better ) but when synthesizing new ones by fitting different > >

Re: merits of Lisp vs Python

2006-12-11 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: > I've already admitted that this was both a poor choice of words and, as > pointed out by Carl, an ad hominem argument. However, if you read the > whole thing you'll see that I'm really railing against the silly "It > fits your brain" and "Only one way to do things" marke

Re: merits of Lisp vs Python

2006-12-11 Thread Kay Schluehr
Marc 'BlackJack' Rintsch schrieb: > In <[EMAIL PROTECTED]>, Kay Schluehr > wrote: > > > Once an easy to use metaprogramming system could be done for Python it > > could be ported with some adaptions to other languages with more > > "complicated syn

Re: merits of Lisp vs Python

2006-12-11 Thread Kay Schluehr
[EMAIL PROTECTED] schrieb: > Now, speaking as a scientist, permit me to make a small practical > suggestion: Why not just figure out a way to simplify some brand of > Python -- make parens (or whatever) optionally replace whitespace and > line breaks as syntax -- and then add a simple macro facili

Re: merits of Lisp vs Python

2006-12-10 Thread Kay Schluehr
[EMAIL PROTECTED] schrieb: > I find it amusing that most of the arguments that python-people are > making in this thread are actually the arguments that C++ and Java make > against Python. "Who needs dynamic typing?", "Who needs closures?", > "The idea of using whitespace for syntax is beyond stup

Re: merits of Lisp vs Python

2006-12-08 Thread Kay Schluehr
O.K. I agree with what you said about the generic function vs per object dictionary dispatch. But do the performance differences vanish when only builtin types and functions are used to express Python algorithms? -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-08 Thread Kay Schluehr
Alex Mizrahi schrieb: > it's also > interesting, that python, perl, php and ruby show very similar peformance, > while lisp and scheme implementations show large improvements -- it makes me > think that there's something "pathalogically scripting" in their > specifications (maybe some obligatory u

Re: len() and PEP 3000

2006-12-06 Thread Kay Schluehr
Bjoern Schliessmann schrieb: > Thomas Guettler wrote: > > > I suggest that at least lists, tupples, sets, dictionaries and > > strings get a len() method. > > Why? Pro: Because it makes the API more monotonous and more aligned with all other OO languages that exist now and in future. It also help

Re: Ensure a variable is divisible by 4

2006-12-04 Thread Kay Schluehr
[EMAIL PROTECTED] schrieb: > I am sure this is a basic math issue, but is there a better way to > ensure an int variable is divisible by 4 than by doing the following; > > x = 111 > x = (x /4) * 4 > > Just seems a bit clunky to me. Division with rest: >>> x % 4 3 -- http://mail.python.org/m

Re: Detecting recursion loops

2006-12-02 Thread Kay Schluehr
Instead of threading a counter ( or an accumulator as for tail-recursive functions ) you can monitor the behaviour of the mutual recusive function call using an external stack and wrap the contributing functions using a decorator s.t. pushing and popping to and from the stack are pre- and postproce

Fun with generators

2006-11-16 Thread Kay Schluehr
While this has been possible before and I guess ( from somewhat superficial reading ) Michael Sparks Kamaelia project is all about this kind of stuff, Python 2.5 generators can be used trivially to turn higher order functions like reduce or map into generators producing streams. After reading a thr

Re: reduce to be removed?

2006-11-13 Thread Kay Schluehr
On 12 Nov., 00:14, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > if you care about writing robust code, why not just use a for-loop, > and the list extend method? > > Because generic solutions using HOFs increase abstraction and reduce() the amount of code one has to write even when they are outcas

Re: Reverse function python? How to use?

2006-10-30 Thread Kay Schluehr
frankie_85 wrote: > Ok I'm really lost (I'm new to python) how to use the reverse function. > > > I made a little program which basically the a, b, c, d, e which I have > listed below and basically I want it th result to be printed reverse so > instead doing "print e, d, c, b, a", I'd like to use t

Re: PSF Infrastructure has chosen Roundup as the issue tracker for Python development

2006-10-22 Thread Kay Schluehr
Anna Ravenscroft wrote: > Interestingly enough, the quote of the day from Google on this email was: > > Never doubt that a small group of thoughtful, committed citizens can > change the world; indeed, it's the only thing that ever has. > Margaret Mead Commitment. Some individuals do the actual ch

Re: invert or reverse a string... warning this is a rant

2006-10-20 Thread Kay Schluehr
> The Ruby approach makes sense to me as a human being. http://happyfuncog.blogspot.com/2006/09/confessions-of-pseudo-misanthrope.html > The Python approach is not easy for me (as a human being) to remember. I always thought we Pythonistas are already idiots but whenever I meet a Rubist it ( the

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-16 Thread Kay Schluehr
Bruno Desthuilliers wrote: > Just for the record : Ruby's code-blocks (closures, really) come from > Smalltalk, which is still the OneTrueObjectLanguage(tm). IsTheOneTrueObjectLanguage(tm)ReallyCamelCased? -- http://mail.python.org/mailman/listinfo/python-list

Re: python's OOP question

2006-10-16 Thread Kay Schluehr
neoedmund wrote: > Could you show some code to help me know how composition/delegation can > be done here? Thanks. Starting with your example C2 might just derive from C1 and perform a supercall: class C1(object): def v(self, o): return "expected "+o class C2(C1):

Re: python's OOP question

2006-10-15 Thread Kay Schluehr
neoedmund wrote: > There's a program, it's result is "unexpected aaa", i want it to be > "expected aaa". how to make it work? > > [code] > > class C1(object): > def v(self, o): > return "expected "+o > > class C2(object): > def v(self, o): > return "unexpecte

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-15 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: > Kay Schluehr wrote: > > The with statement is already implemented in Python 2.5. > > > > http://docs.python.org/whatsnew/pep-343.html > > > > The main difference between the with statement and Ruby blocks is that > > the with-state

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-15 Thread Kay Schluehr
Paul Boddie wrote: > Kay Schluehr wrote: > > > > Spreading tiny function definitions all over the code > > may be finally not such a good idea compared with a few generic methods > > that get just called? OO might run out of fashion these days but Python > > is

Re: locals() and globals()

2006-10-14 Thread Kay Schluehr
Paolo Pantaleo wrote: > Hi > > this exaple: > > def lcl(): > n=1 > x=locals() > x["n"]=100 > print "n in lcl() is:" +str(n) > #This will say Name error > #x["new"]=1 > #print new > > > n=1 > x=globals() > x["n"]=100 > print "gobal n is:" +str(n) > x["new"]=1 > print "new

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-14 Thread Kay Schluehr
Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > deferred = fetchPage('http://python.org') > > def _showResponse(response) > > print "fancy formatting: %s" % response.text > > deferred.addCallback(_showResponse) > > > > Lots of Twisted code has to be written backwards like this

Re: Python component model

2006-10-14 Thread Kay Schluehr
val bykoski wrote: > Peter Wang wrote: > > Edward, > > > > This isn't in response to any specific one of the 100+ posts on this > > thread, but I justed wanted to encourage you to continue your > > investigation into Python component models and maybe looking for some > > common ground between them.

Re: A friendlier, sugarier lambda -- a proposal for Ruby-like blocks in python

2006-10-13 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: > But [embedding a definition, ks] is awkward since the lambda is constrained > to be one > line; you > can't come back later and add much to the callback's code. > Furthermore, this example isn't even legal, because 'print' isn't a > function, but a statement -- lambda i

Re: Python component model

2006-10-12 Thread Kay Schluehr
Peter Maas wrote: > Paul Boddie wrote: > > People who bring up stuff about self and indentation are just showing > > their ignorance, in my opinion, since Python isn't the first language > > to use self in such a way, and many C++ and Java programs use this > > pervasively in order to make attribu

Re: Python component model

2006-10-11 Thread Kay Schluehr
Paul Boddie wrote: > I've never maintained that a monopoly on how Web programming is done > would be a good thing. All I've ever tried to understand is why people > haven't tried to improve the generic support for Web programming (and a > whole load of other things) even to the level of something

Re: Python component model

2006-10-10 Thread Kay Schluehr
Hendrik van Rooyen wrote: > "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > > Nick Vatamaniuc wrote: > > > > > At the same time one could claim that Python already has certain > > > policies that makes it seem as if it has a component model. > 8<---

Re: Python component model

2006-10-10 Thread Kay Schluehr
fumanchu wrote: > > 4) Custom property and component editors: A component editor can present > > a property editor or an editor for an entire component which the visual > > design-time RAD environment can use to allow the programmer end-user of > > the component to set or get component property va

Re: Pythonic API design: detailed errors when you usually don't care

2006-10-02 Thread Kay Schluehr
Simon Willison wrote: > Hi all, > > I have an API design question. I'm writing a function that can either > succeed or fail. Most of the time the code calling the function won't > care about the reason for the failure, but very occasionally it will. > > I can see a number of ways of doing this, bu

Re: builtin regular expressions?

2006-10-01 Thread Kay Schluehr
Antoine De Groote wrote: > Hello, > > Can anybody tell me the reason(s) why regular expressions are not built > into Python like it is the case with Ruby and I believe Perl? Like for > example in the following Ruby code > > line = 'some string' > > case line >when /title=(.*)/ > puts "Titl

Re: Escapeism

2006-10-01 Thread Kay Schluehr
Frederic Rentsch wrote: > Kay Schluehr wrote: > > Sybren Stuvel wrote: > > > >> Kay Schluehr enlightened us with: > >> > >>> Usually I struggle a short while with \ and either succeed or give up. > >>> Today I'm in a different mood an

Re: Escapeism

2006-09-30 Thread Kay Schluehr
Steve Holden wrote: > Kay Schluehr wrote: > > Sybren Stuvel wrote: > > > >>Kay Schluehr enlightened us with: > >> > >>>Usually I struggle a short while with \ and either succeed or give up. > >>>Today I'm in a different mood and don&

Re: Escapeism

2006-09-30 Thread Kay Schluehr
Sybren Stuvel wrote: > Kay Schluehr enlightened us with: > > Usually I struggle a short while with \ and either succeed or give up. > > Today I'm in a different mood and don't give up. So here is my > > question: > > > > You have an unknown charac

Escapeism

2006-09-30 Thread Kay Schluehr
Usually I struggle a short while with \ and either succeed or give up. Today I'm in a different mood and don't give up. So here is my question: You have an unknown character string c such as '\n' , '\a' , '\7' etc. How do you echo them using print? print_str( c ) prints representation '\a' to st

Re: a different question: can you earn a living with *just* python?

2006-09-27 Thread Kay Schluehr
Antoine De Groote wrote: > John Salerno wrote: > > It's a nice thought that a person can earn a living programming with > > Python, which is fun enough to use just for its own sake. But for > > someone like me (i.e. no programming experience) it's always a little > > disheartening to see that most

Re: Talking to marketing people about Python

2006-09-25 Thread Kay Schluehr
Roy Smith wrote: > I'm working on a product which for a long time has had a Perl binding for > our remote access API. A while ago, I wrote a Python binding on my own, > chatted it up a bit internally, and recently had a (large) customer enquire > about getting access to it. > > I asked for permis

Re: +1 QOTW

2006-09-24 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: > Did anyone else crack up when Larry Wall described python with the > statement: > > Python, as the "anti-Perl," is heavily invested in maintaining Order. > > In the state of the onion address? > > http://www.perl.com/pub/a/2006/09/21/onion.html Think he's just too charmi

Re: Python and checked exceptions

2006-09-23 Thread Kay Schluehr
Peter Otten wrote: > Kay Schluehr wrote: > > > A new cookbook recipe suggesting two decorators @throws and @catches > > for treatment of checked exceptions in Python: > > > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498131 > > > > This m

Python and checked exceptions

2006-09-23 Thread Kay Schluehr
A new cookbook recipe suggesting two decorators @throws and @catches for treatment of checked exceptions in Python: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498131 This might be of practical interest for some and theoretical interest for others - in particular those who know checke

Re: Pythondocs.info : collaborative Python documentation project

2006-09-17 Thread Kay Schluehr
Brad Allen wrote: > A.M. Kuchling wrote: > > However, this code isn't used at the moment because I have no idea > > what to do about version controlling the links. Do we just use the > > current links whenever the HTML is generated? Make a copy of the list > > and commit them into SVN, so the li

Re: Pythondocs.info : collaborative Python documentation project

2006-09-17 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: > Hi, > > I am a bit disapointed with the current Python online documentation. I > have read many messages of people complaining about the documentation, > it's lack of examples and the use of complicated sentences that you > need to read 10 times before understanding what

Re: REQ: Java/J2EE Developer 10 Months

2006-09-15 Thread Kay Schluehr
Steve Holden wrote: > [EMAIL PROTECTED] wrote: > [...] > > Skill: > > > > > > *Java, 2 year UNIX - HP / Solaris, 2 yrs OOA+D, Corba, Perl, XML, UML. > > *Java dev experience, Swing, JPS, 2 years of OOA+D. > > Clearly not spam, since the guy is so in touch with the readership of > this gro

Re: Are Python's reserved words reserved in places they dont need to be?

2006-09-14 Thread Kay Schluehr
Carl Banks wrote: > metaperl wrote: > > --> python -i > > >>> class = "algebra" > > File "", line 1 > > class = "algebra" > > ^ > > SyntaxError: invalid syntax > > >>> > > > > > > Why isn' t the parser smart enough to see that class followed by an > > identifier is used for class

Re: best small database?

2006-09-13 Thread Kay Schluehr
Pierre Quentel wrote: > Buzhug (like Karrigell and Strakell) is a Breton word ; Breton is the > language spoken in Brittany, the westernmost part of France. Less and > less spoken, actually, but I do, like all my ancestors. It is a close > cousin of Welsh, and has common roots with Irish and Gaeli

Re: best small database?

2006-09-12 Thread Kay Schluehr
Pierre Quentel wrote: > - SnakeSQL : another SQL engine, less mature I think and very slow when > I tested it And strange bugs when I used it. > - buzhug : Pythonic syntax (uses list comprehensions or methods like > create(), select() on the db object), much faster than all the above. > I'm obvi

<    1   2   3   4   5   6   7   8   >