python-graph-1.6.0 released

2009-06-07 Thread Pedro Matiello
python-graph release 1.6.0 http://code.google.com/p/python-graph/ python-graph is a library for working with graphs in Python. This software provides a suitable data structure for representing graphs and a whole set

ANN: Webware for Python 1.0.2 released

2009-06-07 Thread Christoph Zwerschke
Webware for Python 1.0.2 has been released. This is the second bugfix release for Webware for Python release 1.0, mainly fixing some problems and shortcomings of the PSP plug-in. See the WebKit and PSP release notes for details. Webware for Python is a suite of Python packages and tools for

progress.py 1.0.0 - Track and display progress, providing estimated completion time.

2009-06-07 Thread Tim Newsome
I couldn't find any module that would just let me add progress to all the random little scripts I write. So I wrote one. You can download and read about it at http://www.casualhacker.net/blog/progress_py/ Below is the module's description. I welcome any comments and suggestions. Tim DESCRIPTION

Re: #! to two different pythons?

2009-06-07 Thread Duncan Booth
m...@pixar.com wrote: Benjamin Peterson benja...@python.org wrote: #!/usr/bin/env python But how can I handle this with two differently named pythons? #!/usr/anim/menv/bin/pypix #!/Users/mh/py/bin/python Thanks! Mark If you install using with a setup.py that uses distutils

Properties for several keywords

2009-06-07 Thread Kless
I've to write properties for several keywords with the same code, it only changes the name of each property: - @property def foo(self): return self._foo @foo.setter def foo(self, txt): self._foo = self._any_function(txt) #

Re: Properties for several keywords

2009-06-07 Thread Kless
On 7 jun, 11:45, Kless jonas@googlemail.com wrote: I've to write properties for several keywords with the same code, it only changes the name of each property: - @property    def foo(self):       return self._foo @foo.setter    def foo(self, txt):      

Re: Making the case for repeat

2009-06-07 Thread bearophileHUGS
pataphor: The problem is posting *this* function would kill my earlier repeat for sure. And it already had a problem with parameters 0 (Hint: that last bug has now become a feature in the unpostable repeat implementation) Be bold, kill your precedent ideas, and post the Unpostable :-)

Re: Is reduce() foldl() or foldr()?

2009-06-07 Thread Tim Northover
Steven D'Aprano st...@remove-this-cybersource.com.au writes: Calling all functional programming fans... is Python's built-in reduce() a left-fold or a right-fold? I get: reduce(lambda a, b: a/b, [1.0, 2.0, 3.0]) 0.1 which looks like a left fold to me. Tim. --

Re: Is reduce() foldl() or foldr()?

2009-06-07 Thread Peter Otten
Steven D'Aprano wrote: Calling all functional programming fans... is Python's built-in reduce() a left-fold or a right-fold? Wikipedia says it's a left-fold: http://en.wikipedia.org/wiki/Fold_(higher-order_function) Wikipedia is correct: from __future__ import division

Re: Is reduce() foldl() or foldr()?

2009-06-07 Thread Scott David Daniels
Steven D'Aprano wrote: Calling all functional programming fans... is Python's built-in reduce() a left-fold or a right-fold? ... So which is correct? Or is it that different people have different definitions of foldl() and foldr()? Just test. Floating point addition is not associative, so:

Keeping console window open

