Re: C#3.0 and lambdas

2005-09-20 Thread Kay Schluehr
"case classes": http://scala.epfl.ch/intro/caseclasses.html I do think that gimmicks, syntax permutations and refusals of so called "Python warts" are not sufficient to preserve language attraction in a competing field that tries to make fast progress. Kay -- http://mail.python.org/mailman/listinfo/python-list

Lisp-likeness

2005-03-15 Thread Kay Schluehr
uido once stated that the generator way of doing things is Pythons future it was also a renouncement of lambda. Compared with this ideological orientation the introduction of the @-syntax is a minor sacrilege on syntax esthetics - though this special character may hurd the souls of the believers more that everything else introduced into the language. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Python becoming less Lisp-like

2005-03-16 Thread Kay Schluehr
else: setattr(obj,name,value) return property(get,set,None) Now an example: class X(object): a = accessor("a") b = accessor("b", types = (tuple,list)) c = accessor("c", check = lambda x:hasattr(x,"__len__")) a,b,c a

Re: Python becoming less Lisp-like

2005-03-17 Thread Kay Schluehr
g an ad-hoc typechecker which means that there is really a need and Guido is right in proposing some "type guards" allthough this hurts again a lot of souls as we can observe in this thread too. His current suggestions are either too restricted for each of the peoples requirements ( isinstance-typechecking, duck-typechecking, adaption ) or it is overly permissive and is in danger to mean everything and nothing. Not to speak about performance gains doing typechecks at runtime :-( Regards Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Why tuple with one item is no tuple

2005-03-18 Thread Kay Schluehr
ation comes from the convenience to concatenate strings in this manner in other languages and has spreaded into the domain of lists and tuples in Python. On the other hand i find Mathematicas list operators very appealing: In =: [1,2,3]^2 Out=: [1,4,9] Compared with this suggar the list comprehension [x

Re: Variable Variable

2005-03-19 Thread Kay Schluehr
t; > Any Ideas? def seq(n,cls,*args,**kw): "create a sequence of n objects of type cls." return [cls(*args,**kw) for i in range(n)] >>> a,b,c = seq(3,anyclass) >>> a.shutdown() >>> b.update() Regards Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread Kay Schluehr
g the clarity of a very fundamental data structure for speedup rather arbitrary accumulations seems to be a bad idea. I would move this stuff in a subclass. Regards Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread Kay Schluehr
gt; > accumulations seems to be a bad idea. I would move this stuff in a > > subclass. > > > > Regards Kay > +1 on this. The new suggested operations are meaningful for a subset of all > valid dicts, so they > should not be part of the base dict API. If any version

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread Kay Schluehr
*pling* ! I'm sometimes a bit slow :) Regards Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods - typing & initialising

2005-03-20 Thread Kay Schluehr
l types should be envisioned not some ad hoc solutions that go deprecated two Python releases later. Regards Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Variable Variable

2005-03-20 Thread Kay Schluehr
Personally I could live with that, but the diagram is a bit special because of the restriction of the = operation. I do not know if PHP supports this operational view by enabling iterations: $a, $$a, $$$a ... ? After all I can also live without that in Python... Regards Kay -- http://mail.python.org/mailman/listinfo/python-list

rexec and bastion

2004-12-05 Thread Kay Schluehr
may be anachronistic but I did not found much explanation, why rexec and bastion are swiss cheese? It may be helpfull to resume the problems to learn from them. Ciao Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: rexec and bastion

2004-12-05 Thread Kay Schluehr
> is google down today? > > http://www.amk.ca/python/howto/rexec/rexec.html No, I'm down today ;) Thx. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Overriding properties - Javaesque property rant

2004-12-12 Thread Kay Schluehr
t would be nice also to refuse the redundant naming a = defprop("a") and write a = defprop() instead. But it's actually not possible at the moment ( or only with deep introspection ). Session on: >>> x = X() >>> x.d 0 >>> xx = XX() >>> xx.d 0 >>> xx.d = -1 >>> xx.d 1 Ciao Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods - typing & initialising

2005-03-20 Thread Kay Schluehr
Matteo Dell'Amico wrote: > Kay Schluehr wrote: > > > Why do You set > > > > d.defaultValue(0) > > d.defaultValue(function=list) > > > > but not > > > > d.defaultValue(0) > > d.defaultValue([]) > > > > ? > > I think

Re: For loop extended syntax

2005-03-20 Thread Kay Schluehr
yperplane ) and enable to switch between different paddings. This solution is both flexible and reusable. Regards Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: For loop extended syntax

2005-03-20 Thread Kay Schluehr
ambda: [x*y-z for ((x,a=0),y,z=0) in (1,2,3), (4,5), (6,7,8)] should also be possible from an operational perspective. Regards Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: For loop extended syntax

2005-03-21 Thread Kay Schluehr
If the action of (x,y,z=0) on a tuple is regarded as a function call why not letting resolve it by the compiler in an appropriate manner? The tuple assignment is just a special case of this and can be resolved in a different way. There would be no slowdown at all. Regards Kay -- http://mai

Anonymus functions revisited

2005-03-21 Thread Kay Schluehr
idea: Mappings like that: ((x,y),z) -> x+y-z ((x,y=0),z) -> None should be valid actions too. What is the audience thinking about that? Regards Kay -- http://mail.python.org/mailman/listinfo/python-list

Anonymus functions revisited

2005-03-21 Thread Kay Schluehr
idea: Mappings like that: ((x,y),z) -> x+y-z ((x,y=0),z) -> None should be valid actions too. What is the audience thinking about that? Regards Kay -- http://mail.python.org/mailman/listinfo/python-list

Anonymus functions revisited : tuple actions

2005-03-22 Thread Kay Schluehr
) Maybe Guidos aversion against FP is bit misguided too because it is actually in the language but hidden as special rules. Regards Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Anonymus functions revisited

