Re: Some thougts on cartesian products

2006-01-23 Thread Kay Schluehr
Christoph Zwerschke wrote: Now as I'm thinking about it, wouldn't it be nice to have the cartesian products on Python sets? Maybe also a method that returns the power set of a set (the set of all subsets), or the set of all subsets with a given length. For defining powersets it might

Re: Decimal vs float

2006-01-22 Thread Kay Schluehr
Tim Peters wrote: [Kay Schluehr] I concur and I wonder why CAS like e.g. Maple that represent floating point numbers using two integers [1] are neither awkward to use nor inefficient. My guess is that it's because you never timed the difference in Maple -- or, perhaps, that you did

Re: Some thougts on cartesian products

2006-01-22 Thread Kay Schluehr
Giovanni Bajo wrote: Christoph Zwerschke wrote: Sometimes I was missing such a feature. What I expect as the result is the cartesian product of the strings. I've been thinking of it as well. I'd like it for lists too: range(3)**2 [(0,0), (0,1), (0,2), (1,0), (1,1), (1,2), (2,0),

Re: Efficient implementation of deeply nested lists

2006-01-20 Thread Kay Schluehr
Bengt Richter wrote: On 19 Jan 2006 01:19:06 -0800, Kay Schluehr [EMAIL PROTECTED] wrote: I want to manipulate a deeply nested list in a generic way at a determined place. Given a sequence of constant objects a1, a2, ..., aN and a variable x. Now construct a list from them recursively: L

Re: Decimal vs float

2006-01-20 Thread Kay Schluehr
Steven D'Aprano wrote: On Sat, 21 Jan 2006 03:48:26 +, Steve Holden wrote: Steven D'Aprano wrote: On Fri, 20 Jan 2006 04:25:01 +, Bengt Richter wrote: On Thu, 19 Jan 2006 12:16:22 +0100, =?ISO-8859-1?Q?Gerhard_H=E4ring?= [EMAIL PROTECTED] wrote: [...] floating points are

Efficient implementation of deeply nested lists

2006-01-19 Thread Kay Schluehr
I want to manipulate a deeply nested list in a generic way at a determined place. Given a sequence of constant objects a1, a2, ..., aN and a variable x. Now construct a list from them recursively: L = [a1, [a2, [[aN, [x]]...]] The value of x is the only one to be changed. With each value of

Re: Being unjust

2006-01-19 Thread Kay Schluehr
Paul Boddie wrote: Adrian Holovaty wrote: Fuzzyman wrote: web.py has the great advantage that (allegedly) you can migrate apps from CGI to FastCGI, mod_python, WSGI. This isn't an advantage of web.py over other frameworks. You can do the same thing with Django, because it has a

Decimal vs float

2006-01-19 Thread Kay Schluehr
I wonder why this expression works: decimal.Decimal(5.5)**1024 Decimal(1.353299876254915295189966576E+758) but this one causes an error 5.5**1024 Traceback (most recent call last): File interactive input, line 1, in ? OverflowError: (34, 'Result too large') Another quirk is the follwoing:

Re: Decimal vs float

2006-01-19 Thread Kay Schluehr
Steve Holden wrote: If Mr. interpreter is as slick as he is why doesn't he convert the float by himself? This is at most a warning caused by possible rounding errors of float. Indeed, as the documentation says: This serves as an explicit reminder of the details of the conversion

Re: Efficient implementation of deeply nested lists

2006-01-19 Thread Kay Schluehr
Peter Otten wrote: Kay Schluehr wrote: I want to manipulate a deeply nested list in a generic way at a determined place. Given a sequence of constant objects a1, a2, ..., aN and a variable x. Now construct a list from them recursively: L = [a1, [a2, [[aN, [x]]...]] The value

Re: Python on an embedded platform

2006-01-19 Thread Kay Schluehr
Derek wrote: Hi, I am looking to port Python to an embedded platform (an ARM7 device with fairly limited memory, capable of running an RTOS, but not an OS, such as Linux). I came across DePython from a few years ago, but it seems to have died a death. Does anybody have advice? I am looking

Re: Python on an embedded platform

2006-01-19 Thread Kay Schluehr
Grant Edwards wrote: On 2006-01-19, Kay Schluehr [EMAIL PROTECTED] wrote: Does anybody have advice? I am looking for any tricks, features I can disable, etc so I can get the python core to be a small as possible (100k would be good). Have you thought about using a JVM as the Python

Being unjust

2006-01-18 Thread Kay Schluehr
I'd be interested in what people think about bundling one of the diverse Python webframeworks with the Python distribution which will be just there as like Tcl/Tk+Tkinter for GUI-programming. Its not that I don't trust people to make qualified decisions on their own or that I actually believe in

Re: Being unjust

2006-01-18 Thread Kay Schluehr
Adrian Holovaty wrote: Fuzzyman wrote: web.py has the great advantage that (allegedly) you can migrate apps from CGI to FastCGI, mod_python, WSGI. This isn't an advantage of web.py over other frameworks. You can do the same thing with Django, because it has a WSGI backend; people run

Re: Microsoft IronPython?

2006-01-07 Thread Kay Schluehr
Max M wrote: First of they would need to make Python a strategic platform for corporations, so that it was used practically everywhere on Windows. Then it would have the powerbase to change the lanuage and make an incompatible version that they could control. As far as I can see C## has

Re: Microsoft IronPython?

2006-01-04 Thread Kay Schluehr
Luis M. González wrote: Is it good to have Python running on Java and .NET? Sure, why not? At least for Jython we already know from the Jython homepage that it is the great hope of the Java platform to survive in future and far beyond. With a comparable fate dotNET and Microsoft survive till

Re: Spiritual Programming (OT, but Python-inspired)

2006-01-03 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: While preparing a Python411 podcast about classes and OOP, my mind wondered far afield. I found myself constructing an extended metaphor or analogy between the way programs are organized and certain philosophical ideas. So, going where my better angels dare not, here

Re: Global Variables in OOP and Python

2006-01-01 Thread Kay Schluehr
Steven D'Aprano wrote: On Fri, 30 Dec 2005 20:00:51 -0500, Mike Meyer wrote: The other way I thought of is to create a separate class that consists of the variables and to use the from file name import * in all of the files (namespaces) where it is needed. Except for one

Re: How to get started in GUI Programming?

2005-12-28 Thread Kay Schluehr
D H wrote: Kay Schluehr wrote: [EMAIL PROTECTED] wrote: I am trying to learn GUI programming in Python, but have to confess I am finding it difficult. Don't do it if you can prevent it. What kind of helpful advice is that? Conclusion: if you are already familiar with BASIC I

Re: ANNOUNCE; Try python beta

2005-12-20 Thread Kay Schluehr
Mike Meyer wrote: Ok, I've given it the interface I want, and made it less of an attractive nuisance. http://www.mired.org/home/mwm/try_python/ is now ready for people to play with. There's no tutorial information on it yet, that's the next thing to do. However, I won't be able to work on it

Re: What is unique about Python?

2005-12-19 Thread Kay Schluehr
gsteff wrote: So I'm wondering, what is innovative about Python, either in its design or implementation? Or is its magic really just in combining many useful features of prior languages in an unusually pleasant way? Greg The latter.

Re: Haskell Typeclasses

2005-12-15 Thread Kay Schluehr
Alex Martelli wrote: Aahz [EMAIL PROTECTED] wrote: ... Hrm. I don't recall anything about typeclasses, so my suspicion is that you were writing something lengthy and above my head. Can you write something reasonably short about it? (I'm asking partly for your benefit, because if it

Re: Why and how there is only one way to do something?

2005-12-15 Thread Kay Schluehr
Tolga wrote: As far as I know, Perl is known as there are many ways to do something and Python is known as there is only one way. Could you please explain this? How is this possible and is it *really* a good concept? Do you know about the existence of god, just or scientific truth? Of course

Re: Haskell Typeclasses

2005-12-15 Thread Kay Schluehr
Alex Martelli wrote: I don't see why your typeclass illustration does not apply to ABCs as Because in a class, A or B or not, this code WOULD mean mutual recursion (and it can't be checked whether recursion terminates, in general). In a typeclass, it means something very different -- a

Re: definition of 'polymorphism' and python

2005-12-14 Thread Kay Schluehr
Gabriel Zachmann wrote: I understand the Wikipedia article on Polymorphism ( http://en.wikipedia.org/wiki/Polymorphism_%28computer_science%29 ) that it doesn't make sense to talk about polymorphism in a fully dynamically typed language -- does the Python community agree? Maybe you should

Python package installing rationale

2005-12-03 Thread Kay Schluehr
In almost any case I install a Python package via distutils some directories in the package tree are left behind e.g. the docs, licenses, tests etc. I wonder if there is some rationale behind this? Should it be left to the creative freedom of the user to copy the docs whereever she wants or is

Re: python speed

2005-11-30 Thread Kay Schluehr
Harald Armin Massa wrote: Dr. Armin Rigo has some mathematical proof, that High Level Languages like esp. Python are able to be faster than low level code like Fortran, C or assembly. I am not wise enough to understand that proof. Maybe I understood those papers totally wrong and he was

Re: How to get started in GUI Programming?

2005-11-27 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: I am trying to learn GUI programming in Python, but have to confess I am finding it difficult. Don't do it if you can prevent it. GUI - toolkits are very complex beasts and at least to me a source of pain far more as a joy. Python cannot help you making them

Re: Why are there no ordered dictionaries?

2005-11-23 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: Steve Holden wrote: Perhaps now the answer top your question is more obvious: there is by no means universal agreement on what an ordered dictionary should do. Given the ease with which Python allows you to implement your chosen functionality it would be

Re: user-defined operators: a very modest proposal

2005-11-23 Thread Kay Schluehr
Steve R. Hastings wrote: It should be possible to define operators using punctuation, alphanumerics, or both: ]+[ ]add[ ]outer*[ Seems like you look for advanced source-code editors.Some ideas are around for quite a while e.g. here http://en.wikipedia.org/wiki/Intentional_programming I'm

Re: Why are there no ordered dictionaries?

2005-11-22 Thread Kay Schluehr
Christoph Zwerschke wrote: That would be also biased (in favour of Python) by the fact that probably very little people would look for and use the package in the cheese shop if they were looking for ordered dicts. Does anyone actually use this site? While the Vaults offered a nice place and a

Re: Why are there no ordered dictionaries?

2005-11-22 Thread Kay Schluehr
A.M. Kuchling wrote: On 22 Nov 2005 01:41:44 -0800, Kay Schluehr [EMAIL PROTECTED] wrote: Does anyone actually use this site? While the Vaults offered a nice place and a nice interface the Cheese Shop has the appeal of a code slum. Looking at the Cheese Shop's home page at http

Re: Application Plugin Framework

2005-11-22 Thread Kay Schluehr
Ron wrote: Hello, I'm attempting to develop a plugin framework for an application that I'm working on. I wish to develop something in which all plugins exist in a directory tree. The framework need only be given the root of the tree. The framework then uses os.path.walk to search all for

Re: Why are there no ordered dictionaries?

2005-11-22 Thread Kay Schluehr
Bengt Richter wrote: On Mon, 21 Nov 2005 01:27:22 +0100, Christoph Zwerschke [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: if you restructure the list somewhat d = ( ('pid', ('Employee ID', 'int')), ('name', ('Employee name', 'varchar')), ('sal',

Re: Why are there no ordered dictionaries?

2005-11-21 Thread Kay Schluehr
Fredrik Lundh wrote: huh? if you want a list, use a list. d = [('a', {...}), ('b', {})] If one wants uniform access to a nested data structure like this one usually starts writing a wrapper class. I do not think the requirement is anyhow deeper than a standard wrapper around such a

Re: how to present Python's OO feature in design?

2005-11-06 Thread Kay Schluehr
pcmanlin wrote: because i have a problem that python's oo feature is so great, but maybe when the project become larger, python's no-declaration cannot mapping the design to practice? I am not sure about it. As far cartoon-ware ( UML ) is concerned note that it is NOT Pythons

Re: Getting Python Accepted in my Organisation

2005-11-03 Thread Kay Schluehr
Stefan Arentz wrote: Stuart Turner [EMAIL PROTECTED] writes: I'm already using it for a ton of things - I want to try and get broader acceptance in the organisation for it to be made and 'officially supported product'. IMO that is what you need to communicate: 'already using it for a

wxListbook layout problem

2005-10-25 Thread Kay Schluehr
Probably some of you know the amazing demo application for wxPython. When you open the Listbook demo in the Core Windows/Contols folder, replace there wx.LB_DEFAULT by wx.LB_RIGHT and resize the main window the listbox on the right side moves into the area of colored panel. This is a surprise to

Re: override a property

2005-10-22 Thread Kay Schluehr
Robin Becker wrote: Kay Schluehr wrote: Robin Becker wrote: I thought that methods were always overridable. In this case the lookup on the class changes the behaviour of the one and only property. How can something be made overridable that is actually overridable? I didn't know

Re: override a property

2005-10-20 Thread Kay Schluehr
Robin Becker wrote: I thought that methods were always overridable. In this case the lookup on the class changes the behaviour of the one and only property. How can something be made overridable that is actually overridable? I didn't know how to better express the broken polymorphism of

Re: override a property

2005-10-18 Thread Kay Schluehr
Robin Becker wrote: Is there a way to override a data property in the instance? Do I need to create another class with the property changed? -- Robin Becker It is possible to decorate a method in a way that it seems like property() respects overridden methods. The decorator cares

Re: can a cut-down Python still be Python?

2005-10-17 Thread Kay Schluehr
The Eternal Squire wrote: My main question regarding this is: even if I am successful, would the results be rejected out of hand by y'all as not meeting the Zen of Python? Have you ever asked a Zen master about Zen? Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: How to delete yourself????

2005-10-14 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: Hello, I got a problem deleting objects, which are placed in a hirarchy Asume we have the following code: class parent: MyChilds = [] # this list is filled with childs def AddChild(self,

Re: object inheritance and default values

2005-10-14 Thread Kay Schluehr
George Sakkis wrote: Ron Adam [EMAIL PROTECTED] wrote: I'm trying to implement simple svg style colored complex objects in tkinter and want to be able to inherit default values from other previously defined objects. I want to something roughly similar to ... class

Re: Merging sorted lists/iterators/generators into one stream of values...

2005-10-08 Thread Kay Schluehr
Alex Martelli wrote: try it (and read the Timbot's article included in Python's sources, and the sources themselves)... Just a reading advise. The translated PyPy source pypy/objectspace/listsort.py might be more accessible than the corresponding C code. Kay --

Re: Will python never intend to support private, protected and public?

2005-09-29 Thread Kay Schluehr
Steve Holden wrote: could ildg wrote: Python is wonderful except that it has no real private and protected properties and methods. Every py object has dict so that you can easily find what fields and methods an obj has, this is very convenient, but because of this, py is very hard to

Re: Moronicity Xha Lee, Jargonizer

2005-09-29 Thread Kay Schluehr
Raymond Hettinger wrote: James Stroud wrote: There needs to be an email filter that, when a thread is begun by a specific user . . . it cans every message in that thread. The tried-and-true solution is both simple and civil, Don't feed the trolls. Raymond People like very much

Re: Parametric Polymorphism

2005-09-26 Thread Kay Schluehr
Catalin Marinas wrote: Hi, Sorry if this was previously discussed but it's something I miss in Python. I get around this using isinstance() but it would be cleaner to have separate functions with the same name but different argument types. I think the idea gets quite close to the Lisp/CLOS

Re: C#3.0 and lambdas

2005-09-20 Thread Kay Schluehr
Fredrik Lundh wrote: [EMAIL PROTECTED] wrote: On Slashdot there is a discussion about the future C#3.0: http://developers.slashdot.org/developers/05/09/18/0545217.shtml?tid=109tid=8 http://msdn.microsoft.com/vcsharp/future/ The extensions enable construction of compositional APIs

Re: Self reordering list in Python

2005-09-16 Thread Kay Schluehr
Laszlo Zsolt Nagy wrote: Hello, Do you know how to implement a really efficient self reordering list in Python? (List with a maximum length. When an item is processed, it becomes the first element in the list.) I would like to use this for caching of rendered images. I wonder why you don't

Re: Grouping lists

2005-09-12 Thread Kay Schluehr
PyPK wrote: If I have a list say lst = [1,1,1,1,3,5,1,1,1,1,7,7,7] I want to group the list so that it returns groups such as [(0,3),4,5,(6,9),(10,12)]. which defines the regions which are similar. Thanks, Hi, I got a solution without iterators and without comparing adjecent elements!

Re: Question about consistency in python language

2005-09-11 Thread Kay Schluehr
Steve Holden wrote: Kay Schluehr wrote: Mike Meyer wrote: Yes, but the function sorted is more useful than a list method sorted in a duck typing language. I don't see what this has to do with duck typing? sorted() is simply a generic function accepting different types. I'm

Re: Why do Pythoneers reinvent the wheel?

2005-09-10 Thread Kay Schluehr
Tim Daneliuk wrote: 1) The existing tool is inadequate for the task at hand and OO subclassing is overrated/overhyped to fix this problem. Even when you override base classes with your own stuff, you're still stuck with the larger *architecture* of the original design. You really

Re: Question about consistency in python language

2005-09-09 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: Let's say I define a list of pairs as follows: l = [('d', 3), ('a', 2), ('b', 1)] Can anyone explain why this does not work? h = {}.update(l) and instead I have to go: h = {} h.update(l) to initialize a dictionary with the given list of pairs? when an

Re: Question about consistency in python language

2005-09-09 Thread Kay Schluehr
Mike Meyer wrote: Yes, but the function sorted is more useful than a list method sorted in a duck typing language. I don't see what this has to do with duck typing? sorted() is simply a generic function accepting different types. I'm not aware that sorted() requires a specific interface of

Re: Question about consistency in python language

2005-09-09 Thread Kay Schluehr
Terry Reedy wrote: Kay Schluehr [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On the other hand there exists no sorted() method for tuples or lists like join() for strings but it is implemented as a function in Python24 that returns a new sorted container. I consider

Re: Migrate PYD Files

2005-09-08 Thread Kay Schluehr
David Duerrenmatt wrote: Is there a way to use old pyd files (Python 1.5.2) with a newer version of Python without recompiling them? Because the source code is not available anymore, I'm wondering whether it's possible or not to change few bytes with a hex editor (version number?). I'd like

PEP-able? Expressional conditions

2005-09-07 Thread Kay Schluehr
One of the main reasons Pythons anonymous function lambda is considered to be broken is Pythons disability to put statements into expressions and support full functionality. Many attempts to improve lambdas syntax had also been attempts to break the expression/statement distinction in one or the

Re: PEP-able? Expressional conditions

2005-09-07 Thread Kay Schluehr
Terry Hancock wrote: On Wednesday 07 September 2005 05:29 am, Kay Schluehr wrote: Instead of pushing statements into expressions one can try to do it the other way round and model expressions with the functionality of statements. Alternative syntax proposals: (a) (COND1,EXPR1

Re: PEP-able? Expressional conditions

2005-09-07 Thread Kay Schluehr
Terry Reedy wrote: Kay Schluehr [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] No, as I explained it is not a ternary operator and it can't easily be implemented using a Python function efficiently because Python does not support lazy evaluation. By *carefully* using the flow

Re: Yielding a chain of values

2005-09-07 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: dude - this business is so confusing that you actually have to *think* about it! but python is all about simplicity. with python, when I program - I don't think *about* it - I think it. or something - don't make me think about it. so how about a reyield or some

Re: Yielding a chain of values

2005-08-31 Thread Kay Schluehr
Reinhold Birkenfeld wrote: x = [ yield r for r in iterable ] Which is quite different from x = (yield) in iterable which is currently (PEP 342) equivalent to _ = (yield) x = _ in iterable So, no further tinkering with yield, I'm afraid. Reinhold Is the statement yield from

Re: Bicycle Repair Man usability

2005-08-31 Thread Kay Schluehr
Sybren Stuvel wrote: -Get rid of extra variables by shifting them inline (e.g.: a=1;b=2;c=a+b -- c=1+2) This is already excess functionality IMO. I don't think that Rex talked about his programming style but about three and only three refactoring methods survived in BRM from ~30 Fowler

Infinity syntax. Re: Bug in string.find; was...

2005-08-31 Thread Kay Schluehr
Bengt Richter wrote: How about interpreting seq[i] as an abbreviation of seq[i%len(seq)] ? That would give a consitent interpretation of seq[-1] and no errors for any value ;-) Cool, indexing becomes cyclic by default ;) But maybe it's better to define it explicitely: seq[!i] =

Infinity syntax. Re: Bug in string.find; was...

2005-08-31 Thread Kay Schluehr
Bengt Richter wrote: How about interpreting seq[i] as an abbreviation of seq[i%len(seq)] ? That would give a consitent interpretation of seq[-1] and no errors for any value ;-) Cool, indexing becomes cyclic by default ;) But maybe it's better to define it explicitely: seq[!i] =

Re: Infinity syntax. Re: Bug in string.find; was...

2005-08-31 Thread Kay Schluehr
Bengt Richter wrote: range(9)[4:-!0:-1] == range(5) True Interesting, but wouldn't that last line be range(9)[4:-!0:-1] == range(5)[::-1] Ups. Yes of course. Life can be simpler with unbound limits. Hm, is !0 a di-graph symbol for infinity? What if we get full unicode on our screens?

Re: Yielding a chain of values

2005-08-31 Thread Kay Schluehr
Reinhold Birkenfeld wrote: Kay Schluehr wrote: Reinhold Birkenfeld wrote: x = [ yield r for r in iterable ] Which is quite different from x = (yield) in iterable which is currently (PEP 342) equivalent to _ = (yield) x = _ in iterable So, no further tinkering

Re: Epydoc - Documenting class members?

2005-08-31 Thread Kay Schluehr
This should help: http://epydoc.sourceforge.net/fields.html Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Bug in slice type

2005-08-21 Thread Kay Schluehr
Steven Bethard wrote: The slice of s from i to j with step k is defined as the sequence of items with index x = i + n*k such that 0 = n (j-i)/k. This seems to contradict list behavior though. range(10)[9:-1:-2] == [] No, both is correct. But we don't have to interpret the second slice

Re: Proposed PEP: New style indexing, was Re: Bug in slice type

2005-08-21 Thread Kay Schluehr
Bryan Olson wrote: Steven Bethard wrote: Well, I couldn't find where the general semantics of a negative stride index are defined, but for sequences at least[1]: The slice of s from i to j with step k is defined as the sequence of items with index x = i + n*k such that 0 = n

Re: Library vs Framework (was Dr. Dobb's Python-URL!)

2005-08-17 Thread Kay Schluehr
Simon Brunning wrote: On 8/15/05, Rocco Moretti [EMAIL PROTECTED] wrote: Which lead me to the question - what's the difference between a library and a framework? If you call its code, it's a library. If it calls yours, it's a framework. Pretty! I don't think it is an oversimplification.

Re: Python supports LSP, does it?

2005-08-11 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: On Thu, 11 Aug 2005 01:19:19 +0100 phil hunt wrote: According to Wikipedia, the Liskov substitution principle is: Let q(x) be a property provable about objects x of type T. Then q(y) should be true for objects y of type S where S is a subtype of T To

Re: Python -- (just) a successful experiment?

2005-08-09 Thread Kay Schluehr
EP wrote: But sometimes a rugged individual can be even more rugged and more individual if said individual has the support of friends by which to vet ideas and, by absorbing counterpoint, to develop one's own thoughts even further. And it is kind of nice when you have two teams drilling a

Re: PEP: Specialization Syntax

2005-08-08 Thread Kay Schluehr
Nicolas Fleury wrote: It is necessary to maintain a dictionary of types (to avoid redundacy) and simple things like: def makeType(someArgument): class MyObject: someArgument = someArgument return MyObject are not allowed. def makeClass(cls_name, **kw): return

Re: PEP: Specialization Syntax

2005-08-08 Thread Kay Schluehr
Nicolas Fleury schrieb: Kay Schluehr wrote: def makeClass(cls_name, **kw): return type(cls_name,(), kw) MyObject = makeClass(MyObject,a=8) MyObject As said to Bengt, a place is needed to write the class definition. There's no need for metaclass in that case: def makeType(a, b

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Kay Schluehr
Paul Rubin schrieb: Having a good FFI is certainly an important feature but Python programs should first and foremost be Python programs. Python was originally created as an extension language for C. In some sense it is an abstraction layer for C libs. Compare the situation with Java or

Re: Python -- (just) a successful experiment?

2005-08-08 Thread Kay Schluehr
Bengt Richter wrote: It occurs to me that we have the PEP process for core python, but no PEP process for the python app/lib environment. What about starting a PEEP process (Python Environment Enhancement Proposals) modeled on PEPs, where those motivated to formalize their pet projects or

Re: python for microcontrollers

2005-08-08 Thread Kay Schluehr
Hi Bastard, one of the main reasons PyPy gets funded by the EU was the promise to port Python to embedded systems ( but not necessarily very memory restricted ones ). The project seems to be in a state where the team tries to get rid of the CPython runtime alltogether and reaching some autonomy.

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Kay Schluehr
Eric Pederson wrote: Raise your hand if you think the best technology wins! Who is interested in such a matter? Is this a forum dedicated to some programming language or a popularity contest? If Python dies in a few years / looses attention but the Python Zen survives in another language I have

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Kay Schluehr
Martin P. Hellwig wrote: Kay Schluehr wrote: Eric Pederson wrote: Raise your hand if you think the best technology wins! Who is interested in such a matter? Is this a forum dedicated to some programming language or a popularity contest? If Python dies in a few years / looses

Re: Chopping off spaces at both ends

2005-08-07 Thread Kay Schluehr
Use the strip() method. Example: \t abc\n.strip() abc Variants are lstrip() and rstrip(). Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Decline and fall of scripting languages ?

2005-08-06 Thread Kay Schluehr
No good news for scripting-language fans: http://www.phpmag.net/itr/news/psecom,id,23284,nodeid,113.html Regards Kay -- http://mail.python.org/mailman/listinfo/python-list

Proposal: unshadow operator ''

2005-08-06 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: I've heard 2 people complain that word 'global' is confusing. Perhaps 'modulescope' or 'module' would be better? Am I the first peope to have thought of this and suggested it? Is this a candidate for Python 3000 yet? Chris Maybe a solution would be best that is

Re: Fat and happy Pythonistas (was Re: Replacement for keyword 'global' good idea? ...)

2005-08-06 Thread Kay Schluehr
John Roth wrote: Another thing that stands out: the explicit versus dynamic typing debate has moved on from program correctness (which is a wash) to other areas that explicit (or derived) type information can be used for. I see this in PyFit: the languages where explicit type information is

Re: Decline and fall of scripting languages ?

2005-08-06 Thread Kay Schluehr
Paul Rubin wrote: Cliff Wells [EMAIL PROTECTED] writes: It didn't say what they left PHP, Perl and Python for (if you are to even believe their findings). PHP has been losing programmers in droves... to Ruby on Rails, but I'm not sure how that is bad news for scripting-language fans.

Re: Wheel-reinvention with Python

2005-08-01 Thread Kay Schluehr
Reinhold Birkenfeld wrote: In practise any Python GUI is going to contain code from otyher languages since if it was coded all the way down in python it would be too slow. Oh, I could imagine that a MFC-like wrapper around win32gui, or another one around Xlib wouldn't be slower that

Re: Wheel-reinvention with Python

2005-07-31 Thread Kay Schluehr
Ed Leafe wrote: On Sunday 31 July 2005 01:02, phil hunt wrote: You mightn't have, but I suspect more Python programers who've written GUI apps have used Tkinter than any of the other APIs. Not that I'm a particular fan of it, it's just I like standardisation, because then you get

Re: Wheel-reinvention with Python

2005-07-31 Thread Kay Schluehr
Cliff Wells wrote: My objection with wrappers around wrappers around wrappers is that I have no hope ever watching the ground. If some error occurs, which layer has to be addressed? Which developing group is reponsible? My own or that of team A, team B, team C ... ? The baroque concept is

Re: namespaces

2005-07-31 Thread Kay Schluehr
Paolino wrote: The second point also shows my perplexities about functions namespace: def function(): function.foo='something' a=function.foo Traceback (most recent call last): File stdin, line 1, in ? AttributeError: 'function' object has no attribute 'foo' How should I read

Re: A replacement for lambda

2005-07-30 Thread Kay Schluehr
Tim Roberts schrieb: Scott David Daniels [EMAIL PROTECTED] wrote: What kind of shenanigans must a parser go through to translate: x**2 with(x)x**3 with(x) this is the comparison of two functions, but it looks like a left- shift on a function until the second with is encountered.

Re: A replacement for lambda

2005-07-30 Thread Kay Schluehr
Mike Meyer schrieb: I know, lambda bashing (and defending) in the group is one of the most popular ways to avoid writing code. However, while staring at some Oz code, I noticed a feature that would seem to make both groups happy - if we can figure out how to avoid the ugly syntax. This

Re: A replacement for lambda

2005-07-30 Thread Kay Schluehr
Paul Rubin wrote: Kay Schluehr [EMAIL PROTECTED] writes: Examples: f = ( || x=0 then f(x) || True then f(-x) from (x,) ) g = ( || x 0 then self._a -x || self._a - 0 from (x,)) Is this an actual language? It looks sort of like CSP. Python with native parallelism, m

Re: Ten Essential Development Practices

2005-07-30 Thread Kay Schluehr
Dark Cowherd wrote: -Quote - Phillip J. Eby from dirtsimple.org Python as a community is plagued by massive amounts of wheel-reinvention. The infamous web framework proliferation problem is just the most egregious example. Why is Python blessed with so much reinvention? Because it's often

Re: Comparison of functions

2005-07-30 Thread Kay Schluehr
Some indications: for i in range(5): ... x = lambda x:x ... y = lambda y:y ... print x,y,xy,id(x)id(y) ... function lambda at 0x00EE83F0 function lambda at 0x00EE8FB0 True True function lambda at 0x00EE8AB0 function lambda at 0x00EE83F0 False False function lambda at 0x00EE8FB0

Re: Lists pointers

2005-07-23 Thread Kay Schluehr
Jan Danielsson wrote: Hello all, I have written a simple whiteboard application. In my application, I want to be able to set draw attributes. This part works. I have a dictionary object which contains stuff like: self.attr['Pen.Color'] = ... self.attr['Pen.Thickness'] = ... Now, the

Re: python certification

2005-07-20 Thread Kay Schluehr
[EMAIL PROTECTED] schrieb: hi i bassically need it cuz i am appyling to colleges this year and i know this kind of stuff really helps. besides since i am learning python i thought i might get some credit for it as well. its bassically for a mention in my resume/bio-data/appliccation i am

Re: python certification

2005-07-20 Thread Kay Schluehr
Andreas Kostyrka schrieb: (These are the people look for Pearl and Pyhton programmers ;) ) Or Phyton :) Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Ordering Products

2005-07-19 Thread Kay Schluehr
Ron Adam wrote: Kay Schluehr wrote: Here might be an interesting puzzle for people who like sorting algorithms ( and no I'm not a student anymore and the problem is not a students 'homework' but a particular question associated with a computer algebra system in Python I'm currently

Re: Ordering Products

2005-07-19 Thread Kay Schluehr
Diez B.Roggisch wrote: I have to admit that I don't understand what you mean with the 'constant parts' of an expression? From what I percieved of your example it seemed to me that you wanted to evaluate the constants like 7*9 first, so that an expression like a * 7 * 9 * b with

Documentation bug: Python console behaviour changed

2005-07-19 Thread Kay Schluehr
The documentation of the Python console behaviour is not correct anymore for Python 2.4.1. At least for the Win2K system I'm working on 'Ctrl-Z' does not shut down the console but 'Ctrl-D' etc. The Python interpreter tells me instead: quit 'Use Ctrl-Z plus Return to exit.' Nah, 'Ctrl-Z' is now

<    1   2   3   4   5   6   7   8   >