2009-06-07 Thread Fencer
Hello, I need to write a simple utility program that will be used under Windows. I want to write the utility in python and it will be run by double-clicking the the .py-file. I put a raw_input('Press enter to exit) at the end so the console window wouldn't just disappear when the program is

how to transfer my utf8 code saved in a file to gbk code

2009-06-07 Thread higer
My file contains such strings : \xe6\x97\xa5\xe6\x9c\x9f\xef\xbc\x9a I want to read the content of this file and transfer it to the corresponding gbk code,a kind of Chinese character encode style. Everytime I was trying to transfer, it will output the same thing no matter which method was used.

Re: Keeping console window open

2009-06-07 Thread Tomasz Zieliński
On 7 Cze, 14:49, Fencer no.i.d...@want.mail.from.spammers.com wrote: My question is how can I trap errors encountered by the interpreter (if that is the right way to put it) in order to keep the console window open so one has a chance to see the error message? Interpreter errors are same

Re: Keeping console window open

2009-06-07 Thread Can Xue
2009/6/7 Fencer no.i.d...@want.mail.from.spammers.com Anyway, I wrote a few lines of code and when I first tried to run it by double-clicking the .py-file the console window still disappeared right away. So, in order to see what was happening, I ran it from a shell and it turned out to be a

Re: pylint naming conventions?

2009-06-07 Thread Esmail
Ben Finney wrote: Esmail ebo...@hotmail.com writes: I am confused by pylint's naming conventions, I don't think the are in tune with Python's style recommendations (PEP 8?) Anyone else think this? It's hard to know, without examples. Can you give some output of pylint that you think doesn't

Re: Keeping console window open

2009-06-07 Thread Scott David Daniels
Tomasz Zieliński wrote: On 7 Cze, 14:49, Fencer no.i.d...@want.mail.from.spammers.com wrote: My question is how can I trap errors encountered by the interpreter (if that is the right way to put it) in order to keep the console window open so one has a chance to see the error message?

The pysync library - Looking for the code, but all download links are broken

2009-06-07 Thread jpersson
Hi, From the description the library pysync seems to be a perfect match for some of the things I would like to accomplish in my own project. The problem is that all the download links seems to be broken, so I cannot download the code. http://freshmeat.net/projects/pysync/ I've also tried to

Re: Keeping console window open

2009-06-07 Thread Fencer
Scott David Daniels wrote: To be a trifle more explicit, turn: ... if __name__ == '__main__': main() into: ... if __name__ == '__main__': try: main() except Exception, why: print 'Failed:', why import

how to transfer my utf8 code saved in a file to gbk code

2009-06-07 Thread R. David Murray
higer higerinbeij...@gmail.com wrote: My file contains such strings : \xe6\x97\xa5\xe6\x9c\x9f\xef\xbc\x9a If those bytes are what is in the file (and it sounds like they are), then the data in your file is not in UTF8 encoding, it is in ASCII encoded as hexidecimal escape codes. I want to

Re: multi-core software

2009-06-07 Thread Jeff M.
On Jun 7, 1:56 am, Paul Rubin http://phr...@nospam.invalid wrote: Jeff M. mass...@gmail.com writes: Even the lightest weight user space (green) threads need a few hundred instructions, minimum, to amortize the cost of context switching There's always a context switch. It's just

Re: Is reduce() foldl() or foldr()?

2009-06-07 Thread Piet van Oostrum
Tim Northover t.p.northo...@sms.ed.ac.uk (TN) escribió: TN Steven D'Aprano st...@remove-this-cybersource.com.au writes: Calling all functional programming fans... is Python's built-in reduce() a left-fold or a right-fold? TN I get: reduce(lambda a, b: a/b, [1.0, 2.0, 3.0]) TN

Re: multi-core software

2009-06-07 Thread Jon Harrop
Roedy Green wrote: On Fri, 5 Jun 2009 18:15:00 + (UTC), Kaz Kylheku kkylh...@gmail.com wrote, quoted or indirectly quoted someone who said : Even for problems where it appears trivial, there can be hidden issues, like false cache coherency communication where no actual sharing is taking

Re: multi-core software

2009-06-07 Thread Jon Harrop
George Neuner wrote: On Fri, 05 Jun 2009 16:26:37 -0700, Roedy Green see_webs...@mindprod.com.invalid wrote: On Fri, 5 Jun 2009 18:15:00 + (UTC), Kaz Kylheku kkylh...@gmail.com wrote, quoted or indirectly quoted someone who said : Even for problems where it appears trivial, there can be

Re: multi-core software

2009-06-07 Thread Lew
Scott David Daniels wrote: the nub of the problem is not on the benchmarks. There is something to be said for the good old daays when you looked up the instruction timings that you used in a little document for your machine, and could know the cost of any loop. We are faster now, but part of

Re: how to transfer my utf8 code saved in a file to gbk code

2009-06-07 Thread John Machin
On Jun 7, 10:55 pm, higer higerinbeij...@gmail.com wrote: My file contains such strings : \xe6\x97\xa5\xe6\x9c\x9f\xef\xbc\x9a Are you sure? Does that occupy 9 bytes in your file or 36 bytes? I want to read the content of this file and transfer it to the corresponding gbk code,a kind of

Re: multi-core software

2009-06-07 Thread Arved Sandstrom
Jon Harrop wrote: Roedy Green wrote: On Fri, 5 Jun 2009 18:15:00 + (UTC), Kaz Kylheku kkylh...@gmail.com wrote, quoted or indirectly quoted someone who said : Even for problems where it appears trivial, there can be hidden issues, like false cache coherency communication where no actual

Re: unladen swallow: python and llvm

2009-06-07 Thread Neuruss
On 5 jun, 06:29, Nick Craig-Wood n...@craig-wood.com wrote: Luis M  González luis...@gmail.com wrote:  I am very excited by this project (as well as by pypy) and I read all  their plan, which looks quite practical and impressive.  But I must confess that I can't understand why LLVM is so

pyc-files contains absolute paths, is this a bug ?

2009-06-07 Thread Stef Mientki
hello, AFAIK I read that pyc files can be transferred to other systems. I finally got a windows executable working through py2exe, but still have some troubles, moving the directory around. I use Python 2.5.2. I use py2exe to make a distro I can unpack the distro, on a clean computer, anywhere

Python preprosessor

2009-06-07 Thread Tuomas Vesterinen
I am developing a Python application as a Python2.x and Python3.0 version. A common code base would make the work easier. So I thought to try a preprosessor. GNU cpp handles this kind of code correct: test_cpp.py #ifdef python2 print u'foo', u'bar' #endif #ifdef python3 print('foo', 'bar')

Re: Iterating Over Dictionary From Arbitrary Location

2009-06-07 Thread Aahz
In article mailman.1241.1244301490.8015.python-l...@python.org, akindo akind...@hotmail.com wrote: So, it seems I want the best of both worlds: specific indexing using my own IDs/keys (not just by list element location), sorting and the ability to start iterating from a specific location. I

Re: Python preprosessor

2009-06-07 Thread Peter Otten
Tuomas Vesterinen wrote: I am developing a Python application as a Python2.x and Python3.0 version. A common code base would make the work easier. So I thought to try a preprosessor. GNU cpp handles this kind of code correct: Any other suggestions?

Re: pyc-files contains absolute paths, is this a bug ?

2009-06-07 Thread Steven D'Aprano
On Sun, 07 Jun 2009 18:16:26 +0200, Stef Mientki wrote: hello, AFAIK I read that pyc files can be transferred to other systems. I finally got a windows executable working through py2exe, but still have some troubles, moving the directory around. Sounds like a py2exe problem, not a Python

Re: Is reduce() foldl() or foldr()?

2009-06-07 Thread Paul Rubin
Steven D'Aprano st...@remove-this-cybersource.com.au writes: Calling all functional programming fans... is Python's built-in reduce() a left-fold or a right-fold? It's a left fold. but other people say it's a right-fold, e.g.: ... there is a `foldr` in Haskell that just works like

Re: unladen swallow: python and llvm

2009-06-07 Thread MRAB
Neuruss wrote: On 5 jun, 06:29, Nick Craig-Wood n...@craig-wood.com wrote: Luis M González luis...@gmail.com wrote: I am very excited by this project (as well as by pypy) and I read all their plan, which looks quite practical and impressive. But I must confess that I can't understand why

Re: Python preprosessor

2009-06-07 Thread Tuomas Vesterinen
Peter Otten wrote: Tuomas Vesterinen wrote: I am developing a Python application as a Python2.x and Python3.0 version. A common code base would make the work easier. So I thought to try a preprosessor. GNU cpp handles this kind of code correct: Any other suggestions?

Re: unladen swallow: python and llvm

2009-06-07 Thread Nick Craig-Wood
Neuruss luis...@gmail.com wrote: ok, let me see if I got it: The Python vm is written in c, and generates its own bitecodes which in turn get translated to machine code (one at a time). Unladen Swallow aims to replace this vm by one compiled with the llvm compiler, which I guess will

Re: multi-core software

2009-06-07 Thread Jon Harrop
Arved Sandstrom wrote: Jon Harrop wrote: I see no problem with mutable shared state. In which case, Jon, you're in a small minority. No. Most programmers still care about performance and performance means mutable state. -- Dr Jon D Harrop, Flying Frog Consultancy Ltd.

Re: multi-core software

2009-06-07 Thread Joshua Cranmer
Jon Harrop wrote: No. Most programmers still care about performance and performance means mutable state. [ Citation needed ]. Most programmers I've met could care less about performance. -- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth --

Re: unladen swallow: python and llvm

2009-06-07 Thread bearophileHUGS
Luis M. González: it seems they intend to do upfront compilation. How? Unladen swallow developers want to try everything (but black magic and necromancy) to increase the speed of Cpython. So they will try to compile up-front if/where they can (for example most regular expressions are known at

Re: Get the class name

2009-06-07 Thread Tuomas Vesterinen
Kless wrote: Is there any way of to get the class name to avoid to have that write it? --- class Foo: super(Foo, self) --- * Using Py 2.6.2 class Foo(object): ... def cls(self): ... return self.__class__ ... Foo().cls() class '__main__.Foo' --

pypi compatible software

2009-06-07 Thread Aljosa Mohorovic
i've been searching for a recommended way to setup private pypi repository and i've found several options: - PloneSoftwareCenter - http://code.google.com/p/pypione/ - http://pypi.python.org/pypi/haufe.eggserver - http://www.chrisarndt.de/projects/eggbasket/ -

Re: multi-core software

2009-06-07 Thread Patricia Shanahan
Jon Harrop wrote: Arved Sandstrom wrote: Jon Harrop wrote: I see no problem with mutable shared state. In which case, Jon, you're in a small minority. No. Most programmers still care about performance and performance means mutable state. I don't see why that would affect whether one

Re: The pysync library - Looking for the code, but all download links are broken

2009-06-07 Thread Søren - Peng - Pedersen
I think what you are looking for can be found at: http://www.google.com/codesearch/p?hl=en#RncWxgazS6A/pysync-2.24/test/testdata.pyq=pysync%20package:%22http://minkirri.apana.org.au/~abo/projects/pysync/arc/pysync-2.24.tar.bz2%22%20lang:python or http://shortlink.dk/58664133 I am not affiliated

Re: multi-core software

2009-06-07 Thread Jon Harrop
Arved Sandstrom wrote: Jon Harrop wrote: Arved Sandstrom wrote: Jon Harrop wrote: I see no problem with mutable shared state. In which case, Jon, you're in a small minority. No. Most programmers still care about performance and performance means mutable state. Quite apart from

Re: multi-core software

2009-06-07 Thread Jon Harrop
Joshua Cranmer wrote: Jon Harrop wrote: No. Most programmers still care about performance and performance means mutable state. [ Citation needed ]. Most programmers I've met could care less about performance. Then they have no need for parallelism in the first place. -- Dr Jon D

Re: Properties for several keywords

2009-06-07 Thread Kless
On 7 jun, 11:45, Kless jonas@googlemail.com wrote: I've to write properties for several keywords with the same code, it only changes the name of each property: - @property    def foo(self):       return self._foo @foo.setter    def foo(self, txt):      

Re: How to get local copy of docs?

2009-06-07 Thread kj
In eff6307d-e3d5-4b26-ac7c-a658f1b96...@z7g2000vbh.googlegroups.com TonyM foss...@gmail.com writes: http://docs.python.org/download.html Perfect. Thanks! kynn -- -- http://mail.python.org/mailman/listinfo/python-list

Re: unladen swallow: python and llvm

2009-06-07 Thread Paul Rubin
bearophileh...@lycos.com writes: What I like of Unladen swallow is that it's a very practical approach, very different in style from ShedSkin and PyPy (and it's more ambitious than Psyco). I also like Unladen swallow because they are the few people that have the boldness to do something to

Re: multi-core software

2009-06-07 Thread Jeff M.
On Jun 7, 3:19 pm, Arved Sandstrom dces...@hotmail.com wrote: Jon Harrop wrote: Arved Sandstrom wrote: Jon Harrop wrote: I see no problem with mutable shared state. In which case, Jon, you're in a small minority. No. Most programmers still care about performance and performance means

Re: multi-core software

2009-06-07 Thread Lew
Jon Harrop wrote: I see no problem with mutable shared state. In which case, Jon, you're in a small minority. Patricia Shanahan wrote: In my opinion, shared mutable state has a lot of problems. It is also sometimes the best design for performance reasons. As Dr. Jon pointed out upthread,

Re: multi-core software

2009-06-07 Thread Jon Harrop
Jeff M. wrote: On Jun 7, 3:19 pm, Arved Sandstrom dces...@hotmail.com wrote: Jon Harrop wrote: Arved Sandstrom wrote: Jon Harrop wrote: I see no problem with mutable shared state. In which case, Jon, you're in a small minority. No. Most programmers still care about performance and

Re: pypi compatible software

2009-06-07 Thread Martin v. Löwis
- is code behind pypi.python.org available and why i can't find some up-to-date official document or howto for private pypi repository (maybe it exists but i just can't find it)? The code is at https://svn.python.org/packages/ Instructions for installing it are at