2005-03-23 Thread Kay Schluehr
ithin a Python dict. If a variable is created as a global it will be stored using the STORE_NAME opcode instead: case STORE_NAME: w = GETITEM(names, oparg); v = POP(); if ((x = f->f_locals) != NULL) { if (PyDict_CheckExact(x)) err = PyDict_SetItem(x, w, v);

Re: setattr inside a module

2005-03-23 Thread Kay Schluehr
pass to setattr as first argument? > > Thanks a lot for your time. > Marco. ??? Why don't You create 'name' and 'value' as module scoped variables just by defining them? If You want to introspect the module within the module, just define # defined within spam d

Re: Anonymus functions revisited

2005-03-23 Thread Kay Schluehr
except NameError: print "Before makeVars: NameError" else: print "Before makeVars: Not NameError" makeVars(b=2) try: b except NameError: print "After makeVars: NameError" else: print "After makeVars: Not NameError" inner

Re: Anonymus functions revisited : tuple actions

2005-03-24 Thread Kay Schluehr
Ron wrote: > On Wed, 23 Mar 2005 06:21:30 +0100, Kay Schluehr <[EMAIL PROTECTED]> > wrote: > > >I think my proposal was more in mind of Rons modified exec than > >Pythons lambda. > > > >When George proposed his unpacking behavoir for list-comps as a pack of &

Re: Anonymus functions revisited : tuple actions

2005-03-24 Thread Kay Schluehr
Ron_Adam wrote: > On 24 Mar 2005 01:58:48 -0800, "Kay Schluehr" <[EMAIL PROTECTED]> > wrote: > > >I personally don't like using exec and eval for stuff different from > >evaluating user input. > > I lean the other way. I never want to use user imp

assignments - want a PEP

2005-03-31 Thread Kay Schluehr
could think about introduction of a new assignment ":=" that is connected to the __assign__ method of custom classes if available. What do You think? Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

assignments - want a PEP

2005-03-31 Thread Kay Schluehr
could think about introduction of a new assignment ":=" that is connected to the __assign__ method of custom classes if available. What do You think? Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: assignments - want a PEP

2005-03-31 Thread Kay Schluehr
+ _.b a+b Regarding that an object oriented CAS will mix an arbitray number of algebras/namespaces that use algebraic operators homogenously referencing namespaces is a reasonable for providing clarity. A helpfull suggestion. Thanks Bengt! Regards, Kay Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Our Luxurious, Rubinesque, Python 2.4

2005-04-01 Thread Kay Schluehr
ythons config.c file You can determine which ext-modules will be compiled into the core. I estimate that a lean core would have a size around ~600kb. Trimming down further may become hard because You may have to decide what to sacrifice: tuples, classes or objects ;) Regards, Kay -- http://mai

