what is it
--
A Python package to parse and build CSS Cascading Style Sheets.
main changes
0.9.5a4
+ **FEATURE**: Defining a namespace with a prefix but an empty
namespaceURI is not allowed in XML 1.0 (but in XML 1.1). It is allowed
in CSS and therefor also in
On behalf of the Python development team and the Python community, I'm
happy to announce the release of Python 2.5.2 (FINAL).
This is the second bugfix release of Python 2.5. Python 2.5 is now in
bugfix-only mode; no new features are being added. According to the
release notes, over 100 bugs and
The code fragment below shows what appears to be inconsistent
behaviour. The code is testing that messages are created correctly and
that an instances of a class is created correctly. It checks that all
of the expected addresses are used (contained in addresslist) and that
all of the
On Thu, 21 Feb 2008 21:28:25 -0800, Jeff Schwab wrote:
So what is the variable? Or is Python the first HLL I've ever heard
of that didn't have variables?
Relax, Python has variables. It's just sometimes a good advice for people
coming from languages like C to forget about that term for a
Nicola Musatti a écrit :
On Feb 21, 10:55 am, Bruno Desthuilliers bruno.
[EMAIL PROTECTED] wrote:
Carl Banks a écrit :
[...]
C++ is a compile-time, type-checked language, which means it is
totally safer for newbies than Python. Yep, your big company is
totally safe with newbie C++
hello,
I wonder if anyone has (good ;-) experiences with Python on a PDA ?
And if so,
- what OS
- what GUI
thanks,
Stef Mientki
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 22, 1:41 am, Mike Driscoll [EMAIL PROTECTED] wrote:
On Feb 20, 4:19 am, Stani [EMAIL PROTECTED] wrote:
Even without python-pyexiv2 Phatch features read-only EXIF support thanks to
PIL. So you can name your files or write data stamps (date, aperature,
velocity,
...) based on EXIF
On Feb 21, 6:52 pm, Steve Holden [EMAIL PROTECTED] wrote:
mrstephengross wrote:
What you can't do (that I really miss) is have a tree of assign-and-test
expressions:
import re
pat = re.compile('some pattern')
if m = pat.match(some_string):
On Feb 21, 2:32 pm, Istvan Albert [EMAIL PROTECTED] wrote:
On Feb 18, 9:58 am, SPE- Stani'sPythonEditor
[EMAIL PROTECTED] wrote:
I'm pleased to announce the release of Phatch which is a
powerful batch processor and renamer. Phatch exposes a big part of
This program is fantastic! Very
On Feb 21, 4:57 pm, mrstephengross [EMAIL PROTECTED] wrote:
What you can't do (that I really miss) is have a tree of assign-and-test
expressions:
import re
pat = re.compile('some pattern')
if m = pat.match(some_string):
do_something(m)
Yep, this is
Jeff Schwab a écrit :
Bruno Desthuilliers wrote:
Carl Banks a écrit :
On Feb 20, 8:58 am, Tim Chase [EMAIL PROTECTED] wrote:
You Used Python to Write WHAT?
http://www.cio.com/article/185350
Furthermore, the power and expressivity that Python offers means
that it may require more skilled
Does anyone know how to get docstrings (reStructuredText) out of
python source code using docutils?
Thanks for the help.
Stephane
--
http://mail.python.org/mailman/listinfo/python-list
Stef Mientki schrieb
hello,
I wonder if anyone has (good ;-) experiences
with Python on a PDA ?
And if so,
- what OS
- what GUI
Python runs here on:
- Sharp Zaurus SL-C3100 (with the exception of Tkinter)
(Linux 2.4)
- Mio A701
(Windows Mobile)
But I only do small stuff on
Jeff Schwab [EMAIL PROTECTED] wrote:
a += b
Whether a refers to the same object before and after that statement
depends on what type of object it referred to before the statement.
Yes but the rule followed by the builtin types is pretty simple: if 'a' can
still refer to the same object
Rufman wrote:
Does anyone know how to get docstrings (reStructuredText) out of
python source code using docutils?
Depends on what you mean with get ... out of. There are tools like epydoc
that generate source code documentation, maybe that's what you mean?
Stefan
--
Carl Banks [EMAIL PROTECTED] writes:
import re
pat = re.compile('some pattern')
if m = pat.match(some_string):
do_something(m)
...
Don't be ridiculous. Assignment operators are maybe one of the worst
things in existence, but this particular use
On Thu, 21 Feb 2008 16:53:14 +0100, Kevin Walzer [EMAIL PROTECTED]
wrote:
Miki wrote:
Hello Kevin,
Tk.lift doesn't seem to work on OSX (Python 2.5.1).
If you click on the PythonLauncher application that runs in your dock
when this script is executed, the window comes into focus fine.
Carl Banks [EMAIL PROTECTED] wrote:
Some Pythonistas will swear to their grave and back that should be
done by factoring out the tests into a list and iterating over it, and
NO OTHER WAY WHATSOEVER, but I don't buy it. That's a lot of
boilerplate--the very thing Python is normally so good at
Hi,
I'm looking for a way to get a processes running time.
I know that operating systems keep track of it, but I didn't find any python
class, function,... that would give me that information :(
Any idea how I can get this information ?
regards,
Sam
Stef Mientki [EMAIL PROTECTED] wrote:
hello,
I wonder if anyone has (good ;-) experiences with Python on a PDA ?
And if so,
- what OS
- what GUI
thanks,
Stef Mientki
I haven't done much programming yet on my Nokia n810, but a lot of the
community software for it is written in
TimeHorse [EMAIL PROTECTED] wrote:
Anyway, on the one hand AmigaOS support where -128 - p = 0.0 and +127
- p = 1.0 would be a good example of why simply using a 41 point UNIX
scale is defecient in representing all possible priorities, but apart
from the support AmigaOS argument, you bring
Jeff Schwab a écrit :
[EMAIL PROTECTED] wrote:
(snip)
Explicitely using list.extend would make things clearer:
def invoke_some_fct(parent):
parent.x.extend(['world'])
Whether you use += or extend has nothing to do with it.
Mmm... Really ?
You omitted the
relevant part. Using
Not if the documentation for 2.5's got anything to say about it. If
it does, it's well hidden.
I think I'll kill the idea of using distutils for my program. It
seems like distutils was primarily designed for modules and
extensions.
Start using setuptools and pkg_resources. Then you can
James Newton [EMAIL PROTECTED] wrote:
Duncan Booth wrote:
you can create additional module instances (by calling new.module)
Hi Duncan,
Could you provide a scenario where this would be useful (and the best
practice)?
Not really as such cases are few and far between. Try grepping the
Paul Boddie wrote:
On 21 Feb, 19:22, Nicola Musatti [EMAIL PROTECTED] wrote:
[...]
The main reason why C++ has declined in usage is because it never got
the kind of corporate marketing enjoyed by Java and C#.
What? C++ was practically the favoured language for serious
applications
Nicola Musatti [EMAIL PROTECTED] writes:
In C++ memory is just another resource which you can handle just like
any other one, possibly using RAII.
Ok, I'll bite. Here's a straightforward Python expression:
a = [f(x) + g(y) for x,y in izip(m1, m2) if h(x,y).frob() == 7]
Consider how many
Nicola Musatti [EMAIL PROTECTED] writes:
The real point about garbage collection is that it's about the only
way to ensure that an object of one type is never taken to be of
another type, e.g. by keeping around pointers to the object that
occupied its memory before it was reallocated. I
On Feb 22, 9:03 am, Bruno Desthuilliers bruno.
[EMAIL PROTECTED] wrote:
Nicola Musatti a écrit :
[...]
So, yes, your big company is
likely to be safer with newbie C++ programmers than with Python newbie
programmers.
Sorry but I don't buy your arguments.
I suspect nobody seriously does,
On Feb 22, 12:24 am, Carl Banks [EMAIL PROTECTED] wrote:
On Feb 21, 1:22 pm, Nicola Musatti [EMAIL PROTECTED] wrote:
There are other downsides to garbage collection, as the fact that it
makes it harder to implement the Resource Acquisition Is
Initialization idiom, due to the lack of
On Feb 22, 1:17 am, Jeff Schwab [EMAIL PROTECTED] wrote:
[...]
If you've already got a generic, language-supported way to manage
resources (like RAII with deterministic destruction), then why bother
with garbage collection? I'm not trying to knock it; it was a big step
up from C-style who
A fascinating, well-informed discussion. Thanks to all.
Holden's suggestion re coupling and cohesion was most informative. I
conclude that whether you use an object or a global (within a module,
not across modules) is an implementation detail that has no impact on
either cohesion or coupling.
On Feb 22, 10:36 am, Stefan Behnel [EMAIL PROTECTED] wrote:
Rufman wrote:
Does anyone know how to get docstrings (reStructuredText) out of
python source code using docutils?
Depends on what you mean with get ... out of. There are tools like epydoc
that generate source code documentation,
On 22 Feb, 06:37, George Sakkis [EMAIL PROTECTED] wrote:
Paul Rubin wrote:
It just seems to me that there is a killer language just around the
corner, with Python's ease-of-use but with a serious compile-time type
system, maybe some kind of cross between ML and Python.
Could Boo or Cobra
Steven D'Aprano [EMAIL PROTECTED] wrote:
but you do keep having to use a longer reference to the value so
what have you won?
Clarity, simplicity, robustness
Clarity - why is it clearer?
Consider two function calls:
x = ham(arg, counter)
y = spam(arg)
Both do exactly
On Thu, 21 Feb 2008 16:23:23 -0800, Jeff Schwab wrote:
Steve Holden wrote:
[...]
if m = pat.match(some_string):
do_something(m)
Yep, this is exactly what I am (was) trying to do. Oh well Any
clever ideas on this front?
The syntax is the way it is precisely to
On Fri, 22 Feb 2008 08:12:56 +, Marc 'BlackJack' Rintsch wrote:
A variable in
programming languages is composed of a name, a memory location, possibly
a type and a value. In C-like languages, where you put values in named
and typed boxes, the memory location and type are attached to the
On Feb 22, 12:09 pm, Paul Rubin http://[EMAIL PROTECTED] wrote:
Nicola Musatti [EMAIL PROTECTED] writes:
The real point about garbage collection is that it's about the only
way to ensure that an object of one type is never taken to be of
another type, e.g. by keeping around pointers to the
On Feb 22, 12:07 pm, Paul Rubin http://[EMAIL PROTECTED] wrote:
Nicola Musatti [EMAIL PROTECTED] writes:
In C++ memory is just another resource which you can handle just like
any other one, possibly using RAII.
Ok, I'll bite. Here's a straightforward Python expression:
a = [f(x) +
Bruno Desthuilliers [EMAIL PROTECTED]
skrev i en meddelelse news:[EMAIL PROTECTED]
[EMAIL PROTECTED] a écrit :
So, here's the basic scheme:
- download the source tarball, preferably in /usr/local/src
- unpack it
- cd into the unpacked source directory
- *carefully* read the README,
SPE - Stani's Python Editor wrote:
[...]
great
tool, great functionality. We can surely nominate it for the
bestPythonbased tool of 2008 ... so far ;-)
Well, thanks a lot for all the compliments. Feel free to spread the
word or to get involved:
- by contributing back on the wiki
On Thu, Feb 21, 2008 at 1:20 PM, Tim van der Leeuw [EMAIL PROTECTED] wrote:
I'm looking for ways to send keypresses to another application on Windows
XP, and to set values of Windows Controls (all of them text-boxes).
Try http://pywinauto.openqa.org/.
--
Cheers,
Simon B.
[EMAIL PROTECTED]
On Fri, 22 Feb 2008 03:16:12 -0800, MartinRinehart wrote:
D'Aprano's discussion is persuasive but only in the case where you do
not want multiple actors updating a single value. In my case multiple
actors have legitimate interest in updating the value. (Actors within a
single thread,
Nicola Musatti a écrit :
On Feb 22, 9:03 am, Bruno Desthuilliers bruno.
[EMAIL PROTECTED] wrote:
Nicola Musatti a écrit :
[...]
So, yes, your big company is
likely to be safer with newbie C++ programmers than with Python newbie
programmers.
Sorry but I don't buy your arguments.
I
Hello,
as I found out, it is possible to get the output of other programs
using os.popen() and read from it. However this method is blocking for
server processes and programs that don't stop immediately. Has anyone
an idea how to get the output of such programs?
--
In article
[EMAIL PROTECTED],
Nicola Musatti [EMAIL PROTECTED] wrote:
Yet I'm convinced that even such partial guarantee is worth having.
Partial guarantees are like being a little bit pregnant.
--
http://mail.python.org/mailman/listinfo/python-list
On Feb 22, 2:39 am, SPE - Stani's Python Editor
[EMAIL PROTECTED] wrote:
On Feb 22, 1:41 am, Mike Driscoll [EMAIL PROTECTED] wrote:
On Feb 20, 4:19 am, Stani [EMAIL PROTECTED] wrote:
Even without python-pyexiv2 Phatch features read-only EXIF support thanks
to
PIL. So you can name
On Fri, 22 Feb 2008 00:45:59 -0800, Carl Banks wrote:
On Feb 21, 6:52 pm, Steve Holden [EMAIL PROTECTED] wrote:
mrstephengross wrote:
What you can't do (that I really miss) is have a tree of
assign-and-test expressions:
import re
pat = re.compile('some pattern')
self.entry00.bind('Button-1', self.leftClick(self.entry00,
0, 0)) # bind left mouse click
Difficult to say for sure due to excessive code wrapping.. ;)
but I would say that these bind methods are calling the left and right
Click methods... rather than bind'ing them to the entry
On Fri, 22 Feb 2008 12:01:20 +, tinnews wrote:
Steven D'Aprano [EMAIL PROTECTED] wrote:
but you do keep having to use a longer reference to the value
so what have you won?
Clarity, simplicity, robustness
Clarity - why is it clearer?
Consider two function calls:
x =
On Fri, 22 Feb 2008 06:48:37 -0800, mcsejung wrote:
[snipped massive bit of code]
Sorry but dumping about 900 lines of code at people with no real question
in the message body and just sort of a question in the subject won't help
much to get answers.
Just a quick look at the code tells that it
-
Name:_tkUnderWaterDemolitionRemoval.py
Purpose: The classic Under Water Demolition Removal game
Author: mcsejung
Created: 2008/02/15
RCS-ID: $Id: _tkUnderWaterDemolitionRemoval.py $
Give PyScripter from http://www.mmm-experts.com/ a try
It is for Windows, though it is written in Delphi and not in C/C++
/Jesper
zaley [EMAIL PROTECTED] skrev i en meddelelse
news:[EMAIL PROTECTED]
Of course, python scripts debugger
On 2ÔÂ22ÈÕ, ÏÂÎç3ʱ22·Ö, zaley [EMAIL PROTECTED] wrote:
My
On Fri, 22 Feb 2008 03:53:27 -0800, Rufman wrote:
On Feb 22, 10:36 am, Stefan Behnel [EMAIL PROTECTED] wrote:
Rufman wrote:
Does anyone know how to get docstrings (reStructuredText) out of
python source code using docutils?
Depends on what you mean with get ... out of. There are tools
[apologies to the list: I would have done this offline,
but I can't figure out Paul's email address.]
1) Paul please forward your email address
3) Since you seem to know about these things: I was thinking
of adding an optional feature to Nucular which would allow
a look-up like given a word find
In article [EMAIL PROTECTED],
Reedick, Andrew [EMAIL PROTECTED] wrote:
-Original Message-
From: [EMAIL PROTECTED] [mailto:python-
[EMAIL PROTECTED] On Behalf Of Carl Banks
Sent: Wednesday, February 20, 2008 8:39 PM
To: python-list@python.org
Subject: Re: Article of
On Feb 22, 3:25 pm, Roy Smith [EMAIL PROTECTED] wrote:
In article
[EMAIL PROTECTED],
Nicola Musatti [EMAIL PROTECTED] wrote:
Yet I'm convinced that even such partial guarantee is worth having.
Partial guarantees are like being a little bit pregnant.
Yes, and I'm sure your tests cover all
On Fri, 22 Feb 2008 12:32:10 +, Steven D'Aprano wrote:
On Fri, 22 Feb 2008 08:12:56 +, Marc 'BlackJack' Rintsch wrote:
A variable in programming languages is composed of a name, a memory
location, possibly a type and a value. In C-like languages, where you
put values in named and
On Feb 21, 8:58 pm, zaley [EMAIL PROTECTED] wrote:
Is there a open souce IDE writen by C( C++) or partly writen by C( C+
+)?
Eclipse is a good open source IDE for many languages including C/C++
and Python. It includes an interactive debugger.
I believe most of it is written in Java, but I'm
Hi,
Is there a document where I can find some advanced information about
python threads? I know the basic things about them and did some
practice, but when I try to advance I don't know where to go or how to go.
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 22 Feb 2008 04:48:28 -0800, Nicola Musatti wrote:
On Feb 22, 12:07 pm, Paul Rubin http://[EMAIL PROTECTED] wrote:
Nicola Musatti [EMAIL PROTECTED] writes:
In C++ memory is just another resource which you can handle just like
any other one, possibly using RAII.
Ok, I'll bite.
A colleague has decided to keep his django database string values (which are
xml
fragments) in an xml escaped form to avoid having the problem of escaping them
when they are used in templates etc etc.
Unfortunately he found that the normal admin doesn't escape on the way through
so thought of
Matthias Vogelgesang schrieb:
Hello,
as I found out, it is possible to get the output of other programs
using os.popen() and read from it. However this method is blocking for
server processes and programs that don't stop immediately. Has anyone
an idea how to get the output of such programs?
On Fri, Feb 22, 2008 at 4:56 AM, Nicola Musatti
[EMAIL PROTECTED] wrote:
On Feb 22, 12:24 am, Carl Banks [EMAIL PROTECTED] wrote:
On Feb 21, 1:22 pm, Nicola Musatti [EMAIL PROTECTED] wrote:
There are other downsides to garbage collection, as the fact that it
makes it harder to
On Feb 22, 9:58 am, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
On Fri, 22 Feb 2008 00:45:59 -0800, Carl Banks wrote:
On Feb 21, 6:52 pm, Steve Holden [EMAIL PROTECTED] wrote:
mrstephengross wrote:
What you can't do (that I really miss) is have a tree of
assign-and-test
Marc 'BlackJack' Rintsch wrote:
On Fri, 22 Feb 2008 12:32:10 +, Steven D'Aprano wrote:
On Fri, 22 Feb 2008 08:12:56 +, Marc 'BlackJack' Rintsch wrote:
A variable in programming languages is composed of a name, a memory
location, possibly a type and a value. In C-like languages,
On Fri, Feb 22, 2008 at 5:17 PM, Robin Becker [EMAIL PROTECTED] wrote:
A colleague has decided to keep his django database string values (which
are xml
fragments) in an xml escaped form to avoid having the problem of escaping
them
when they are used in templates etc etc.
Unfortunately he
On Feb 22, 12:15 am, Dennis Lee Bieber [EMAIL PROTECTED] wrote:
On Thu, 21 Feb 2008 12:34:28 -0800 (PST), [EMAIL PROTECTED]
[EMAIL PROTECTED] declaimed the following in comp.lang.python:
I'm opening up a subprocess like this where slave.py is a text based
app that receives commands and
On Feb 20, 6:06 pm, 7stud [EMAIL PROTECTED] wrote:
7stud wrote:
schweet1 wrote:
On Feb 19, 4:04�pm, 7stud [EMAIL PROTECTED] wrote:
schweet1 wrote:
Greetings,
I am attempting to use python to submit a query to the following URL:
Carl Banks wrote:
On Feb 21, 6:52 pm, Steve Holden [EMAIL PROTECTED] wrote:
mrstephengross wrote:
What you can't do (that I really miss) is have a tree of assign-and-test
expressions:
import re
pat = re.compile('some pattern')
if m = pat.match(some_string):
hyperboreean wrote:
Hi,
Is there a document where I can find some advanced information about
python threads? I know the basic things about them and did some
practice, but when I try to advance I don't know where to go or how to go.
What's your application doing? Most people are not aware
Hello Eric,
Tk.lift doesn't seem to work on OSX (Python 2.5.1).
There is a trick that sometimes works even for interpreted application:
import Tkinter as tk
root = tk.Tk()
root.withdraw()
# Code building the window...
root.lift()
root.deiconify()
root.mainloop()
This sometimes
Hi all,
I have a simple list to which I want to append another tuple if
element 0 is not found anywhere in the list.
element = ('/smsc/chp/aztec/padlib/5VT.Cat',
'/smsc/chp/aztec/padlib',
'5VT.Cat', (33060))
element1 = ('/smsc/chp/aztec/padlib/5VT.Cat2',
'/smsc/chp/aztec/padlib',
On Feb 22, 11:20 am, rh0dium [EMAIL PROTECTED] wrote:
found = False
for item in a:
if item[0] == element[0]
found = True
break
if not found:
a.append(element)
But this is just ugly - Is there a simpler way to interate over all
items in a without using a found flag?
Thanks
On Feb 22, 11:20 am, rh0dium [EMAIL PROTECTED] wrote:
Hi all,
I have a simple list to which I want to append another tuple if
element 0 is not found anywhere in the list.
element = ('/smsc/chp/aztec/padlib/5VT.Cat',
'/smsc/chp/aztec/padlib',
'5VT.Cat', (33060))
element1 =
On Feb 22, 10:20 am, rh0dium [EMAIL PROTECTED] wrote:
Hi all,
I have a simple list to which I want to append another tuple if
element 0 is not found anywhere in the list.
element = ('/smsc/chp/aztec/padlib/5VT.Cat',
'/smsc/chp/aztec/padlib',
'5VT.Cat', (33060))
element1 =
Tim van der Leeuw wrote:
On Fri, Feb 22, 2008 at 5:17 PM, Robin Becker [EMAIL PROTECTED] wrote:
A colleague has decided to keep his django database string values (which
are xml
fragments) in an xml escaped form to avoid having the problem of escaping
them
when they are used in templates
Robin Becker wrote:
Tim van der Leeuw wrote:
On Fri, Feb 22, 2008 at 5:17 PM, Robin Becker [EMAIL PROTECTED] wrote:
A colleague has decided to keep his django database string values (which
are xml
fragments) in an xml escaped form to avoid having the problem of escaping
them
when they are
Hello Matthias,
as I found out, it is possible to get the output of other programs
using os.popen() and read from it. However this method is blocking for
server processes and programs that don't stop immediately. Has anyone
an idea how to get the output of such programs?
The current official
On Feb 22, 5:13 pm, Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote:
On Fri, 22 Feb 2008 04:48:28 -0800, Nicola Musatti wrote:
[...]
As you can see the standard library takes care of all memory
management.
Aaah, that's much nicer and easier to understand than the list
comprehension.
[EMAIL PROTECTED] writes:
Tkinter definitely deserves more respect! I'm making rapid progress
and it looks good.
But am stuck on this: I want the File/Save state to change from
disabled to enabled, depending on whether or not there is something to
save (Text modified). Google returns
Steve Holden wrote:
Robin Becker wrote:
Tim van der Leeuw wrote:
On Fri, Feb 22, 2008 at 5:17 PM, Robin Becker [EMAIL PROTECTED] wrote:
A colleague has decided to keep his django database string values (which
are xml
fragments) in an xml escaped form to avoid having the problem of escaping
On Fri, 22 Feb 2008 08:19:07 -0800, Carl Banks wrote:
(The perl example wasn't using an assignment operator.)
Hmmm... I see. Obviously I didn't pretend to understand Perl well enough.
(I assume you're ignoring the assignments $name = chop(\1) etc. Fair
enough.)
[...]
I can't help but to
I am using PyArg_ParseTuple to parse the arguments (ignoring the keyword
arguments) to my initproc for a type I define.
It seems that something goes wrong inside PyArg_ParseTuple when it gets
the wrong number of arguments (my format string is OO);
if the function isn't given exactly two
Well, I will be writing the application server of a three-tier
architecture system. I will be using Twisted for the communication with
the client but from there I have to make several calls to a database and
this asks threading. The tables will be filled by another system that
gathers some
Nicola Musatti [EMAIL PROTECTED] writes:
Partial guarantees are like being a little bit pregnant.
Yes, and I'm sure your tests cover all possible paths through your code.
That is the point of type checking. With a sound type system, int x
makes sure, at compile time, that x stays an integer
est [EMAIL PROTECTED] writes:
Hi all,
I need urllib2 do perform series of HTTP requests with cookie from
PREVIOUS request(like our browsers usually do ). Many people suggest I
use some library(e.g. pycURL) instead but I guess it's good practise
for a python beginner to DIY something rather
rh0dium [EMAIL PROTECTED] writes:
found = False
for item in a:
if item[0] == element[0]
found = True
break
if not found:
a.append(element)
But this is just ugly - Is there a simpler way to interate over all
items in a without using a found flag?
Untested and I'm not sure I
Steven D'Aprano [EMAIL PROTECTED] wrote:
On Fri, 22 Feb 2008 12:01:20 +, tinnews wrote:
Steven D'Aprano [EMAIL PROTECTED] wrote:
but you do keep having to use a longer reference to the value
so what have you won?
Clarity, simplicity, robustness
Clarity - why is it
Paul Rubin http://[EMAIL PROTECTED] writes:
if any(x==element[0] for x in a):
a.append(element)
Should say:
if any(x[0]==element[0] for x in a):
a.append(element)
--
http://mail.python.org/mailman/listinfo/python-list
Hi
Suppose I have three blocks:
if 1:
if 2:
if 3:
# here I want my cursor go back to second block (if 2:)
What is the standard shortcut for this? ctrl+arrow keys aren't, arrow keys
alone aren't either.
--
Nicola Musatti [EMAIL PROTECTED] writes:
a = [f(x) + g(y) for x,y in izip(m1, m2) if h(x,y).frob() == 7]
Consider how many intermediate objects are being allocated in figuring
out that listcomp. Do you REALLY want to manage all the deallocation
with something like RAII?
What makes
In article [EMAIL PROTECTED],
Bruno Desthuilliers [EMAIL PROTECTED] wrote:
FWIW, it's IMHO a real wart - given Python's pretention at readability -
that augmented assignement has been implemented that way for lists.
This was debated extensively when augmented assignment was created, and
it was
On Feb 22, 12:54 pm, Paul Rubin http://[EMAIL PROTECTED] wrote:
Paul Rubin http://[EMAIL PROTECTED] writes:
if any(x==element[0] for x in a):
a.append(element)
Should say:
if any(x[0]==element[0] for x in a):
a.append(element)
I think you have this backwards.
In article [EMAIL PROTECTED],
Jeff Schwab [EMAIL PROTECTED] wrote:
Aahz wrote:
In article [EMAIL PROTECTED],
Jeff Schwab [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
There's nothing like a variable storing anything in Python. All you
have are names to (references to) objects binding
Carl Banks wrote:
On Feb 22, 12:23 am, Jeff Schwab [EMAIL PROTECTED] wrote:
Carl Banks wrote:
On Feb 21, 7:17 pm, Jeff Schwab [EMAIL PROTECTED] wrote:
Carl Banks wrote:
On Feb 21, 1:22 pm, Nicola Musatti [EMAIL PROTECTED] wrote:
There are other downsides to garbage collection, as the fact
George Sakkis wrote:
On Feb 22, 12:26 am, Jeff Schwab [EMAIL PROTECTED] wrote:
On the other hand, a = b does always the same thing; unlike C++, '='
is not an operator and therefore it cannot be overriden by the class
of 'a'.
Not an operator? Then what is it?
In this context, it's just
Rob Wolfe wrote:
But I think that you should read this:
http://effbot.org/zone/vroom.htm
Rob, may the gods shower you with gold coins!
--
http://mail.python.org/mailman/listinfo/python-list
Nicola Musatti wrote:
The real sad thing is that nobody is likely to convince Guido to turn
CPython into C++Python ;-)
How difficult would that be? Could it be done in stages? I would be
willing to spend some time on that kind of project. Since I know almost
nothing about Python
Here is something cool that will rock your world (ok, excuse the
slight hyperbole):
Introduction
The purpose of ILeo, or leo-ipython bridge, is being a two-way
communication
channel between Leo and IPython. The level of integration is much
deeper than
conventional integration in
Boris Ozegovic([EMAIL PROTECTED])@2008.02.22 19:59:28 +0100:
Hi
Suppose I have three blocks:
if 1:
if 2:
if 3:
# here I want my cursor go back to second block (if 2:)
What is the standard shortcut for this? ctrl+arrow keys aren't, arrow keys
alone aren't
1 - 100 of 191 matches
Mail list logo