Re: multi-core software

2009-06-07 Thread Jon Harrop
Lew wrote: As Dr. Jon pointed out upthread, one can write decent code with mutable shared state. It is also true that mutable state presents a lot of problems - potential problems, ones that can be solved, but not ones that can be solved thoughtlessly. On the flip side, one can write a

Re: multi-core software

2009-06-07 Thread Lew
Jon Harrop wrote: I agree entirely but my statements were about parallelism and not concurrency. Parallel and concurrent programming have wildly different characteristics and solutions. I don't believe shared mutable state is overly problematic in the context of parallelism. Indeed, I think it

Re: Properties for several keywords

2009-06-07 Thread Scott David Daniels
Kless wrote: On 7 jun, 11:45, Kless jonas@googlemail.com wrote: I've to write properties for several keywords with the same code, it only changes the name of each property: ... Is possible to simplify it? Please, is there any solution for this problem? Read up on property. It is the

Re: multi-core software

2009-06-07 Thread Ken T.
On Sun, 07 Jun 2009 11:16:46 -0400, Lew wrote: So the good old days are a matter of degree and self-deception - it was easier to fool ourselves then that we could at least guess timings proportionately if not absolutely, but things definitely get more unpredictable over evolution. As I

Re: unladen swallow: python and llvm

2009-06-07 Thread bearophileHUGS
Paul Rubin: IMHO the main problem with the Unladen Swallow approach is that it would surprise me if CPython really spends that much of its time interpreting byte code. Note that Py3 already has a way to speed up byte code interpretation where compiled by GCC or Intel compiler (it's a very old

Re: unladen swallow: python and llvm

2009-06-07 Thread Brian
On Fri, Jun 5, 2009 at 3:29 AM, Nick Craig-Wood n...@craig-wood.com wrote: It is an interesting idea for a number of reasons, the main one as far as I'm concerned is that it is more of a port of CPython to a new architecture than a complete re-invention of python (like PyPy / IronPython /

Re: can it be shorter?

2009-06-07 Thread Aaron Brady
On Jun 6, 8:07 am, tsangpo tsangpo.newsgr...@gmail.com wrote: I want to ensure that the url ends with a '/', now I have to do thisa like below. url = url + '' if url[-1] == '/' else '/' Is there a better way? url+= { '/': '' }.get( url[ -1 ], '/' ) Shorter is always better. --

Re: can it be shorter?

2009-06-07 Thread Brian
Since extra slashes at the end of a URL are ignored, that means I win! url+='/' On Sun, Jun 7, 2009 at 4:45 PM, Aaron Brady castiro...@gmail.com wrote: On Jun 6, 8:07 am, tsangpo tsangpo.newsgr...@gmail.com wrote: I want to ensure that the url ends with a '/', now I have to do thisa like

Re: multi-core software

2009-06-07 Thread Arved Sandstrom
Lew wrote: Jon Harrop wrote: I agree entirely but my statements were about parallelism and not concurrency. Parallel and concurrent programming have wildly different characteristics and solutions. I don't believe shared mutable state is overly problematic in the context of parallelism. Indeed,

Re: Python preprosessor

2009-06-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tuomas Vesterinen wrote: I am intensively using 2to3.py. So I have 2 codebase: one in py2 and the other in py3. The expectation would be that you only maintain the py2 code and automatically generate the py3 code on demand using 2to3. It is

Re: Making the case for repeat

2009-06-07 Thread Raymond Hettinger
[pataphor] So here is my proposed suggestion for a once and for all reconciliation of various functions in itertools that can not stand on their own and keep a straight face. Interesting phraseology ;-) Enticing and yet fallacious in its presumption of known and accepted usability problems.

