Re: Python vs. Lisp -- please explain

2006-02-22 Thread Kay Schluehr
Paul Rubin wrote: > "Kay Schluehr" <[EMAIL PROTECTED]> writes: > > I talked to Richard Emslie recently and he told me that the PyPy team > > works on a mechanism to create CPython-extension modules written in > > RPython i.e. a statically translateable

Re: Python vs. Lisp -- please explain

2006-02-22 Thread Kay Schluehr
Paul Boddie wrote: > Kay Schluehr wrote: > > Paul Rubin wrote: > > > "Kay Schluehr" <[EMAIL PROTECTED]> writes: > > > > I talked to Richard Emslie recently and he told me that the PyPy team > > > > works on a mechanism to create C

Re: Python vs. Lisp -- please explain

2006-02-24 Thread Kay Schluehr
Torsten Bronger wrote: > Hallöchen! > > "Paul Boddie" <[EMAIL PROTECTED]> writes: > > > Kay Schluehr wrote: > > > >> I would say yes, it is still "proper Python" in that each RPython > >> program is also a CPython program. &g

Re: Unintended inheritance

2006-02-24 Thread Kay Schluehr
Alex Martelli wrote: > Kay Schluehr <[EMAIL PROTECTED]> wrote: >... > > To prevent unintended inheritance C# introduced a relatively complex > > contract semantics using three modifiers virtual, override and new. Is > > this issue serious for Python progra

Re: A C-like if statement

2006-02-24 Thread Kay Schluehr
you, often miss the > compactness of the C idiom, but there it is. Hmm. A statement has side-effects but it returns no value. And yes, you can create a name within an expression producing a value in Python, using a list/generator comprehension. The solution to Bob's problem would look like this: if (I for I in (a.find("3"),) ) != -1: print "It's here: ", I else: print "No 3's here" Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: A C-like if statement

2006-02-24 Thread Kay Schluehr
Paul Rubin wrote: > "Kay Schluehr" <[EMAIL PROTECTED]> writes: > > Hmm. A statement has side-effects but it returns no value. And yes, you > > can create a name within an expression producing a value in Python, > > using a list/generator comprehension. The sol

Re: Is Python a Zen language?

2006-02-25 Thread Kay Schluehr
ssive move towards the true reality, a stoic hedonism of contemplation and the taoistic being-in-doing. Zen on the other side is more radical: if you erase yourself there is no-one "who" is in the flow but chances are that you and the computer over there are the same thing. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python a Zen language?

2006-02-26 Thread Kay Schluehr
owledge about taoism listening to Yoda or watching "Kung Fu". Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Tail Call Optimization as a Decorator

2006-02-26 Thread Kay Schluehr
t = 0, next = 1): > if i == 0: > return current > else: > return fib(i - 1, next, current + next) > > print fib(1) > # also prints a big number, > # but doesn't hit the recursion limit. Hey Crutcher, what a beautifull and elegant hack! Have you already contributed it to the Python cookbook? Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Tail Call Optimization as a Decorator

2006-02-26 Thread Kay Schluehr
Crutcher wrote: > I've tossed it to python-dev, but how do I submit it to the cookbook? http://aspn.activestate.com/ASPN/Python/Cookbook/ I think it is a good place to stay accessible even if python-dev overlooks it. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 354: Enumerations in Python

2006-02-26 Thread Kay Schluehr
mplicates design, but usage is quite simple and flexible. The classics is already referenced by the Python docs: http://www.python.org/doc/essays/metaclasses/Enum.py I'm -0 on the PEP. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: pynetwork 2.25

2005-04-30 Thread Kay Schluehr
> I know about 5-6 other graph libraries for Python, one even in C++ > (Boost). What is wrong with the other librarys that they can't be approved? Kay -- http://mail.python.org/mailman/listinfo/python-list

Hard times with packages and instances

2005-05-05 Thread Kay Schluehr
in module C.py and calls A.py one gets: Traceback (most recent call last): ... TypeError: Instance of unknown class '' found The class which was expected by the checkInstance() function is I'm curios if someone could explain me the difference between this two class objects? Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Hard times with packages and instances

