Steven D'Aprano wrote:
On Sat, 25 Jun 2005 21:30:26 +0200, Peter Otten wrote:
Mandus wrote:
By using the builtin reduce, I
move the for-loop into the c-code which performs better.
No. There is no hope of ever writing fast code when you do not actually
measure its performance.
Good
To recognize variables that you have assigned, just look for
assignment. If your code is readible, and you know it well, you
shouldn't need the $ sign in front of everything.
--
http://mail.python.org/mailman/listinfo/python-list
Philippe C. Martin wrote:
Any clue would be quite welcome.
I didn't recognize the pattern in the code you posted, but sometimes the
order of imports matters:
$ find .
.
./package
./package/beta.py
./package/alpha.py
./package/__init__.py
$ python
Python 2.3.3 (#1, Feb 5 2005, 16:22:10)
[GCC
On Sun, 26 Jun 2005 01:06:08 -0400, Matt Hollingsworth wrote
(in article [EMAIL PROTECTED]):
Hello,
Very new to python, so a noob question. When I've written stuff in
JavaScript or MEL in the past, I've always adopted the variable naming
convention of using a $ as the first character
Steven D'Aprano wrote:
On Thu, 16 Jun 2005 21:21:50 +0300, Konstantin Veretennicov wrote:
On 6/16/05, Vibha Tripathi [EMAIL PROTECTED] wrote:
I need sets as sets in mathematics:
That's tough. First of all, mathematical sets can be infinite. It's
just too much memory :)
Software
[Tony Meyer]
I have (unfortunately) a Python program that I can
consistently (in a reproducible way) segfault.
[Tim Peters]
The _best_ thing to do next is to rebuild Python, and as many other
packages as possible, in debug mode.
[...]
It's especially useful to rebuild Python that way. Many
James Dennett said unto the world upon 26/06/2005 03:51:
Steven D'Aprano wrote:
On Thu, 16 Jun 2005 21:21:50 +0300, Konstantin Veretennicov wrote:
On 6/16/05, Vibha Tripathi [EMAIL PROTECTED] wrote:
I need sets as sets in mathematics:
That's tough. First of all, mathematical sets can be
On 25 Jun 2005 12:17:20 -0700, George Sakkis [EMAIL PROTECTED] wrote:
If they go to itertools, they can simply be:
def map(f, *iterables):
return list(imap(f,*iterables))
def filter(f, seq):
return list(ifilter(f,seq))
from itertools import ifilter
def filter(f, seq):
...
Hi Matt,
I also am almost a newbie (in Python) and my approach to variable
naming
follows more or less the Hungarian Type Notation Defined.
To better explain, I use one char or two (in small case) as a prefix of
the name of
the variable (starting in capital letters).
The prefix identifies the type
On Sat, 25 Jun 2005 22:06:08 -0700, Matt Hollingsworth wrote:
Hello,
Very new to python, so a noob question. When I've written stuff in
JavaScript or MEL in the past, I've always adopted the variable naming
convention of using a $ as the first character (no, I don't use perl,
never
Hello,
I would like to access object parameter / variable from a function.
For example :
class A:
def __init__(self, x,y):
self.x = x
self.y = y
in the main program, I have a list of obj A:
L = [A(1,2), A(2,3)]
Now I need to access the value of x or y from a function:
def
On Sunday 26 June 2005 05:39 am, Torsten Bronger wrote:
Hallöchen!
However, then you must forbid a=b=1 for assigning to two variables
at the same time.
Why? It's already handled as an exception in the syntax.
In C, what you say makes sense, because b=1 is an expression as
well as an
[EMAIL PROTECTED] wrote:
Hello,
I would like to access object parameter / variable from a function.
For example :
class A:
def __init__(self, x,y):
self.x = x
self.y = y
in the main program, I have a list of obj A:
L = [A(1,2), A(2,3)]
Now I need to access the value
Terry Hancock wrote:
On Sunday 26 June 2005 05:39 am, Torsten Bronger wrote:
Hallöchen!
However, then you must forbid a=b=1 for assigning to two variables
at the same time.
Why? It's already handled as an exception in the syntax.
In C, what you say makes sense, because b=1 is an
On 6/26/05, Matt Hollingsworth [EMAIL PROTECTED] wrote:
Seems like an _extremely_ elegent language that is very easy to read, so
I suppose it's not really as much of an issue as it is with other
languages. Still, I would like to see what other people do and what are
some good ideas for this
On Sat, 25 Jun 2005 23:49:40 -0600, John Roth wrote:
What's being ignored is that type information is useful for other
things than compile type checking. The major case in point is the way
IDEs such as IntelliJ and Eclipse use type information to do
refactoring, code completion and eventually
Hi,
I've posted thisbefore but the answer given
made use of twisted functions that do not work on windows, so i'm forced to
repost.
Basically, is there a way to have a thread running
on the background thatover rulesthe raw_input function?
The example I'm working on is something like having
Steven D'Aprano [EMAIL PROTECTED] wrote:
Using := and = for assignment and equality is precisely as stupid as using
= and == for assignment and equality.
On the other hand, == is easier to type than := (two taps on the same key
vs two different keys, and at least on a US/English keyboard, no
Konstantin Veretennicov [EMAIL PROTECTED] wrote:
On 25 Jun 2005 12:17:20 -0700, George Sakkis [EMAIL PROTECTED] wrote:
If they go to itertools, they can simply be:
def map(f, *iterables):
return list(imap(f,*iterables))
def filter(f, seq):
return list(ifilter(f,seq))
Patrick Maupin wrote:
Dennis Bieber wrote:
Off hand, I'd consider the non-binary nature to be because the
internet protocols are mostly designed for text, not binary.
A document at http://www.w3.org/TR/REC-xml/ lists the design goals for
XML.
One of the listed goals is XML documents should be
thanks Diez
pujo
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano [EMAIL PROTECTED] wrote:
You are welcome to change the specifications of findall() and turn it into
an iterator which returns each match one at a time instead of all at once,
but then the name is misleading, wouldn't you agree?
The regex module has since 2.2 a function (and
Konstantin Veretennicov [EMAIL PROTECTED] wrote:
On 6/26/05, Matt Hollingsworth [EMAIL PROTECTED] wrote:
Seems like an _extremely_ elegent language that is very easy to read, so
I suppose it's not really as much of an issue as it is with other
languages. Still, I would like to see what
Hello,
Does anybody have how-to's or good enough detail documentation for
cx_Oracle module?
Thanks
Sameer
--
http://mail.python.org/mailman/listinfo/python-list
My French is mostly read-only, so let me rephrase:
Thank you :-)
from module import *, try ... except, eval(), exec all work together to
make your program harder to understand and more likely to fail in obscure
ways.
What would you suggest then, I just want my code to
1) be sturdy
2) some of
On Wed, 8 Jun 2005 09:49:51 -0600, Ara.T.Howard [EMAIL PROTECTED] wrote:
hi-
i know nada about python so please forgive me if this is way off base. i'm
trying to fix a bug in MoinMoin whereby
WordsWithTwoCapsInARowLike
^^
^^
^^
Dave Benjamin wrote:
...
I think Python's decision to use reference counting was an instance of
worse-is-better: at the time, reference counting was already known not to be
the right thing, but it worked, and the implementation was simple.
Likewise with dynamic typing versus type inference.
I'm curious -- what is everyone's favorite trick from a non-python
language? And -- why isn't it in Python?
Hmm... I used to be quite the fan of Python, yet not long ago I met
Ruby and fell in love almost instantly. Some of the features I like the
most:
- statement modifiers:
return a if
return a if a.value == true
database.query(q) unless database.connect == error
(etc)
if a.value == True:
return a
if not database.connect == error:
database.query(q)
Trading two words for one word doesn't necessarily make the code
better.
unless false then print 1 # this prints 1
I went to My Computer | Properties | Advanced | Environment Variables
and added c:\program files\python24 to both the PYTHONPATH and Path
variables. Still no luck. I don't know whether the path I'm talking
about is the same as the $PATH you referred to, or whether I'm supposed
to put python.exe
On Thu, 9 Jun 2005 18:12:35 -0500, Skip Montanaro [EMAIL PROTECTED] wrote:
PEP 304 would have helped, but it appears to be deceased.
Just resting...
FWIW, I reapplied it to my cvs sandbox the other day and plan to at least
generate a new patch from that. It's pretty much done,
On Fri, 10 Jun 2005 16:46:32 +0200, Diez B. Roggisch [EMAIL PROTECTED]
wrote:
M1st0 wrote:
Ops yes is BNF :P Bacus Normal Form if I am not wrong...
However..
I'am tryng to recognizing patterns in a bytecoded file in orderd to
optimize...
But I would like to parse i.e reconstruct
On 12 Jun 2005 08:06:18 -0700, George Sakkis [EMAIL PROTECTED] wrote:
Jorgen Grahn wrote:
I have a set of tests in different modules: test_foo.py, test_bar.py and so
on. All of these use the simplest possible internal layout: a number of
classes containing test*() methods, and the good old
Jorgen Grahn wrote:
What's the best way of creating a test.py which
- aggregates the tests from all the test_*.py modules?
You might want to check out the test runner in Zope 3
(svn://svn.zope.org/repos/main/Zope3/trunk/src/zope/app/testing)
It aggregates test reporting, does code coverage,
On Sun, 12 Jun 2005 16:49:57 -0500, Skip Montanaro [EMAIL PROTECTED] wrote:
Neville # I was expecting a slice of an index file to yield a
Neville # generator so not all the records need to be read from disk
Slicing is a feature of sequence types, not mapping types.
import
Lee C -
Here is a technique for avoiding the if-elseif-elseif...-else method
for building objects. It is a modified form of ChainOfResponsibility
pattern, in which you have a collection of factory methods that all
have a common signature, or a collection of Factory classes that all
implement a
Bengt Richter [EMAIL PROTECTED] wrote:
On 12 Jun 2005 08:06:18 -0700, George Sakkis [EMAIL PROTECTED] wrote:
I had written a script to do something close to this; currently it
doesn't do any kind of aggregation, but it should be easy to extend it
as you like. What I don't like is the way it
Jorgen Grahn wrote:
I have a set of tests in different modules: test_foo.py,
test_bar.py and so on. All of these use the simplest
possible internal layout: a number of classes containing
test*() methods, and the good old lines at the end:
if __name__ == __main__:
unittest.main()
You can find that here:
http://starship.python.net/crew/atuining/cx_Oracle/html/contents.html
--
http://mail.python.org/mailman/listinfo/python-list
Paul McGuire [EMAIL PROTECTED] wrote:
Lee C -
Here is a technique for avoiding the if-elseif-elseif...-else method
for building objects. It is a modified form of ChainOfResponsibility
pattern, in which you have a collection of factory methods that all
have a common signature, or a
On Sun, 26 Jun 2005 14:30:15 +1000, Steven D'Aprano [EMAIL PROTECTED] wrote:
On Sat, 25 Jun 2005 23:08:10 +, Bengt Richter wrote:
[...]
The single line replacing
with colour do begin
red := 0; blue := 255; green := 0;
end;
follows:
On Sun, 26 Jun 2005 14:36:42 +1000, Steven D'Aprano [EMAIL PROTECTED] wrote:
On Sat, 25 Jun 2005 23:08:10 +, Bengt Richter wrote:
Using := and = for assignment and equality is precisely as stupid as using
= and == for assignment and equality. Perhaps less stupid: why do we use
== for equals,
I'm posting this message for 2 reasons.
First, I'm still pretty new and shakey to the whole Acceptance Testing thing,
and I'm hoping for some feedback on whether I'm on the right track. Second,
although all the Agile literature talks about the importance of doing
Acceptance Testing, there's very
Steve Jorgensen wrote:
I'm posting this message for 2 reasons.
First, I'm still pretty new and shakey to the whole Acceptance Testing thing,
and I'm hoping for some feedback on whether I'm on the right track. Second,
although all the Agile literature talks about the importance of doing
Andrew McDonagh [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Steve Jorgensen wrote:
I'm posting this message for 2 reasons.
First, I'm still pretty new and shakey to the whole Acceptance Testing
thing,
and I'm hoping for some feedback on whether I'm on the right track.
On Sun, 26 Jun 2005 17:58:11 -0400, George Sakkis wrote
(in article [EMAIL PROTECTED]):
Paul McGuire [EMAIL PROTECTED] wrote:
Lee C -
Here is a technique for avoiding the if-elseif-elseif...-else method
for building objects. It is a modified form of ChainOfResponsibility
pattern, in
I am investigating converting a wiki site to plone. I am having
a lot of difficulty finding good documentation programmatically
accessing the ZODB API.
A lot of the user feedback is centered on how difficult it is to
get good documentation on developing using these technologies. My
question to
Robert Brewer [EMAIL PROTECTED] wrote:
Anyway, use normal os.walk() calls to gather the files which start with
test_; then use the TestLoader.loadTestsFromName method to instruct
unittest to test them as a group.
Hi Robert,
this makes much more sense; os.walk and TestLoader.loadTestsFromName
Hi,
I was refering to the Windows $PATH which you can modify in the same dialog.
To make sure it's done properly, open a console (cmd.exe) and type python
Regards,
Philippe
Rex Eastbourne wrote:
I went to My Computer | Properties | Advanced | Environment Variables
and added c:\program
Steve Jorgensen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Note how the powerful, context-aware exec() and eval() procedures really
help
simplify the code.
A stylistic note: I believe that most or all of your eval/exec uses could
be done with getattr and setattr instead,
What's being ignored is that type information is useful for other things
than compile type checking. The major case in point is the way IDEs
such as IntelliJ and Eclipse use type information to do refactoring, code
completion and eventually numerous other things. A Java programmer
using IntelliJ
On Sun, 26 Jun 2005 22:42:40 -0400, Terry Reedy [EMAIL PROTECTED] wrote:
Steve Jorgensen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Note how the powerful, context-aware exec() and eval() procedures really
help
simplify the code.
A stylistic note: I believe that most or all
Ok, I'm glad you guys liked that design pattern. Here are a few
additional footnotes:
1. As George mentions, the order of the converters is *very* important,
especially in this particular case. One might question whether '1+0j'
would convert to a complex or an int - my first thought was to make
On Sunday 26 June 2005 06:34 pm, Avery Warren wrote:
I am investigating converting a wiki site to plone. I am having
a lot of difficulty finding good documentation programmatically
accessing the ZODB API.
Well, it's really pretty straightforward to use, but you should be
able to find
On Sunday 26 June 2005 06:11 am, Robert Kern wrote:
Terry Hancock wrote:
On Sunday 26 June 2005 05:39 am, Torsten Bronger wrote:
However, then you must forbid a=b=1 for assigning to two variables
at the same time.
You need to differentiate
a = b = 1
from
a = b == 1
Okay, I see
Terry Hancock wrote:
On Sunday 26 June 2005 06:11 am, Robert Kern wrote:
Terry Hancock wrote:
On Sunday 26 June 2005 05:39 am, Torsten Bronger wrote:
However, then you must forbid a=b=1 for assigning to two variables
at the same time.
You need to differentiate
a = b = 1
from
a = b == 1
Hello everyone,
I want to convert a tuple to a list, and I expected this behavior:
list(('abc','def')) - ['abc','def']
list(('abc')) - ['abc']
But Python gave me this behavior:
list(('abc','def')) - ['abc','def']
list(('abc')) - ['a','b','c']
How do I do get Python to work like the in former
On Sunday 26 June 2005 10:57 pm, Stephen Boulet wrote:
Is there a python solution that someone could recommend for the following:
I'd like to take a directory of photos and create a pdf document with
four photos sized to fit on each (landscape) page.
Probably you could do this with PIL +
('abc') is not a tuple - this is an unfortunate result of using ()'s as
expression grouping *and* as tuple delimiters. To make ('abc') a
tuple, you must add an extra comma, as ('abc',).
list( ('abc',) )
['abc']
-- Paul
--
http://mail.python.org/mailman/listinfo/python-list
From: Sakesun Roykiattisak [EMAIL PROTECTED]
import datetime
print datetime.datetime.now()
That doesn't work here:
% python
Python 2.2.2 (#1, Feb 17 2003, 21:01:54)
[GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
Type help, copyright, credits or license for more information.
import datetime
How do I center each item in the ListBox widget?
Also, is it possible to change the color of the selected item? right
now it uses the OSes color. I would like it to be consistant on every
machine.
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
Thanks for your reply! A new thing learned
Allow me to follow that up with another question:
Let's say I have a result from a module called pyparsing:
Results1 = ['abc', 'def']
Results2 = ['abc']
They are of the ParseResults type:
type(Results1)
class 'pyparsing.ParseResults'
Bugs item #1069410, was opened at 2004-11-19 15:02
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1069410group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1072853, was opened at 2004-11-25 00:13
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1072853group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1099364, was opened at 2005-01-10 11:33
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1099364group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1066490, was opened at 2004-11-15 07:46
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1066490group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1108948, was opened at 2005-01-25 10:04
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1108948group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1007046, was opened at 2004-08-11 08:47
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1007046group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1100201, was opened at 2005-01-11 16:04
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1100201group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1178145, was opened at 2005-04-07 00:52
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1178145group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1155638, was opened at 2005-03-03 08:22
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1155638group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1170279, was opened at 2005-03-25 02:03
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1170279group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1172785, was opened at 2005-03-29 22:50
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1172785group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1058059, was opened at 2004-11-01 11:47
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1058059group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1088039, was opened at 2004-12-19 20:31
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1088039group_id=5470
Please note that this message will contain a full copy of the comment
Feature Requests item #1085861, was opened at 2004-12-15 16:33
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=355470aid=1085861group_id=5470
Please note that this message will contain a full copy of
Bugs item #946247, was opened at 2004-05-02 07:42
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=946247group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #839151, was opened at 2003-11-10 11:56
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=839151group_id=5470
Please note that this message will contain a full copy of the comment
Bugs item #1227955, was opened at 2005-06-26 18:38
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1227955group_id=5470
Please note that this message will contain a full copy of
Feature Requests item #1214675, was opened at 2005-06-04 02:37
Message generated for change (Comment added) made by rhettinger
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=355470aid=1214675group_id=5470
Please note that this message will contain a full copy of
Feature Requests item #1152248, was opened at 2005-02-26 02:24
Message generated for change (Comment added) made by rhettinger
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=355470aid=1152248group_id=5470
Please note that this message will contain a full copy of
Bugs item #1228015, was opened at 2005-06-27 06:30
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detailatid=105470aid=1228015group_id=5470
Please note that this message will contain a full copy of
82 matches
Mail list logo