Re: how to transfer my utf8 code saved in a file to gbk code

2009-06-07 Thread John Machin
On Jun 8, 12:13 am, R. David Murray rdmur...@bitdance.com wrote: higer higerinbeij...@gmail.com wrote: My file contains such strings : \xe6\x97\xa5\xe6\x9c\x9f\xef\xbc\x9a If those bytes are what is in the file (and it sounds like they are), then the data in your file is not in UTF8

Re: multi-core software

2009-06-07 Thread Jon Harrop
Arved Sandstrom wrote: Lew wrote: Interesting distinction. Would it be fair to compare concurrent programming to the bricks used to build the parallel program's edifice? Way too much of a fine distinction. While they are in fact different, the point of concurrent programming is to

Re: multi-core software

2009-06-07 Thread Jon Harrop
Lew wrote: Jon Harrop wrote: I agree entirely but my statements were about parallelism and not concurrency. Parallel and concurrent programming have wildly different characteristics and solutions. I don't believe shared mutable state is overly problematic in the context of parallelism.

Re: how to transfer my utf8 code saved in a file to gbk code

2009-06-07 Thread MRAB
John Machin wrote: On Jun 8, 12:13 am, R. David Murray rdmur...@bitdance.com wrote: higer higerinbeij...@gmail.com wrote: My file contains such strings : \xe6\x97\xa5\xe6\x9c\x9f\xef\xbc\x9a If those bytes are what is in the file (and it sounds like they are), then the data in your file is