Some notes about float approximations in mxNumber

2005-04-01 Thread Kay Schluehr
5623730951 >>> float2ratio(math.sqrt(2)) 1393/985 >>> 1393./985 1.4142131979695431 ^ >>> float2ratio(math.sqrt(2),10**-10) 275807/195025 >>> 275807./195025 1.4142135623637995 ^ >>> math.pi 3.1415926535897931 >>> floa

Re: Docorator Disected

2005-04-02 Thread Kay Schluehr
),'mul_dec') def mul(m1,m2): def default(m1,m2): return "default",1+m1*m2 def mul_dec(m1,m2): return "mul_dec",Decimal(str(m1))*Decimal(str(m2)) def mul_float(m1,m2): return "mul_float",m1*m2 return (default,mul_dec,mul_float) Can You imagine how "case" works internally? Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

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

2005-04-05 Thread Kay Schluehr
- and postprocessing the pattern has only limited use and worse it suggests a misnomer: it obscures the semantics that is clearly functional/OO not procedural. Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorator Base Class: Needs improvement.

2005-04-05 Thread Kay Schluehr
or(1,2) def f():pass >>> f 3 This is perfectly valid allthough not very usefull ;) Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorator Base Class: Needs improvement.

2005-04-05 Thread Kay Schluehr
allegoric meaning of the decorator def deco(f): pass would be: f is "vanishing under decoration" - all is vanity. In the example deco would be both a decorator and a decoration. In other examples deco were a decorator and deco(x,y) the decoration. Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorator Base Class: Needs improvement.

2005-04-05 Thread Kay Schluehr
allegoric meaning of the decorator def deco(f): pass would be: f is "vanishing under decoration" - all is vanity. In the example deco would be both a decorator and a decoration. In other cases deco were a decorator and deco(x,y) the decoration. Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Puzzling OO design problem

2005-04-09 Thread Kay Schluehr
) [, ] >>> cg.classes["C"].__subclasses__() [] >>> cg.classes["D"].__subclasses__() [, ] >>> cg.classes["F"].__subclasses__() [] >>> cg.classes["G"].__subclasses__() [] >>> cg.classes["H"].__subclasses__() [] >>> cg.classes["I"].__subclasses__() [] Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on some stdlib modules

2005-04-10 Thread Kay Schluehr
module. Different people seem to share similar ideas and claim about inconveniencies. I use the path-module by myself for a year. This indicates that there is something wrong or missing in the std-library. Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on some stdlib modules

2005-04-10 Thread Kay Schluehr
ld have a great overall impact on the std-lib. Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on some stdlib modules

2005-04-10 Thread Kay Schluehr
oth the slow javaesque W3C-DOM parser implementation and the statemachine oriented SAX. But has this module some place in the standard-lib. No, because it promotes double implementation i.e. not only one way to do it. And throwing away old stuff is impossible because downwards incompatibilities.

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
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.pyt

Behavioural identity - a short discussion

2005-04-10 Thread Kay Schluehr
haslocal: yield co.co_varnames[oparg] elif op in hascompare: yield cmp_op[oparg] elif op in hasfree: if free is None: free = co.co_cellvars + co.co_freevars yield free[oparg] >>> list(distrace

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

Re: pre-PEP: Simple Thunks

2005-04-16 Thread Kay Schluehr
n. I thinks the place for such ideas are Michael Hudsons famous bytecodehacks. -1 for from me for thunks in Python. Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

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

2005-04-16 Thread Kay Schluehr
def get_x(): return self.__x def set_x(value): self.__x = value del_x = None doc = "I'm the 'x' property." - as func(*args,**kw): Anoymus functions. Replacement for lambda. Support for arbirtra

Re: pre-PEP: Suite-Based Keywords

2005-04-16 Thread Kay Schluehr
examples below we can identifiy the expression belonging to f without ambiguities and restrictions. f(y=0,..) .. x = 1 if f(y=2,..) == 1: .. x = 5 def g(a): a**2-1 return 8 Note that the colon after f has vanished as expected for a call. Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

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

2005-04-16 Thread Kay Schluehr
ifiers. Introducing '::' would make the "folding definitions into dict" operation visible that takes place in the machinery of the VM. Very Pythonic IMHO :-) +1 from me for '::' and 'where'. Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

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

