Re: Documentation bug: Python console behaviour changed

2005-07-19 Thread Kay Schluehr
Peter Hansen schrieb: > Kay Schluehr wrote: > > 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'

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 n

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

Re: Ordering Products

2005-07-18 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 >

Re: goto

2005-07-18 Thread Kay Schluehr
Hayri ERDENER schrieb: > hi, > what is the equivalent of C languages' goto statement in python? > best regards No, but some of goto's use cases can be covered by unconditional jumps provided by exceptions. Here is a C function using goto: void main() { int i, j; for ( i = 0; i < 10;

Re: Ordering Products

2005-07-18 Thread Kay Schluehr
Bernhard Holzmayer schrieb: > Kay Schluehr wrote: > > > > > Now lets drop the assumption that a and b commute. More general: let be > > M a set of expressions and X a subset of M where each element of X > > commutes with each element of M: how can a product with

Re: Ordering Products

2005-07-17 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 >

Re: Ordering Products

2005-07-17 Thread Kay Schluehr
Diez B.Roggisch wrote: > Kay Schluehr gmx.net> writes: > > > Now lets drop the assumption that a and b commute. More general: let be > > M a set of expressions and X a subset of M where each element of X > > commutes with each element of M: how can a product with fa

Ordering Products

2005-07-17 Thread Kay Schluehr
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 developing in my sparetime ). For motivation lets d

Re: decorators as generalized pre-binding hooks

2005-07-11 Thread Kay Schluehr
Christopher Subich schrieb: > Kay Schluehr wrote: > > I think it would be a good idea to pronounce the similarity between > > function decorators and metaclasses. Metaclasses were once introduced > > as an arcane art of fuzzy bearded hackers or supersmart 'enterprise &g

Re: decorators as generalized pre-binding hooks

2005-07-11 Thread Kay Schluehr
George Sakkis schrieb: > > 1. classes have metaclasses, functions don't have metafunctions. No one > > gave an example for classes not handled at least as well with a metaclass. > > Would something like the following count ? > > @abstractclass > class AbstractFrame(object): > > @abstractclass

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-11 Thread Kay Schluehr
Reinhold Birkenfeld schrieb: > Kay Schluehr wrote: > > Dan Sommers schrieb: > > > >> How about this: > >> > >> def __init__(self, self.x, y, self.z): > >> # self.x, self.z from first and third explicit parameters > >>

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-10 Thread Kay Schluehr
Dan Sommers schrieb: > How about this: > > def __init__(self, self.x, y, self.z): > # self.x, self.z from first and third explicit parameters > do_something_with_y() Can you tell me in which way it is anyhow better than the original proposal def __init__(self, .x, y, .z)

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-09 Thread Kay Schluehr
> I stripped your code down to the essence. See attachment. > For the user your approach then becomes: > > class grouping: > __metaclass__ = autoattr > def __init__(self, x, y, z): > pass No. This is clearly NOT what I had in mind. I translated your original proposal which introdu

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-09 Thread Kay Schluehr
Ralf W. Grosse-Kunstleve schrieb: > My initial proposal > (http://cci.lbl.gov/~rwgk/python/adopt_init_args_2005_07_02.html) didn't > exactly get a warm welcome... Well ... yes ;) Ralf, if you want to modify the class instantiation behaviour you should have a look on metaclasses. That's what they

Hosting Python projects

2005-07-09 Thread Kay Schluehr
Jacob Page schrieb: > I have created what I think may be a useful Python module, but I'd like > to share it with the Python community to get feedback, i.e. if it's > Pythonic. If it's considered useful by Pythonistas, I'll see about > hosting it on Sourceforge or something like that. Is this a go

Re: Lisp development with macros faster than Python development?..

2005-07-09 Thread Kay Schluehr
Kirk Job Sluder schrieb: > "Kay Schluehr" <[EMAIL PROTECTED]> writes: > > > This might be a great self experience for some "great hackers" but just > > annoying for others who used to work with modular standard librarys and > > think that the b

Re: removing list comprehensions in Python 3.0

2005-07-08 Thread Kay Schluehr
Leif K-Brooks schrieb: > Kay Schluehr wrote: > >>>>list.from_str("abc") > > > > list("a", "b", "c" ) > > > I assume we'll also have list.from_list, list.from_tuple, > list.from_genexp, list.from_xrange, etc.? O

Re: removing list comprehensions in Python 3.0

2005-07-08 Thread Kay Schluehr
Leif K-Brooks schrieb: > Kay Schluehr wrote: > > Well, I want to offer a more radical proposal: why not free squared > > braces from the burden of representing lists at all? It should be > > sufficient to write > > > >>>>list() > > > >

Re: removing list comprehensions in Python 3.0

2005-07-08 Thread Kay Schluehr
Steven Bethard schrieb: > I think the jury's still out on this one: > > * Alex Martelli expects list comprehensions to be removed. [1] > * Robert Kern wants list comprehensions removed. [2] > * Raymond Hettinger encourages continued use of list comprehensions [3] > * Jeremy Bowers thinks list comp

Re: f*cking re module

2005-07-08 Thread Kay Schluehr
jwaixs schrieb: > arg... I've lost 1.5 hours of my precious time to try letting re work > correcty. 1.5 hours are not enough for understanding regular expressions. But to be honest: I never had the patience to learn them accurately and I guess I will never do so as well as I don't ever learn sed o

Re: Lisp development with macros faster than Python development?..

2005-07-08 Thread Kay Schluehr
[EMAIL PROTECTED] schrieb: > I've been reading the beloved Paul Graham's "Hackers and Painters". > He claims he developed a web app at light speed using Lisp and lots > of macros. Yes, Paul is a postmodern hero who reininvents himself and his language every day and with every program: "Experien

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

2005-06-18 Thread Kay Schluehr
D H wrote: > That's why so many people have switched to Java or C# (or Python and > other langugages of course). You might talk to them about using Python, > since Python and C/C++ fit together very nicely (with tools like BOOST, > SWIG, Pyrex,...). But me personally I like to avoid C++ altogeth

Re: Dealing with marketing types...

2005-06-16 Thread Kay Schluehr
Sorry, Cameron, if I twist meanings. Thomas argues that Python programmers are more expensive than Java ones. But if one needs more Java programmers to fit into the project plan one needs probably more managenment/admistration staff ( ~ ratio = 1/3) and managers are usually more expensive than pro

Re: Dealing with marketing types...

2005-06-12 Thread Kay Schluehr
Drazen Gemic wrote: > With Java I depend very little on customers IT staff, sysadmins, etc. If > I need additional functionality in form library, extension, whatever, all > I need is to drop another JAR in, and that does it. Maybe this is for you? http://peak.telecommunity.com/DevCenter/PythonEg

Re: Dealing with marketing types...

2005-06-10 Thread Kay Schluehr
fuzzylollipop wrote: > There are 2 things he can do. > > 1. Get your resume ready and approach the CEO or whomever and say. Why > is this happening? Since I can guarantee you they have already decided > to port this app to Java. The CEO is probably indifferent about particular technology issues b

Re: Abstract and concrete syntax

2005-06-10 Thread Kay Schluehr
Terry Reedy wrote: > > lambda x: {True:2,False:3}.get(bool(a)) > > This is limited by the requirement that both branches be computable > regardless of the value of the condition. > > > which is both beautiful and pythonic. > > Beauty is in the eye of the beholder. It seems that relative pythoni

Re: Dealing with marketing types...

2005-06-10 Thread Kay Schluehr
flyingfred0 wrote: > A small software team (developers, leads and even the manager when he's > had time) has been using (wx)Python/PostgreSQL for over 2 years and > developed a successful 1.0 release of a client/server product. > > A marketing/product manager has brought in additional management an

Re: Basic questions about packages/modules.

2005-06-10 Thread Kay Schluehr
Negroup schrieb: > Hi, first of all sorry for boring you with a such simple request. I'm > using Python since few days, and I like it even if I'm not yet in > confidence. I'd like to organize my programs in hierarchical > structures, thus I thought that packages could be the solution, > however I h

Re: Abstract and concrete syntax

2005-06-10 Thread Kay Schluehr
Mandus schrieb: > As someone who like to do functional style programming, but without a > lot of training in that dept., I miss what you ask for from time to > time. > > I don't want to go to much into this discussion, just comment on a tiny > little bit: > > Thu, 09 Jun 2005 03:32:12 +0200 skrev

Re: Annoying behaviour of the != operator

2005-06-08 Thread Kay Schluehr
Jordan Rastrick wrote: > Just because a behaviour is documented, doesn't mean its not counter > intutitive, potentially confusing, and unnessecary. > > I have spent a fair amount of time reading the Python docs. I have not > yet memorised them. I may have read this particular section of the > ref

Re: computer algebra packages

2005-06-07 Thread Kay Schluehr
Rahul wrote: > Hi. > Well is there an open source computer algebra system written in python > or at least having a python interface? > I know of 2 efforts: pythonica and pyginac...are there any others? > > rahul Not in the moment. But I have a question to you: why do you seek for a CAS in Python?

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: 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: any macro-like construct/technique/trick?

2005-06-05 Thread Kay Schluehr
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(DbgObjFoo(a,b,c)) > > # do more stuff > if debug: > emit_dbg_obj(Db

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

2005-06-05 Thread Kay Schluehr
John J. Lee wrote: > Saw this on LWN: > > http://q-lang.sourceforge.net/ > > > Looks interesting, and reminiscent of symbolic algebra systems like > Mathematica. Also, the website mentions dynamic typing and "Batteries > Included", which made me think of Python. Damned silly name, though > (per

Re: metaclass that inherits a class of that metaclass?

2005-06-01 Thread Kay Schluehr
ironfroggy wrote: > because they are representing a seperate typing system outside of > python, to which I am creating a bridge. Since a type-hierarchy is a tree also a subtree of it is a type-hierarchy. You only have to map the root of a sub-hierarchy of Python classes to the root of the hierarch

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

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: first release of PyPy

2005-05-28 Thread Kay Schluehr
Anton Vredegoor wrote: > I'm not involved in PyPy myself but this would seem a logical > possibility. To go a step further, if the compiler somehow would know > about the shortest machine code sequence which would produce the > desired effect then there would be no reason to limit onself to only >

Re: open file in dir independently of operating system

2005-05-25 Thread Kay Schluehr
Joerg Schuster schrieb: > Hello, > > > I want to open the file 'configuration.smo' that is in directory dir. > Yet, I don't know on which os my program is being run. On Unix I would > say: > > f = open(dir + '/configuration.smo', 'r') > > What is the os-independent version of this line? Did You c

Re: What are OOP's Jargons and Complexities?

2005-05-23 Thread Kay Schluehr
Xah Lee wrote: > As part of this new syntax and purity, where everything in a program is > of Classes and Objects and Methods, many complex issues and concept > have arisen in OOP. Yes and it is easy to communicate a class which represents some thing determined by object oriented analysis and can

Re: first release of PyPy

2005-05-23 Thread Kay Schluehr
Carl Friedrich Bolz wrote: > Rocco Moretti wrote: > > Alex Stapleton wrote: > > > >>The question still remains, can it run it's self? ;) > >> > > This allready worked in the past, though it doesn't at the moment. > > > > > > > I think they try, every once in a while, to self host. The only problem

Re: None module reference

2005-05-21 Thread Kay Schluehr
Stefan Seefeld wrote: > hello, > > I'v run into a bug that I find hard to understand: > > In a python module of mine I import system modules > ('sys', say) and then use them from within some functions. > > However, during program termination I'm calling > one such function and the module reference

Re: first release of PyPy

2005-05-21 Thread Kay Schluehr
Shane Hathaway wrote: > Now people are experimenting with high level compilers written in high level > languages. Where will this pattern lead? Who knows. :-) Drift from old Europe ( greek Pythons ) to old India to "Nagas" and other snake-beings and goddesses :-) http://www.khandro.net/myster

Re: first release of PyPy

2005-05-21 Thread Kay Schluehr
Torsten Bronger wrote: > Hallöchen! > > Paul Rubin writes: > > > Torsten Bronger <[EMAIL PROTECTED]> writes: > > > >> Please could somebody explain to us non-CS people why PyPy could > >> have speed features CPython can't have? > > > > Does the one-word answer "compiler"

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-20 Thread Kay Schluehr
holger krekel wrote: > Welcome to PyPy 0.6 > > > *The PyPy Development Team is happy to announce the first > public release of PyPy after two years of spare-time and > half a year of EU funded development. The 0.6 release > is eminently a preview release.* Congratulation to

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

2005-05-19 Thread Kay Schluehr
Dave Brueck wrote: > Overall it's been such a positive experience for us that nobody in the company - > from grunt testers up to the CTO - has any reservations about using Python in > production anymore (even though initially they all did). All of the developers > have previous experience with us

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

2005-05-18 Thread Kay Schluehr
George Sakkis wrote: > Personally, although I find nothing comes close to the clarity and > flexibility that python offers, in this case I would go with java, if > for nothing else, to be on the safe side. "No manager got ever fired for buying IBM" > Think about it: if the > project fails (and t

Re: EpyDoc problem

2005-05-18 Thread Kay Schluehr
Laszlo Zsolt Nagy wrote: > I had to patch EpyDoc. The author was not responding and there is no mailing > list for EpyDoc. Is it still a live project? EpyDoc is hosted in Sourceforge. This alone may answer your question about a bug-tracker: http://sourceforge.net/tracker/?atid=405618&group_id=32

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

2005-05-18 Thread Kay Schluehr
john67 wrote: > Would the allocation/deallocation memory usage issue be different than > it would be with Java? Both Python and Java have automatic garbage > collection, correct? In recent Python versions the CPython interpreter offers a cycle-collector which weakens the most profound counter ar

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

2005-05-16 Thread Kay Schluehr
Tony Meyer wrote: > [The HTML version of this Summary is available at > http://www.python.org/dev/summary/2005-04-16_2005-04-30.html] > > > > == > Summary Announcements > == > > --- > Exploding heads > --- > > After a gentle introduct

Sober-Q

2005-05-15 Thread Kay Schluehr
Paul Rubin wrote: > Bernd Nawothnig <[EMAIL PROTECTED]> writes: > > On 2005-05-15, [EMAIL PROTECTED] [allegedly] wrote: ... > > I don't think that post was really from MAL. It seems to be a sporgery > attack on the newsgroup. Sigh. The spam mails stem from a Sober variant, which sends Nazi prop

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

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-10 Thread Kay Schluehr
Paul Rubin wrote: > "Roger Binns" <[EMAIL PROTECTED]> writes: > > Err, you proved my point! Prothon was fine at the VM level. The > > author couldn't figure out how to get a decent sized "standard" > > library, and ultimately ended up abandoning his VM for .Net since > > that gets you a large st

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: __brace__ (PEP?)

2005-05-08 Thread Kay Schluehr
Roy Smith wrote: > foo->bar ==> foo.__arrrow__(bar) > foo$bar ==> foo.__dollar__(bar) > foo#bar ==> foo.__hash__(bar) > foo::bar ==> foo.__scope__(bar) I'm strongly in favor for the arrow ( but with two "r" only ). The question is simply: for what? > and so on down the list of non-alphanumeric c

Re: pyvm -- faster python

2005-05-08 Thread Kay Schluehr
Stelios Xanthakis wrote: > Hi. > > pyvm is a program which can run python 2.4 bytecode (the .pyc files). > A demo pre-release is available at: > http://students.ceid.upatras.gr/~sxanth/pyvm/ > > > Facts about pyvm: > - It's FAST. According to the "cooked-bench" benchmark suite it finishes >

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

Hard times with packages and instances

2005-05-05 Thread Kay Schluehr
Hi people, 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? Example: MyPackage/ Top-level package __init__.py Initialize package

Re: ANN: pynetwork 2.25

2005-04-30 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: > Pynetwork is a graph library, my first SourceForge project: > > http://sourceforge.net/projects/pynetwork/ > > It included tests, some demo, some premilinary docs, and some images. > You can see some screenshoots on the SourceForge page for them. > I know about 5-6 other

Re: New Python website

2005-04-30 Thread Kay Schluehr
lpe wrote: > http://www.pycode.com > > I was kinda suprised when I could not find any good sites with 3rd > party modules (other than the Vaults of Parnassus, where you must host > files elsewhere), so I decided to write one myself :) Maybe You shot a bit fast? PiPy is good and the Vaults are goo

Re: suggestions on how to do this

2005-04-27 Thread Kay Schluehr
Seems You are looking for a generating function of a recurrence relation. There is a standard text about this topic written by Herbert S. Wilf downloadable from his homapage: http://www.cis.upenn.edu/~wilf/ Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Injecting code into a function

2005-04-26 Thread Kay Schluehr
George Sakkis wrote: > That's all good, at least if I knew how to poke with bytecodes ;-) > What's a good starting point to look at ? http://sourceforge.net/projects/bytecodehacks/ http://bytecodehacks.sourceforge.net/bch-docs/bch/ For more recent development this ANN of Christian Tismer is imp

Re: Injecting code into a function

2005-04-26 Thread Kay Schluehr
George Sakkis wrote: > > Oh, I overlooked this. Then the solution becomes simple: > > > >sys._getframe().f_trace > > > > Test: > > > > >>> an = Analyzer() > > >>> sys.settrace(an.trace_returns) > > >>> sys._getframe().f_trace > > at > > 0x010015D0>> > > Does this work for you non-interactivel

Re: Injecting code into a function

2005-04-25 Thread Kay Schluehr
Lonnie Princehouse wrote: > I don't know of a way to get the current global trace function. This > could certainly cause trouble if you're trying to be compatible with > other packages that want to use their own trace functions (like psyco, > or debuggers). Does anyone know how to get the globa

Re: Injecting code into a function

2005-04-25 Thread Kay Schluehr
George Sakkis wrote: > Thanks, that's the closest to what I wanted. A minor point I didn't > quite get from the documentation is how to set a local trace instead of > a global (sys) trace. You never do. "Local" in this context only means that those local trace functions are called inside the one

Re: Variables

2005-04-24 Thread Kay Schluehr
Richard Blackwood wrote: > Could I honestly argue this to him? From what basis do I argue that it > is not an equation? In any event, he would likely (passionately) > disagree considering his notion that programming is an off-shoot of math > and thus at the fundamental level has identical concepts

Re: pre-PEP: Suite-Based Keywords - syntax proposal

2005-04-19 Thread Kay Schluehr
Bengt Richter wrote: [...] > Um, I think that's too narrow for where. Consider > > foo = f1; bar=f2; x=k1; y=k2 > foo(x)*bar(y)[3].attr > > now should > > foo(x)*bar(y)[3].attr where: > foo = f1; bar=f2; x=k1; y=k2 I think we are diverging again. You are right with Your obje

Re: pre-PEP: Suite-Based Keywords - syntax proposal

2005-04-17 Thread Kay Schluehr
Steven Bethard wrote: > So the object of a "where" is then always an ordered dict? Yes. > If so, then > I guess I like this proposal best so far. > > However, it does seem to have the problem that you can't have any > additional local variables so, for example, list comprehensions are > probably

Re: pre-PEP: Suite-Based Keywords - syntax proposal

2005-04-17 Thread Kay Schluehr
Bengt Richter wrote: > On 17 Apr 2005 09:27:34 -0700, "Kay Schluehr" <[EMAIL PROTECTED]> wrote: > > >> Exactly. Except the above example is from the day-old-bread > >items-tuple-returning version of :: ;-) > >> And with an ordered dict subtype th

Re: re module methods: flags(), pattern()

2005-04-17 Thread Kay Schluehr
Xah Lee wrote: > Python re module has methods flags and pattern. How to use these > exactly? >From the Python 2.3 documentation, section 2.4.2 flags The flags argument used when the RE object was compiled, or 0 if no flags were provided. groupindex A dictionary mapping any symbolic group name

Re: pre-PEP: Suite-Based Keywords - syntax proposal

2005-04-17 Thread Kay Schluehr
> Exactly. Except the above example is from the day-old-bread items-tuple-returning version of :: ;-) > And with an ordered dict subtype there is no need for the generator expression either, > since there is a values method for dicts (which in the subtype would preserve order). E.g., > > x = prope

Re: pre-PEP: Simple Thunks

2005-04-17 Thread Kay Schluehr
Ron_Adam wrote: > I sort of wonder if this is one of those things that looks like it > could be useful at first, but it turns out that using functions and > class's in the proper way, is also the best way. (?) I think Your block is more low level. It is like copying and pasting code-fragments tog

Re: pre-PEP: Suite-Based Keywords - syntax proposal

2005-04-16 Thread Kay Schluehr
Robert Brewer wrote: > Bengt Richter wrote: > > The '::' unary suite operator should return an ordered dict > > subtype representing the bindings > > Why ordered? Because You can't otherwise guarantee to feed optional argument parameters in a correct way. Example: x = property(*seq) where:

Re: pre-PEP: Suite-Based Keywords - syntax proposal

2005-04-16 Thread Kay Schluehr
Bengt Richter wrote: > On Sun, 17 Apr 2005 01:10:47 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: > [...] > > > >The "::" expression I'm proposing generalizes capturing suite bindings into an ordered sequence of (key,value) > >tuples, like an ordered vars().items() limited to the bindings produced

Re: pre-PEP: Suite-Based Keywords

2005-04-16 Thread Kay Schluehr
Nicolas Fleury wrote: > Shane Hathaway wrote: > > I like this PEP a lot, but your concern is valid. Maybe Brian could > > modify the PEP slightly to disambiguate. How about using an ellipsis in > > the argument list to signify suite-based keywords? Examples: > > > > f(...): > > x = 1 > > >

Re: pre-PEP: Suite-Based Keywords - syntax proposal

2005-04-16 Thread Kay Schluehr
The idea is interesting but not unambigously realizable. Maybe one should introduce some extra syntax for disambiguation and thereby generalize the proposal. as : # list of definitions and assignments Proposed specifiers are dict, tuple, *, ** and func. - as dict: conversion into a dict

Re: pre-PEP: Simple Thunks

2005-04-16 Thread Kay Schluehr
Brian Sabbey wrote: > def get_items(thunk):# <-- "thunk-accepting function" > f = acquire() > try: > for i in f: > thunk(i) # A-OK > finally: > f.release() > > do i in get_items(): > print i Seems like You want to solve the addressed gene

Re: Behavioural identity - a short discussion

2005-04-11 Thread Kay Schluehr
Terry Reedy wrote: > "Kay Schluehr" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > class A(object): > >def __init__(self): > >raise NotImplemented > > > > We can regard class A as a "pure abstract" cla

Behavioural identity - a short discussion

2005-04-10 Thread Kay Schluehr
In mathematics two functions can be considered equal when they represent the same function graph. This is nothing but a set-theoretical identity. It is a nice criterion in theory bad a bad one in practice because it is impossible to calculate all values of an arbitrary function and this is true not

Re: Thoughts on some stdlib modules

2005-04-10 Thread Kay Schluehr
Fredrik Lundh wrote: > here are three alternatives: > > ltree (http://codespeak.net/lxml/) > libxml2 (http://xmlsoft.org/downloads.html) > celementtree (http://effbot.org/zone/celementtree.htm) Thanks, Fredrik, I will take a look. Ciao, Kay -- http://mail.python.org/mailman/listin

Re: Thoughts on some stdlib modules

2005-04-10 Thread Kay Schluehr
Fredrik Lundh wrote: > Kay Schluehr wrote: > > > You have already given the arguments in Your discussion above. I > > personally never use the standard-lib XML parser, but pyRXP/pyRXPU > > which is fast, stores objects in pythonic list/tuple/dict structures > > and p

Re: Thoughts on some stdlib modules

2005-04-10 Thread Kay Schluehr
Martin v. Löwis wrote: > That said, if the people who want a path object would get together > and contribute one, the library could be extended. I don't know > whether this would be an improvement, though - os.path could not > go away for backwards compatibility, so users would now have *two* > wa

Re: Thoughts on some stdlib modules

2005-04-10 Thread Kay Schluehr
Steve Holden wrote: > You are correct in suggesting that the library could be better organized > than it is, but I felt we would be better off deferring such change > until the emergence of Python 3.0, which is allowed to break backwards > compatibility. So, start working on your scheme now - PEP

Re: Thoughts on some stdlib modules

2005-04-10 Thread Kay Schluehr
Martin v. Löwis wrote: > Is it good that people write these wrappers? No. > I don't think so. Is it > the library's fault? I don't think so, either. People write these > wrappers because they cannot remember how to use the library. I slightly disagree. It's a symptom. The example of the path-m

Re: Puzzling OO design problem

2005-04-09 Thread Kay Schluehr
Hi George, it's a nice little puzzle and it is more fun to solve it if one is not a student anymore :) Filling the gaps in the lattice is somehow necessary but it is not necessary to create all the classes. Ansatz: We can consider two matrices: one is filled with nodes ( class names ) the other

Re: Decorator Base Class: Needs improvement.

2005-04-05 Thread Kay Schluehr
Bengt Richter wrote: > From the 2.4 Grammar, the key part seems to be > > decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE > decorators: decorator+ > funcdef: [decorators] 'def' NAME parameters ':' suite > > and further on > > dotted_name: NAME ('.' NAME)* > > So the Python

Re: Decorator Base Class: Needs improvement.

2005-04-05 Thread Kay Schluehr
Bengt Richter wrote: > From the 2.4 Grammar, the key part seems to be > > decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE > decorators: decorator+ > funcdef: [decorators] 'def' NAME parameters ':' suite > > and further on > > dotted_name: NAME ('.' NAME)* > > So the Python

Re: Decorator Base Class: Needs improvement.

2005-04-05 Thread Kay Schluehr
Steve Holden wrote: > You have several times mentioned the possibility of a decorator taking > more than one argument, but in my understanding of decorators this just > wouldn't make sense. A decorator should (shouldn't it) take precisely > one argument (a function or a method) and return precise

Re: Decorator Maker is working. What do you think?

2005-04-05 Thread Kay Schluehr
Ron_Adam wrote: > Ok... it's works! :) > > So what do you think? Not much. As long as You do not present any nontrivial examples like Guidos MultiMethod decorator or an implementation of the dispatching "case" decorator I proposed that would benefit from factoring into pre- and postprocessing the

Re: Docorator Disected

2005-04-02 Thread Kay Schluehr
Ron_Adam wrote: > def decorator(d_arg): # (7) Get 'Goodbye' off stack > > def get_function(function): # (8) Get func object off stack > > def wrapper(f_arg):# (9) Get 'Hello' off stack > > new_arg = f_arg+'-'+d_arg > result = function(new_arg) # (10

Some notes about float approximations in mxNumber

2005-04-01 Thread Kay Schluehr
Hi Mark, I was a bit surprised to find the very slow Farey approximation by means of the class in the mxNumber package. If the goal was to reconstruct a rational from a float it is not a good choice and should be replaced by a continued fractions approximation. Some time ago I implemented it by m

Re: Our Luxurious, Rubinesque, Python 2.4

2005-04-01 Thread Kay Schluehr
Larry Hastings wrote: > Also, how much would I be > able to trim away if I recompiled it myself? Is a lot of it native > implementations of Python libraries that I might not care about > including, or is it all fundamental VM stuff that couldn't possibly be > removed? In Pythons config.c file Yo

Re: assignments - want a PEP

2005-03-31 Thread Kay Schluehr
Bengt Richter wrote: > you can do what you like, pretty much. I.e., > > cas = CAS() > cas.a# like your plain a, where you said "that's it" > > > cas.a, cas.b = cas.Expr(), cas.Expr() > (cas.a + cas.b)/cas.c > > Etc. Hmmm... feels like a good idea if extended to use propert

assignments - want a PEP

2005-03-31 Thread Kay Schluehr
>From time to time I still use my old Mathematica system. The Mathematica language has some nice properties. The one I like best is the possibility to create symbols from nothing. Translated into the Python realm following creations are possible: >>> a a That's it. Just make an 'a' as a pure symb

assignments - want a PEP

2005-03-31 Thread Kay Schluehr
>From time to time I still use my old Mathematica system. The Mathematica language has some nice properties. The one I like best is the possibility to create symbols from nothing. Translated into the Python realm following creations are possible: >>> a a That's it. Just make an 'a' as a pure symb

<    2   3   4   5   6   7   8   >