Re: Keeping console window open

2009-06-07 Thread Dave Angel
Fencer wrote: div class=moz-text-flowed style=font-family: -moz-fixedScott David Daniels wrote: To be a trifle more explicit, turn: ... if __name__ == '__main__': main() into: ... if __name__ == '__main__': try: main() except

Re: multi-core software

2009-06-07 Thread Patricia Shanahan
Jon Harrop wrote: ... Historically, concurrency has been of general interest on single core machines in the context of operating systems and IO and has become more important recently due to the ubiquity of web programming. Parallelism was once only important to computational scientists

Re: how to transfer my utf8 code saved in a file to gbk code

2009-06-07 Thread John Machin
On Jun 8, 10:20 am, MRAB pyt...@mrabarnett.plus.com wrote: John Machin wrote: On Jun 8, 12:13 am, R. David Murray rdmur...@bitdance.com wrote: higer higerinbeij...@gmail.com wrote: My file contains such strings : \xe6\x97\xa5\xe6\x9c\x9f\xef\xbc\x9a If those bytes are what is in the

pythoncom and writing file summary info on Windows

2009-06-07 Thread mattleftbody
Hello, I was trying to put together a script that would write things like the Author and Title metadata fields of a file under Windows. I got the win32 extensions installed and found a few things that look like they should work, though I'm not getting the result I would expect. Hopefully someone