2005-05-05 Thread Kay Schluehr
Fredrik Lundh wrote: > Kay Schluehr wrote: > > > I wonder why the isinstance() function is sensitive about the import > > path i.e. the result depends not only on the class and the instance but > > also on how a class is imported? > > isinstance uses class object

Re: Hard times with packages and instances

2005-05-06 Thread Kay Schluehr
Fredrik Lundh wrote: > Kay Schluehr wrote: > > > > if you manage to import the same thing multiple times, you'll have > > > multiple class objects representing the same source code, and is- > > > instance won't work properly. > > > > Imp

Re: pyvm -- faster python

2005-05-08 Thread Kay Schluehr
e/ This is sad because it is still challenging to offer a tiny interpreter of a dynamic language for glue code/RAD on tiny hardware. A lot of effort was spent to provide Java for microcontrollers especially for SmartCards. I think a lot of people would show interest in Your project if it gets somehow focussed and does not seem to be redundant. Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: __brace__ (PEP?)

2005-05-08 Thread Kay Schluehr
; and so on down the list of non-alphanumeric characters, but the result > wouldn't be anything most of us would recognize as Python. After many sleepless nights reading all the comments and flames about @decorators I finally came up using them. Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: __brace__ (PEP?)

2005-05-09 Thread Kay Schluehr
Roy Smith wrote: > "Kay Schluehr" <[EMAIL PROTECTED]> wrote: > > > Roy Smith wrote: > > > > > foo->bar ==> foo.__arrrow__(bar) > > > foo$bar ==> foo.__dollar__(bar) > > > foo#bar ==> foo.__hash__(bar) > > > foo::bar

Re: pyvm -- faster python

2005-05-10 Thread Kay Schluehr
o controls the language. Sooner or later Python will go the LISP way of having a standardized "Common-Python" ( std_objectspace) and a number of dialects and DSLs running in their own derived object spaces. Maybe Python 3000 is an illusion and will fade away like a Fata Morgana the closer we seem come. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: pyvm -- faster python

2005-05-11 Thread Kay Schluehr
Paul Rubin wrote: > "Kay Schluehr" <[EMAIL PROTECTED]> writes: > > Delete the "standard" and You still obtain huge librarys for .Net, Java > > and Python. I also regret that Prothon starved in infancy but it might > > be exeggerated to demand that ea

Re: pyvm -- faster python

2005-05-12 Thread Kay Schluehr
Stelios Xanthakis wrote: > Kay Schluehr wrote: > > > > > Yes. What we are seeking for and this may be the meaning of Armins > > intentiously provocative statement about the speed of running HLLs is a > > successor of the C-language and not just another VM interprete

Sober-Q

2005-05-15 Thread Kay Schluehr
ber variant, which sends Nazi propaganda around. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: python-dev Summary for 2005-04-16 through 2005-04-30

2005-05-16 Thread Kay Schluehr
y, and the PEP 340 talk shows no sign of abating; Thanks Tony, but PEP 340 is already withdrawn by the BDFL. [1] There won't be any Ruby-like blocks because they hide control flow. Regards, Kay [1] http://www.python.org/peps/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python suitable for a huge, enterprise size app?

2005-05-18 Thread Kay Schluehr
I-builders and UML-designers which are comparable to those for Java or dotNET. You won't come as close to a group consensus as if You would stick to VisualStudio7 for C#, or IDEA/Eclipse for Java. Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: EpyDoc problem

2005-05-18 Thread Kay Schluehr
p;group_id=32455&func=browse Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python suitable for a huge, enterprise size app?

2005-05-18 Thread Kay Schluehr
m that motion is impossible? I always thought that we Germans were hopeless pessimists ;) It's a very funny logical loop inside this kind of arguments: don't use great Python for grand multimillion $ projects because if You fail everyone trashes cute Python and claims that it is not reliab

Re: Is Python suitable for a huge, enterprise size app?

2005-05-19 Thread Kay Schluehr
still internal from the fans of the language to other fans. Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: first release of PyPy

2005-05-20 Thread Kay Schluehr
opment process as we know it comes to an end and makes a kind of transition. This is both very exciting and dangerous, like every philosophical event. Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: first release of PyPy

2005-05-20 Thread Kay Schluehr
Christian Tismer wrote: > [EMAIL PROTECTED] wrote: > > > Kay Schluehr wrote: > > > >>holger krekel wrote: > >> > >>>Welcome to PyPy 0.6 > >>> > >>> > >>>*The PyPy Development Team is happy