2005-04-16 Thread Kay Schluehr
roperty." ) This statement would not work if the result of '::' ( considered as an "ordered dict" ) would return simply a dict because the order of the input parameters matters. Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP: Simple Thunks

2005-04-17 Thread Kay Schluehr
ncies. This is the reason why those macros are harmfull and should be abandoned from high level languages ( using them in C is reasonable because code expansion can be time efficient and it is also a way to deal with parametric polymorphism but Python won't benefit from either of this issues ).

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

2005-04-17 Thread Kay Schluehr
;x' property." Nest suites: x = property(*args) where args: t = tuple(*t) where t: def fget(self): return self.__x fset = None fdel = None doc = "I'm the 'x' property." Evaluate conditions:

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

2005-04-17 Thread Kay Schluehr
sefull little wrapper I found eventually on the "Vaults of Parnassus" which is called reverb.py Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

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: pre-PEP: Suite-Based Keywords - syntax proposal

2005-04-17 Thread Kay Schluehr
return self.__x because there is no rule to match doc and fget onto a and b. In this case we would need specifiers: x = property(a, b) where **a: doc = "I'm the 'x' property." where **b: def fget(self): return self.__x Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

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

2005-04-19 Thread Kay Schluehr
my last proposal I finally distilled from our discussion would pretty much fullfill all three requirements whereas that of Andrey Tatarinov would be somewhat more restrictive and fullfills only the first two. Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Variables

2005-04-24 Thread Kay Schluehr
main object. Since each expression is an object You can drop "object" from C-like definitions object x = 8 and reduce it to x = 8 To become more precise You have to do workarounds. Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Injecting code into a function

2005-04-25 Thread Kay Schluehr
ocals(self, func,*args,**kw): sys.settrace(self.trace_returns) func(*args,**kw) sys.settrace(None) Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Injecting code into a function

2005-04-25 Thread Kay Schluehr
turn self.dispatch_call(frame, arg) if event == 'return': return self.dispatch_return(frame, arg) if event == 'exception': return self.dispatch_exception(frame, arg) print 'bdb.Bdb.dispatch: unknown debugging event:', `event` return self.trace_dispatch Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Injecting code into a function

2005-04-26 Thread Kay Schluehr
had not yet the time to analyze the output of the following function but it returns stable values: def gettracefunc(): import sys i = 0 while 1: try: f_trace = sys._getframe(i).f_trace if f_trace: return f_trace i+=1 except ValueError: break Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Injecting code into a function

2005-04-26 Thread Kay Schluehr
istian Tismer is important: http://mail.python.org/pipermail/python-announce-list/2004-July/003280.html Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

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: New Python website

2005-04-30 Thread Kay Schluehr
I was younger I found anarchy cool. Now I find it grey. Ciao, Kay -- http://mail.python.org/mailman/listinfo/python-list

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 a

Re: Haskell Typeclasses

2005-12-15 Thread Kay Schluehr
7;t see why your typeclass illustration does not apply to ABCs as well? The sanity checks for typeclasses you describe seem to be a particular feature of Haskell or other pure functional languages without destructive updates and messy aliasing problems. It's hardly believable that this would be possible in Python and runtime checks won't help much in this case. By the way I also don't understand Guidos concerns. Maybe he is against the whole idea of creating frameworks and partial implementations? It's not very clear for what reasons he likes interfaces. Kay -- http://mail.python.org/mailman/listinfo/python-list

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

2005-12-15 Thread Kay Schluehr
tion. It wouldn't be a Zen aspect if there is not the language itself is speeking. In the end everything is open to interpretation, but interpretation is itself a "glue code". But why unique? I don't know. Maybe because there are only three numbers: one, two and many. Perl is ma

Re: Haskell Typeclasses

2005-12-15 Thread Kay Schluehr
he checker can guarantee detection of a few obvious cycles where dependencies can be tracked also syntactically, at least in principle like in your example, what exactly is ensured by the checker and how can the definition of a typeclass be adapted accordingly? Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: What is unique about Python?

2005-12-19 Thread Kay Schluehr
eclecticism can be done right. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: ANNOUNCE; Try python beta

2005-12-20 Thread Kay Schluehr
m/try_python/python.sbox?%201+2 etc. The interesting issue is the provided link. Copying the HTML output into a file and executing it opens a file transfer connection. The result is as expected: python.sbox It contains the correct result: it is 3 :) Kay -- http://mail.python.org/mailman/listinfo/python-list

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 o

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 import * > >> > >> in all of the files (namespaces) where it is needed. > > > > Except

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