Re: Get the class name

2009-06-07 Thread Robert Kern
On 2009-06-07 15:41, Tuomas Vesterinen wrote: Kless wrote: Is there any way of to get the class name to avoid to have that write it? --- class Foo: super(Foo, self) --- * Using Py 2.6.2 class Foo(object): ... def cls(self): ... return self.__class__ ...

Re: multi-core software

2009-06-07 Thread Dave Angel
Lew wrote: div class=moz-text-flowed style=font-family: -moz-fixedScott David Daniels wrote: the nub of the problem is not on the benchmarks. There is something to be said for the good old daays when you looked up the instruction timings that you used in a little document for your machine, and

Re: multi-core software

2009-06-07 Thread Jon Harrop
Ken T. wrote: On Sun, 07 Jun 2009 11:16:46 -0400, Lew wrote: So the good old days are a matter of degree and self-deception - it was easier to fool ourselves then that we could at least guess timings proportionately if not absolutely, but things definitely get more unpredictable over

Re: multi-core software

2009-06-07 Thread Arved Sandstrom
Jon Harrop wrote: Arved Sandstrom wrote: Lew wrote: Interesting distinction. Would it be fair to compare concurrent programming to the bricks used to build the parallel program's edifice? Way too much of a fine distinction. While they are in fact different, the point of concurrent

Re: Get the class name