Re: first release of PyPy

2005-05-21 Thread Kay Schluehr
will ever be a remaining gap due to the dynanism of the language. I think a lot of research understanding this distinction will follow in the next years. As a conclusion: with PyPy Python will still be interpreted, but a large corpus of Python code may be compiled into native code of the underlying machine. Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: first release of PyPy

2005-05-21 Thread Kay Schluehr
/www.khandro.net/mysterious_naga.htm#many-headed Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: None module reference

2005-05-21 Thread Kay Schluehr
following example code. You may also have a look at the /lib/atexit.py module see how it works. import atexit import sys def foo(): print sys atexit.register(foo) Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: first release of PyPy

2005-05-23 Thread Kay Schluehr
s translated into code with nice interfacing properties. Or do You think that RPython translations will be sufficient and another ext-objectspace is just useless epi-cycling? Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: What are OOP's Jargons and Complexities?

2005-05-23 Thread Kay Schluehr
or better than they will going to lead the dicourse and OO will fall apart. I'm just sceptical that this is going to happen. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: open file in dir independently of operating system

2005-05-25 Thread Kay Schluehr
t; > What is the os-independent version of this line? Did You check this out on Windows? My experience with *nix paths is that they work. >>> open("C:/bla.txt") Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: first release of PyPy

2005-05-28 Thread Kay Schluehr
it onself to only > those relatively inefficent standard code sequences that are inside > system dll's. Are You shure that this problem is effectively solvable in any language? Since You did not precise Your idea I'm not shure whether You want to solve the halting-problem

What's wrong with Zope 3 ?

2005-05-31 Thread Kay Schluehr
The last downloadable release is from november 2004. The Windows installer is configured for Python 2.3(!). The Zope.org main page announces Zope 2.8 beta 2. Is it stillborn? Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: What's wrong with Zope 3 ?

2005-06-01 Thread Kay Schluehr
Wolfram Kraus wrote: > Kay Schluehr wrote: > > The last downloadable release is from november 2004. The Windows > > installer is configured for Python 2.3(!). The Zope.org main page > > announces Zope 2.8 beta 2. Is it stillborn? > > > > Kay > > > What

Re: metaclass that inherits a class of that metaclass?

2005-06-01 Thread Kay Schluehr
Those must be mapped as well to counterparts of the other type-system. In contemporary CS slang this is called a 'Functor of Categories' with objects that are types ( and boolean values like True, False ) and arrows that are type aware functions like those listed above. Kay -- http:/

Re: Q: functional/equational language, smells a little of Python

2005-06-05 Thread Kay Schluehr
ted on top of dynamic OO languages like Python with some effort too. My expectation of future Computer Algebra Systems ( CAS ) is that they provide models of mathematical objects like algebras, sets, spaces, manifolds, number-fields etc. that can be refined using inheritance and can be adapted dynamically. Despite the majority of people working in CA I think that OO is much more the way contemporary mathematicians think about their stuff than the FP toolbox approach. What I'm missing is a kind of domain specific syntax, e.g. a syntax for working with states in quantum mechanics. But that's out of the scope of current Python. Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: any macro-like construct/technique/trick?

2005-06-05 Thread Kay Schluehr
, algo): self.algo = algo def call_if_debug(self): if self.debug: return self.algo def foo2(): # do some stuff Emit_dbg_obj(DbgObjFoo(a,b,c)).call_if_debug() # .... do more stuff Emit_dbg_obj(DbgObjFoo(c,d)).call_if_debug() Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: any macro-like construct/technique/trick?

2005-06-05 Thread Kay Schluehr
Kay Schluehr wrote: > Mac wrote: > > Is there a way to mimic the behaviour of C/C++'s preprocessor for > > macros? The problem: a lot of code like this: > > > > def foo(): > > # do some stuff > > if debug: > > emit_dbg_obj(

Re: Q: functional/equational language, smells a little of Python

2005-06-05 Thread Kay Schluehr
John J. Lee wrote: > "Kay Schluehr" <[EMAIL PROTECTED]> writes: > [...] > > I'm curious why do you think that it "smells like Python"? Because of > > "batteries included"? > > Partly that and the mention of dynamic typing, plus

