Hi,
I think that tuples are the best and simplest approach for small
structures.
>>> songs = [("Paranoid", "http://...";), ("Christian Woman", "http://...";)]
>>> for title, url in songs:
... print "%s: %s" % (title, url)
...
Paranoid: http://...
Christian Woman: http://...
I think that python'
> I'm going to assume that it's supposed to work like this, but could
> someone tell me the reasoning behind it? I.E. why is 3 skipped?
Because:
>>> alist[2]
3
You are removing the third item, not the second.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
You might want to split your calculation onto different
worker-processes.
Then you can use POSH [1] to share data and objects.
You might even want to go a step further and share the data via
Sockets/XML-RPC or something like that. That makes it easy to throw
aditional boxes at a specific calc
Hi,
GIL won't go. You might want to read
http://blog.ianbicking.org/gil-of-doom.html .
Regards,
-Justin
--
http://mail.python.org/mailman/listinfo/python-list
I guess the python devs are not interested in implementing something
that would require new syntax and does not give something entirely new
to the language.
The good thing about python is, that the devs are only implementing
ideas that are very cool. There are a lot of cool (!= very cool) ideas
in
I want to make a registry of methods of a class during creation. My
attempt was this
""" classdecorators.py
Author: Justin Bayer
Creation Date: 2006-06-22
Copyright (c) 2006 Chess Pattern Soft,
All rights reserved. """
class decorated(object):
methods = []
@classmethod
def collect
Mind, that Lawrence's solution may contain doubles:
>>> [ i for i in permute("aa") ]
[('a', 'a'), ('a', 'a')]
If you don't want this, use sets.
--
http://mail.python.org/mailman/listinfo/python-list
> yup, you could spend weeks reading the Language Wars:
Actually, that link is not about language wars. It's about making the
switch from java to python. Nothing more, nothing less.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
If you switched from java to python the best point to start is
http://dirtsimple.org/2004/12/python-is-not-java.html.
Greets,
-Justin
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
-1 because I find it extremly hard to read and not necessary in that
scale.
Actually, there are a lot of recipes in the Cookbook [1] on how to use
decorators for type-checking. On example is:
@require(int, int)
def add(x,y): return x + y
Which I find much more readable, easier to implement
>>> print property.__doc__
property(fget=None, fset=None, fdel=None, doc=None) -> property
attribute
fget is a function to be used for getting an attribute value, and
likewise
fset is a function for setting, and fdel a function for del'ing, an
attribute. Typical use is to define a managed attribu
The problem is that you cannot represent a matrix as a tree, due to the
fact that there are more than one tree for a matrix.
First you have to decide, how you will turn the matrix into a tree.
--
http://mail.python.org/mailman/listinfo/python-list
A half-empty matrix will of course have (n+1)* n * 1/2 elements.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
> 1 2 3 4 5
> 0 7 8 9 10
> 0 0 13 14 15
> 0 0 0 19 20
> 0 0 0 0 25
> Look at the triangle represented by the non-zero
> integers. This triangle is a binary tree if we take 5
> as the root and walk down on both sides.
Are you sure? Is 9 a child of 4 or 10
> Sorry? 2+2 here returns 4, and certainly should with your Python.
Err. Never mind. I was thinking about assignments, like
>>> x += 2
which returns None.
--
http://mail.python.org/mailman/listinfo/python-list
Expressions like
>>> 2 + 2
return None, too. I am not certain, but as far as I know this has some
major design reasons. Thus I am certain, that print() will return None
also.
--
http://mail.python.org/mailman/listinfo/python-list
Mind, that XML documents are not more flexible than RDBMS.
You can represent any XML document in a RDBMS. You cannot represent any
RDBMS in an XML document. RDBMS are (strictly spoken) relations and XML
documents are trees. Relations are superior to trees, at least
mathematically speaking.
Once y
17 matches
Mail list logo