2009-06-07 Thread Carl Banks
On Jun 7, 1:14 pm, Kless jonas@googlemail.com wrote: Is there any way of to get the class name to avoid to have that write it? --- class Foo:    super(Foo, self) --- * Using Py 2.6.2 If you are using emacs you can use the put the following elisp code in your

Re: how to transfer my utf8 code saved in a file to gbk code

2009-06-07 Thread higer
On Jun 7, 11:25 pm, John Machin sjmac...@lexicon.net wrote: On Jun 7, 10:55 pm, higer higerinbeij...@gmail.com wrote: My file contains such strings : \xe6\x97\xa5\xe6\x9c\x9f\xef\xbc\x9a Are you sure? Does that occupy 9 bytes in your file or 36 bytes? It was saved in a file, so it

Re: how to transfer my utf8 code saved in a file to gbk code

2009-06-07 Thread higer
On Jun 8, 8:20 am, MRAB pyt...@mrabarnett.plus.com wrote: John Machin wrote: On Jun 8, 12:13 am, R. David Murray rdmur...@bitdance.com wrote: higer higerinbeij...@gmail.com wrote: My file contains such strings : \xe6\x97\xa5\xe6\x9c\x9f\xef\xbc\x9a If those bytes are what is in the file

Re: multi-core software

2009-06-07 Thread Jon Harrop
Arved Sandstrom wrote: Jon Harrop wrote: Arved Sandstrom wrote: Lew wrote: Interesting distinction. Would it be fair to compare concurrent programming to the bricks used to build the parallel program's edifice? Way too much of a fine distinction. While they are in fact different, the point

Re: multi-core software

2009-06-07 Thread Ken T.
On Mon, 08 Jun 2009 02:39:40 +0100, Jon Harrop wrote: Ken T. wrote: On Sun, 07 Jun 2009 11:16:46 -0400, Lew wrote: So the good old days are a matter of degree and self-deception - it was easier to fool ourselves then that we could at least guess timings proportionately if not absolutely, but

Re: pylint naming conventions?

2009-06-07 Thread David Stanek
On Sun, Jun 7, 2009 at 9:23 AM, Esmailebo...@hotmail.com wrote: Ben Finney wrote: Esmail ebo...@hotmail.com writes: I am confused by pylint's naming conventions, I don't think the are in tune with Python's style recommendations (PEP 8?) Anyone else think this? It's hard to know, without

Re: multi-core software

2009-06-07 Thread Paul Rubin
George Neuner gneun...@comcast.net writes: Even the lightest weight user space (green) threads need a few hundred instructions, minimum, to amortize the cost of context switching. I thought the definition of green threads was that multiplexing them doesn't require context switches. --

Re: multi-core software

2009-06-07 Thread Paul Rubin
Jeff M. mass...@gmail.com writes: Even the lightest weight user space (green) threads need a few hundred instructions, minimum, to amortize the cost of context switching There's always a context switch. It's just whether or not you are switching in/out a virtual stack and registers

Re: can it be shorter?

2009-06-07 Thread Paul Rubin
Aaron Brady castiro...@gmail.com writes: url+= { '/': '' }.get( url[ -1 ], '/' ) Shorter is always better. url = url.rstrip('/') + '/' -- http://mail.python.org/mailman/listinfo/python-list

Re: multi-core software

2009-06-07 Thread Jon Harrop
Paul Rubin wrote: Jeff M. mass...@gmail.com writes: Even the lightest weight user space (green) threads need a few hundred instructions, minimum, to amortize the cost of context switching There's always a context switch. It's just whether or not you are switching in/out a virtual

Re: multi-core software

2009-06-07 Thread Jon Harrop
Scott David Daniels wrote: Lew wrote: Scott David Daniels wrote: the nub of the problem is not on the benchmarks. There is something to be said for the good old daays when you looked up the instruction timings that you used in a little document for your machine, and could know the cost of

Re: spammers on pypi

2009-06-07 Thread Scott David Daniels
Lawrence D'Oliveiro wrote: In message dd8295d3-61ab-4cc9-86b8-1e04f3edd...@f16g2000vbf.googlegroups.com, joep wrote: Is there a way to ban spammers from pypi? Yes, but it doesn't work. And if you ever do discover something that _does_ work: (1) You'll have discovered perpetual motion.

Re: multi-core software