Re: computer algebra packages

2005-06-07 Thread Kay Schluehr
There are also a couple of free CAS like Octave or Yacas, that do their job. Why do people ask periodically for a CAS in Python in this place? I'm just curious about it. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Annoying behaviour of the != operator

2005-06-08 Thread Kay Schluehr
__ne__ and that it should be related locally to the class that overloads __eq__ and not to some global interpreter defined behaviour. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Abstract and concrete syntax

2005-06-10 Thread Kay Schluehr
3 You can also do this lambda x: {True:2,False:3}.get(bool(a)) which is both beautiful and pythonic. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic questions about packages/modules.

2005-06-10 Thread Kay Schluehr
in the PYTHONPATH. But note that you have to be consistent with your import statements because the module will be cached in sys. modules using it's import path as key. Doing both from mainpackage.config import parameters and from config import parameters in different modules leads

Re: Dealing with marketing types...

2005-06-10 Thread Kay Schluehr
ap' in the Zope 3 wiki you may have the impression the project is completely dead ). > What experiences have those in the Python community had in these kinds > of situations? Python projects are submarines. You have to care not to go up to soon. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Abstract and concrete syntax

2005-06-10 Thread Kay Schluehr
issue George worried about ( you are both right except for the little example above :) Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Dealing with marketing types...

2005-06-10 Thread Kay Schluehr
lot to exploit in this direction: the "agile" company/department relies on lightweight methodologies, technologies, languages, thinking, eating, drinking and pissing. O.K. if the boss is nervous, carefull and weak and goes directed by it's servants one may be off-chance. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Dealing with marketing types...

2005-06-12 Thread Kay Schluehr
DevCenter/PythonEggs Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Dealing with marketing types...

2005-06-16 Thread Kay Schluehr
programmers. I concede that this is hard to measure but for a similar issue one should remember that the OPs project did not incorporate the role of a "software architect" up to now - it did not have to be reified. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Back to the future - python to C++ advice wanted

2005-06-18 Thread Kay Schluehr
t uses templates extensively. Template metaprogramming as a compile time language was a funny discovery. Here is some prove of it's capabilities: http://osl.iu.edu/~tveldhui/papers/2003/turing.pdf Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: subexpressions

2007-06-01 Thread Kay Schluehr
evaluated once? lambda x: (lambda y=x*x: math.sin(y)+math.cos(y))() Kay -- http://mail.python.org/mailman/listinfo/python-list

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: 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: 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: 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., 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: 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: 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: 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: PEP 3107 and stronger typing (note: probably a newbie question)

2007-06-23 Thread Kay Schluehr
ot an argument neither are vague apprehensions that Python will be locked into a poor type system with rigid default semantics. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: is this a valid import sequence ?

2007-06-24 Thread Kay Schluehr
n two declarations for accessing a name for assignment from an outer scope. Maybe the Python Zen should be altered in the following way: - Namespaces are one honking great idea -- let's do more of those! + Accessor declaratives are one honking great idea -- let's do more of those! Kay -- http://mail.python.org/mailman/listinfo/python-list

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: The best platform and editor for Python

2007-07-05 Thread Kay Schluehr
S projects have the healthy tendency to die silently. No one has yet counted all the corpses. Someone has mentioned Eclipse before and it somehow indicates that the strongest distinction between an OSS project and a commercial one is the property of being OSS. Kay > Cheers, > Nicola Musat

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, 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: The best platform and editor for Python

2007-07-05 Thread Kay Schluehr
On Jul 6, 12:13 am, Alex Popescu <[EMAIL PROTECTED]> wrote: > On Jul 5, 5:46 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > Kay Schluehr wrote: > > > On Jul 3, 8:12 pm, [EMAIL PROTECTED] (Cameron Laird) wrote: > > > > &g

PyCF_DONT_IMPLY_DEDENT

2007-07-12 Thread Kay Schluehr
I found this flag in codeop.py PyCF_DONT_IMPLY_DEDENT = 0x200 # Matches pythonrun.h It is apperantly a parser flag used in the PARSER_FLAGS define in pythonrun.c. Questions: what does it actually mean and why is this implementation detail exposed to Python code. I tried to change the va