2006-01-03 Thread Kay Schluehr
rrespondences between parts of the whole pattern. The aspects in an AOP program are the implicite order of a program that is weaved by aspects. The spiritual meaning is that of the gnostic believe in a transcentendal order that pervades existing being but is nevertheless hidden. Its relationship is less close to time as it is to space. The implicate order is of course state- and timeless. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Microsoft IronPython?

2006-01-04 Thread Kay Schluehr
e till the end of time only because IP needs them. Is that what the Python community really wants? Kay -- http://mail.python.org/mailman/listinfo/python-list

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

Being unjust

2006-01-18 Thread Kay Schluehr
actually believe in one single best solution. It's more a symbolic action of bundling forces and attention. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Being unjust

2006-01-18 Thread Kay Schluehr
ts should be combined to the next 600 Python webframeworks but that there is a clear recommendation in particular for beginners in Python. By the way I would also bundle SQLite although it is not the most fancy DB. It is sufficient for small apps, easy to handle and easy to describe. I

Efficient implementation of deeply nested lists

2006-01-19 Thread Kay Schluehr
x a new instance of L is needed so that we actually have a function: L = lambda x: [a1, [a2, [[aN, [x]]...]] I'm seeking for an efficient implementation that does not recompute the whole list each time. Any ideas? Kay -- http://mail.python.org/mailman/listinfo/python-list

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, becaus

Decimal vs float

2006-01-19 Thread Kay Schluehr
s at most a warning caused by possible rounding errors of float. Instead of dealing with awkward wrappers, I wonder if literals currently interpreted as floats could not be interpreted as Decimal objects in future? Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Decimal vs float

2006-01-19 Thread Kay Schluehr
a big obstacle. With the current implementation the compiler has to generate a decimal object from a NUMBER token instead of a float object. The context of a calculation is still the decimal module object and it's attributes. Why should it be changed? Kay -- http://mail.python.org/mailman/listinfo/python-list

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

Re: Python on an embedded platform

2006-01-19 Thread Kay Schluehr
restricted subset of Python ( called RPython ) to translate type annotated RPython flowgraphs to several backends including Java. Therefore it seems not necessary to write a new Jython compiler or CPython runtime. JVMs are all around also for ARM processors. Kay -- http://mail.python.org/mailman/listinfo/python-list

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 goo

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 va

Re: Decimal vs float

2006-01-20 Thread Kay Schluehr
the time, does it really help > to point out that the float representing 0.100...01 is an exact rational > -- especially without mentioning that it happens to be the *wrong* exact > rational? I concur and I wonder why CAS like e.g. Maple that represent floating point numbers using two in

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

Re: Some thougts on cartesian products

2006-01-22 Thread Kay Schluehr
objects of equal size. It could be extended to distribute(*args[,default]) by a single default argument that is inserted in the distribution table when two listlike objects have not the same size. Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Partial classes

2006-07-18 Thread Kay Schluehr
Sanjay wrote: > Hi All, > > Not being able to figure out how are partial classes coded in Python. > > Example: Suppose I have a code generator which generates part of a > business class, where as the custome part is to be written by me. In > ruby (or C#), I divide the code into two source files. L

Re: Partial classes

2006-07-19 Thread Kay Schluehr
Bruno Desthuilliers wrote: > Sanjay wrote: > > Hi Alex, > > > > Thanks for the input. > > > > Being new to Python, and after having selected Python in comparison to > > ruby (Turbogears vs Rails) , is jerks me a bit. In my openion it should > > be an obvious and easy to implement feature and must

Re: Partial classes

2006-07-19 Thread Kay Schluehr
[EMAIL PROTECTED] wrote: > Sanjay wrote: > > Hi All, > > > > Not being able to figure out how are partial classes coded in Python. > > > > Example: Suppose I have a code generator which generates part of a > > business class, where as the custome part is to be written by me. In > > ruby (or C#), I

Re: Partial classes

2006-07-19 Thread Kay Schluehr
John Salerno wrote: > Marc 'BlackJack' Rintsch wrote: > > > Can you flesh out your use case a little bit and tell why you can't solve > > the problem with inheritance or a meta class? > > From my experience with C#, the only real use for partial classes is > when you want to separate your GUI cod

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Kay Schluehr
Ray wrote: > David Cook wrote: > > On 2006-07-24, Sybren Stuvel <[EMAIL PROTECTED]> wrote: > > > > > Jython isn't up to par with current Python versions either. > > > > But the last release is up to the level of C-Python 2.2 or so. I don't > > really feel like I'm missing that much with it. > > Yo

Re: Need a compelling argument to use Django instead of Rails

2006-07-26 Thread Kay Schluehr
Ray wrote: > > But you can't compile a Python module into a dotNet library that is > > used from C# which is the very essence of the CLR. IronPython is not > > more usefull than PythonNet. > > At least for my case I will use IronPython for higher level task, and > perhaps calls libraries written i

Re: Need a compelling argument to use Django instead of Rails

2006-07-27 Thread Kay Schluehr
Jaroslaw Zabiello wrote: > Of course, I you like, you can freeze every object you want and nobody can > be able to open and change it. You can also trace all activity for changing > something to objects because Ruby has nice system hooks implemented. Ruby > has nice security system (private, prote

Re: Need a compelling argument to use Django instead of Rails

2006-07-27 Thread Kay Schluehr
Bruno Desthuilliers wrote: > >>Care to write an external DSL in Ruby ? > > I mean : write a parser and interpreter for a DSL. In Ruby. It is this kind of stuff Rubys talk about when they mention "DSLs in Ruby": http://www.artima.com/rubycs/articles/ruby_as_dsl.html -- http://mail.python.org/m

Protection levels in Python

2006-07-27 Thread Kay Schluehr
" attributes have to be declared explicitely: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496920 Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Attribute protection the 2nd

2006-08-02 Thread Kay Schluehr
A new recipe for attribute protection which is aligned with Pythons convention of privacy indication using underscore name mangling. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496930 Regards, Kay -- http://mail.python.org/mailman/listinfo/python-list

Re: Class definition within function

2006-08-02 Thread Kay Schluehr
Tomi Lindberg wrote: > Hi, > > With the following function definition, is it possible to > create an instance of class C outside the function f (and if > it is, how)? def f(): class C(object): def __init__(self): self.a = 'a' f.C = C return C() >>> f.C >

Snake is eating itself

2006-08-02 Thread Kay Schluehr
Diez B. Roggisch wrote: > Kay Schluehr wrote: > > > > > Tomi Lindberg wrote: > >> Hi, > >> > >> With the following function definition, is it possible to > >> create an instance of class C outside the function f (and if > >> it is,

Re: Are there any AOP project in python community?

2006-08-02 Thread Kay Schluehr
steve wrote: > I mean Aspect-Oriented Programming. > If any please give me some of links. > Thanks a lot. http://www.google.de/search?hl=de&q=python+%2B+AOP&btnG=Google-Suche&meta= -- http://mail.python.org/mailman/listinfo/python-list

Re: programming with Python 3000 in mind

2006-08-15 Thread Kay Schluehr
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > The current beta version of Python is 2.5 . How can a Python programmer > > minimize the number of changes that will be needed to run his code in > > Python 3000? > > by ignoring it, until it exists. > > And why not ignoring it, when it come

<    1   2   3   4   5   6   7   8   >