2009-06-07 Thread Scott David Daniels
Lew wrote: Scott David Daniels wrote: the nub of the problem is not on the benchmarks. There is something to be said for the good old daays when you looked up the instruction timings that you used in a little document for your machine, and could know the cost of any loop. We are faster now,

Re: multi-core software

2009-06-07 Thread Roedy Green
On Fri, 5 Jun 2009 18:15:00 + (UTC), Kaz Kylheku kkylh...@gmail.com wrote, quoted or indirectly quoted someone who said : Even for problems where it appears trivial, there can be hidden issues, like false cache coherency communication where no actual sharing is taking place. Or locks that

openhook

2009-06-07 Thread Gaudha
Can anybody tell me what is meant by 'openhook' ? -- http://mail.python.org/mailman/listinfo/python-list

Re: The Complexity And Tedium of Software Engineering

2009-06-07 Thread verec
On 2009-06-05 21:03:33 +0100, Kenneth Tilton kentil...@gmail.com said: When progress stops we will have time to polish our systems, not before. Is that an endorsement of mediocrity? -- JFB -- http://mail.python.org/mailman/listinfo/python-list

Re: multi-core software

2009-06-07 Thread Raymond Wiker
Roedy Green see_webs...@mindprod.com.invalid writes: On Fri, 5 Jun 2009 18:15:00 + (UTC), Kaz Kylheku kkylh...@gmail.com wrote, quoted or indirectly quoted someone who said : Even for problems where it appears trivial, there can be hidden issues, like false cache coherency communication

Re: The Complexity And Tedium of Software Engineering

2009-06-07 Thread Kenneth Tilton
verec wrote: On 2009-06-05 21:03:33 +0100, Kenneth Tilton kentil...@gmail.com said: When progress stops we will have time to polish our systems, not before. Is that an endorsement of mediocrity? No, of General Patton. hth, kt -- http://mail.python.org/mailman/listinfo/python-list

can it be shorter?

2009-06-07 Thread tsangpo
I want to ensure that the url ends with a '/', now I have to do thisa like below. url = url + '' if url[-1] == '/' else '/' Is there a better way? -- http://mail.python.org/mailman/listinfo/python-list

Get the class name

2009-06-07 Thread Kless
Is there any way of to get the class name to avoid to have that write it? --- class Foo: super(Foo, self) --- * Using Py 2.6.2 -- http://mail.python.org/mailman/listinfo/python-list

Re: pylint naming conventions?

2009-06-07 Thread Ben Finney
David Stanek dsta...@dstanek.com writes: On Sun, Jun 7, 2009 at 9:23 AM, Esmailebo...@hotmail.com wrote: I'll try to come up with a nice short code example in the next few days to demonstrate what I think the problem is and post it, thanks for the suggestion. If you didn't have an

Re: how to transfer my utf8 code saved in a file to gbk code

2009-06-07 Thread Mark Tolonen
higer higerinbeij...@gmail.com wrote in message news:0c786326-1651-42c8-ba39-4679f3558...@r13g2000vbr.googlegroups.com... On Jun 7, 11:25 pm, John Machin sjmac...@lexicon.net wrote: On Jun 7, 10:55 pm, higer higerinbeij...@gmail.com wrote: My file contains such strings :

[issue4749] Issue with RotatingFileHandler logging handler on Windows

2009-06-07 Thread Frans
Frans frans.van.nieuwenho...@gmail.com added the comment: I ran into the same problem with RotatingFileHandler from a multithreaded daemon under Ubuntu. I Googled around and found the ConcurrentLogHandler on pypi (http://pypi.python.org/pypi/ConcurrentLogHandler). It solved the problem.

[issue6228] round() error

2009-06-07 Thread steve21
New submission from steve21 steve872929...@yahoo.com.au: I wish to round the float 697.04157958254996 to 10 decimal digits after the decimal point. $ python3.0 Python 3.0.1 (r301:69556, Jun 7 2009, 14:51:41) [GCC 4.3.2 20081105 (Red Hat 4.3.2-7)] on linux2 Type help, copyright, credits or

[issue6229] Installation python on mac

2009-06-07 Thread eric
New submission from eric mul...@gmx.ch: Hello i wan't to install the python 3.0 on my mac. the python image, .dmg file, i download from this site, run the installation. After this, the framework doesn't installation in the folder /System/Library/Frameworks/Python.framework. How can i change the

  1   2   >