Re: Python-URL! - weekly Python news and links (Jul 16)

2007-07-16 Thread Kay Schluehr
ioned in weekly Python news but Europython 2007 actually happened and took place in Vilnius. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: In a dynamic language, why % operator asks user for type info?

2007-07-16 Thread Kay Schluehr
On Jul 17, 3:10 am, Karthik Gurusamy <[EMAIL PROTECTED]> wrote: > output = '%d foo %d bar" % (foo_count, bar_count), > why we need to use %d? I'm thinking some general common placeholder, > say %x (currently it's hex..) could be used. You already answered it in the parenthesized remark: the %d pl

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

2007-07-20 Thread Kay Schluehr
On Jul 20, 6:45 am, John Nagle <[EMAIL PROTECTED]> wrote: > Juergen Erhard wrote: > > On proving programs correct... from my CS study days I distinctly > > remember thinking "sure, you can prove it correct, but you cannot do > > actual useful stuff with it". We might have come a long way since > >

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

2007-07-21 Thread Kay Schluehr
On Jul 20, 6:28 pm, Paul Rubin wrote: > As the Intel FDIV bug > incident reminds us, even billions of test inputs are not enough to > show that the routine does the right thing for EVERY input. When I remember correctly the FDIV bug was due to a wrongly filled lookup ta

Re: Can __init__ not return an object?

2007-04-23 Thread Kay Schluehr
manipulating the class creation mechanism. class A(object): def __new__(cls, x): if x == 0: return None obj = object.__new__(cls) obj.__init__(x) return obj class B(A): def __init__(self, x): self.x = x The condition can always be checke

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: 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

Re: My python annoyances so far

2007-04-26 Thread Kay Schluehr
e operators to method calls. You already mentioned special methods for arithmetic operations. I sometimes like to think that Python is a language developed around protocols, and they have a strong backing in the language. With Py3K Python will become a bit more Java like, at least with regard to

Re: My python annoyances so far

2007-04-26 Thread Kay Schluehr
e operators to method calls. You already mentioned special methods for arithmetic operations. I sometimes like to think that Python is a language developed around protocols, and they have a strong backing in the language. With Py3K Python will become a bit more Java like, at least with regard to

New EasyExtend release is out

2007-05-03 Thread Kay Schluehr
ce.de/EasyExtend/doc/EE.html The EasyExtend package is also uploaded to the cheeseshop: http://www.python.org/pypi/EasyExtend/2.0-alpha1 To make yourself familiar with EE there is now also an introductory level tutorial: http://www.fiber-space.de/EasyExtend/doc/tutorial/EETutorial.html Have fun

Re: Towards faster Python implementations - theory

2007-05-08 Thread Kay Schluehr
unwrapping. Unfortunately ShedSkin lacks CPython integration. We talked about this here recently. Kay -- http://mail.python.org/mailman/listinfo/python-list

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: Erlang style processes for Python

2007-05-10 Thread Kay Schluehr
the > interpreter, though I'd be interested in hearing ideas in this direction > (especially with PyPy as such a tantalizing platform!). > -- > Jacob Lee <[EMAIL PROTECTED]> I guess you mean tantalizing in both of its meanings ;) Good luck and inform us when you find interesting results. Kay -- http://mail.python.org/mailman/listinfo/python-list

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

ANN: EasyExtend 2.0 - beta1

2007-05-20 Thread Kay Schluehr
://www.python.org/pypi/EasyExtend/2.0-beta1 To make yourself familiar with EE an introductory level tutorial is also present: http://www.fiber-space.de/EasyExtend/doc/tutorial/EETutorial.html Kay -- http://mail.python.org/mailman/listinfo/python-list

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

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: 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: Fwd: I am giving up perl because of assholes on clpm -- switching to Python

2007-07-26 Thread Kay Schluehr
On Jul 26, 8:18 pm, jed drury <[EMAIL PROTECTED]> wrote: > Hey, Perl's new motto is "There is more than 1 way to > be an ASSHOLE!" Do you think the unique asshole constraint feels more natural? I tend to agree. -- http://mail.python.org/mailman/listinfo/python-list

Re: From D

2007-07-26 Thread Kay Schluehr
On Jul 25, 7:22 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Jul 24, 6:08 pm, Steven D'Aprano > > > > <[EMAIL PROTECTED]> wrote: > > On Tue, 24 Jul 2007 20:09:00 +0200, Bjoern Schliessmann wrote: > > > Stargaming wrote: > > >> On Tue, 24 Jul 2007 03:19:53 -0700, bearophileHUGS wrote: > >

Re: Destruction of generator objects

2007-08-11 Thread Kay Schluehr
On Aug 9, 1:14 am, Stefan Bellon <[EMAIL PROTECTED]> wrote: > On Wed, 08 Aug, MRAB wrote: > > Simple! :-) > > Sorry, I forgot to mention that I am forced to using Python 2.4. > > -- > Stefan Bellon It doesn't matter. You can use try...finally as well in Python 2.4. It's just not possible to use ex

Re: Destruction of generator objects

2007-08-11 Thread Kay Schluehr
On Aug 11, 12:16 pm, Stefan Bellon <[EMAIL PROTECTED]> wrote: > On Sat, 11 Aug, Kay Schluehr wrote: > > On Aug 9, 1:14 am, Stefan Bellon <[EMAIL PROTECTED]> wrote: > > > Sorry, I forgot to mention that I am forced to using Python 2.4. > > It doesn't mat

Re: The Future of Python Threading

2007-08-11 Thread Kay Schluehr
Have you checked out the processing [1] package? I've currently the impression that people want to change the whole language before they checkout a new package. It would be nice to read a review. [1] http://cheeseshop.python.org/pypi/processing -- http://mail.python.org/mailman/listinfo/python-l

Re: Destruction of generator objects

2007-08-11 Thread Kay Schluehr
On Aug 11, 2:00 pm, Stefan Bellon <[EMAIL PROTECTED]> wrote: > On Sat, 11 Aug, Kay Schluehr wrote: > > Honestly, I'd recommend wrapping the generator into a function object, > > create the resource on construction ( or pass it ) and destroy it > > implementing _

Re: Destruction of generator objects

2007-08-11 Thread Kay Schluehr
On Aug 11, 2:50 pm, Stefan Bellon <[EMAIL PROTECTED]> wrote: > So why is the destructor not called when the generator is even > explicitly 'del'ed? Does somebody else still hold a reference on it? You ( we ) have produced a reference cycle. In that case __del__ doesn't work properly ( according t

Re: is there anybody using __del__ correctly??

2007-08-12 Thread Kay Schluehr
On Aug 10, 9:36 am, Michele Simionato <[EMAIL PROTECTED]> wrote: > P.S. BTW, I should mention that if you search comp.lang.python for > __del__ > you will find hundreds of people who were bitten by __del__, so I > usually give > advices such as "you should never __del__ in your code". If I am wron

Re: decorators - more than just syntactic sugar

2007-08-12 Thread Kay Schluehr
On Aug 11, 8:30 pm, Helmut Jarausch <[EMAIL PROTECTED]> wrote: > How can I find out the predefined decorators? I dare to say that's not easy. Since decorators are just(?) syntactical sugar they don't obtain a particular semantics expressed by distinctive declarative elements. Unlike generators wh

Re: Python's Suitability?

2007-08-27 Thread Kay Schluehr
On 28 Aug., 02:28, [EMAIL PROTECTED] (Michael R. Copeland) wrote: >Note that I'm not considering using the existing C/C++ code in my Web > application, because I don't know how to write a C/C++ Windows > application - and I'm sure the learning curve here is greater than > Python's. I'm a very

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-05 Thread Kay Schluehr
On Sep 5, 9:59 pm, Ferenczi Viktor <[EMAIL PROTECTED]> wrote: > Class decorators allows clean implementation of properties. > Detailed description:http://www.python.org/dev/peps/pep-3129/ > Lets use a hypothetic library providing properties, for example: > > from property_support import hasPropert

Re: Any syntactic cleanup likely for Py3? And what about doc standards?

2007-09-06 Thread Kay Schluehr
On Sep 6, 12:56 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > I think there's been a widespread "kitchen sink" mentality around the > Python language for some time, which is where the multimethods > proposal, amongst others, fits in here. Maybe that's one of two fixed points in the evolution of a

<    1   2   3   4   5   6   7   8   >