py.test-1.3.1: new py.test.xfail, --maxfail, better reporting, fixes

2010-05-26 Thread holger krekel
The pylib/py.test 1.3.1 release brings: - the new imperative ``py.test.xfail()`` helper in order to have a test or setup function result in an expected failure - a new option ``--maxfail=NUM`` to stop the test run after some failures - markers/decorators are now applicable to test classes

Re: speed up a numpy code with huge array

2010-05-26 Thread Stefan Behnel
Alexzive, 25.05.2010 21:05: is there a way to improve the performance of the attached code ? it takes about 5 h on a dual-core (using only one core) when len(V) ~1MIL. V is an array which is supposed to store all the volumes of tetrahedral elements of a grid whose coord. are stored in NN

Re: UnicodeDecodeError having fetch web page

2010-05-26 Thread John Machin
Rob Williscroft rtw at rtw.me.uk writes: Barry wrote in news:83dc485a-5a20-403b-99ee-c8c627bdbab3 @m21g2000vbr.googlegroups.com in gmane.comp.python.general: UnicodeDecodeError: 'utf8' codec can't decode byte 0x8b in position 1: unexpected code byte It may not be you,

Re: function that counts...

2010-05-26 Thread Bryan
I wrote: My prttn() calls ndsums() once for each digit, so the whole thing is polynomial in the number of digits. Correction: my prttn() function calls ndsums() at most 9 times per digit of n. That still provides run time polynomial in the length of the input. -- --Bryan --

Re: asyncore loop and cmdloop problem

2010-05-26 Thread kak...@gmail.com
On May 26, 2:03 am, exar...@twistedmatrix.com wrote: On 04:31 pm, kak...@gmail.com wrote: On May 25, 5:47 pm, kak...@gmail.com kak...@gmail.com wrote: On May 25, 5:23 pm, Michele Simionato michele.simion...@gmail.com wrote: On May 25, 2:56 pm, kak...@gmail.com kak...@gmail.com wrote:

Re: function that counts...

2010-05-26 Thread Bryan
I wrote: I came up with a recursive memo-izing algorithm that handles 100-digit n's. Oops. I missed Richard Thomas's post. He posted the same algorithm a couple days before. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Kohonen neural network

2010-05-26 Thread Lex Lebedeff
Hello! Has anyone tried to build an implementation of subject in Python? Any help is appreciated! --- news://freenews.netfront.net/ - complaints: n...@netfront.net --- -- http://mail.python.org/mailman/listinfo/python-list

MySQLDB - server has gone on blob insertion...

2010-05-26 Thread Durumdara
Hi! I want to test my program that coded into PGSQL, and PySQLite. With these DBs I have problem on many blob deletion (2 hours) and compact/vacuum (1 hours)... So I'm trying to port my program, and before that making a test to check, which time needs to delete 1 GB of blobs. I installed

TypeError: _new_() takes exactly 3 arguments (2 given) - what does it mean?

2010-05-26 Thread Jesse McDonnell
I'm attempting to install Powerline http://code.google.com/p/powerline/, a computer reservation software based on CherryPy/Python usinga MYSql database,at my local library and I've run up against an errorthat I cannot google my way out of! The google groups for the application is inactive so I'm

Vote to Add Python Package pubsub to the Python Standard Library

2010-05-26 Thread Tom
I vote for adding the Python package pubsub to the Python standard library. It has recently been added to wxpython (replacing the old wx.lib.pubsub package), but it has application to non-gui programs as well. For more information see: http://pubsub.sourceforge.net/. --

[WxPython] Advice on Temperature Application Method Structure

2010-05-26 Thread Jimbo
Hello I have made a simple application using WxPython that is a temperature converter. This is my first application made in WxPython, the only other apps I have made were in Win32 c++ so I am new to widgets in general. I am looking for advice criticism on when you should use classes in GUI

Re: speed up a numpy code with huge array

2010-05-26 Thread Alexzive
thank you all for the tips. I 'll try them soon. I also notice another bottleneck, when python tries to access some array data stored in the odb files (--- in text below), even before starting the algoritm: ### EPS_nodes = range(len(frames)) for f in frames: ... sum = 0 ---UN =

Re: speed up a numpy code with huge array

2010-05-26 Thread Alexzive
sorry it was just bullshit what I wrote about the second bottleneck, it seemed to hang up but it was just me forgetting to double-enter during debugging after for cycle. On May 26, 1:43 pm, Alexzive zasaconsult...@gmail.com wrote: thank you all for the tips. I 'll try them soon. I also

Re: A Quick MySQL Question

2010-05-26 Thread Victor Subervi
On Wed, May 26, 2010 at 2:42 AM, Dennis Lee Bieber wlfr...@ix.netcom.comwrote: I was, for that example, assuming that the user input values was being used in a select query and hence wrapped it with wildcard markers so that the phrase would match anywhere in the data field. In said thread

Re: Kohonen neural network

2010-05-26 Thread alex23
On May 26, 7:21 pm, Lex Lebedeff l...@from.hell wrote: Has anyone tried to build an implementation of subject in Python? Any help is appreciated! http://www.dia.fi.upm.es/~jamartin/download.htm Seriously, though, any reason why you couldn't just type kohonen neural network python into Google?

Re: [WxPython] Advice on Temperature Application Method Structure

2010-05-26 Thread Philip Semanchuk
On May 26, 2010, at 7:36 AM, Jimbo wrote: Hello I have made a simple application using WxPython that is a temperature converter. This is my first application made in WxPython, the only other apps I have made were in Win32 c++ so I am new to widgets in general. I am looking for advice

Inheritable Slots Metaclass

2010-05-26 Thread Rebel Lion
I made a metaclass to inherit __slots__ automatically. I think this feature should be included in builtin object's metaclass. You can now write: class Foo(object): __metaclass__ = SlotMetaclass @slot def foo(): pass class Bar(Foo): @slot

Looking for matlab to python converter.

2010-05-26 Thread Steven W. Orr
I found something on sourceforge called mat2py, but there's nothing there. (It seems to be just a placeholder.) I figure that if anyone would know of something useful, this would be the place to try. TIA -- Time flies like the wind. Fruit flies like a banana. Stranger things have .0.

LJ.com top article

2010-05-26 Thread Aahz
I'm finally getting around to reading my copy of Linux Journal 8/2009 (picked up at OSCON last year), and on page 17, they list the most popular articles from linuxjournal.com. Given that I'm posting here, I'm sure all long-time readers already know what that article is: Eric Raymond's Why

Re: Looking for matlab to python converter.

2010-05-26 Thread alex23
On May 26, 10:52 pm, Steven W. Orr ste...@syslang.net wrote: I found something on sourceforge called mat2py, but there's nothing there. (It seems to be just a placeholder.) I figure that if anyone would know of something useful, this would be the place to try.

Does pickled objects work fine between different OS?

2010-05-26 Thread Oltmans
If I dump a Python dictionary into a file named data.pkl using Pickle module on a Linux operating system, will the data contained in data.pkl load fine in a Windows OS? I mean will I be able to load the dictionary data contained in data.pkl just fine on Windows XP? I could have tested it but

Re: python command line manual

2010-05-26 Thread Aahz
In article mailman.574.1274742650.32709.python-l...@python.org, Chris Rebert c...@rebertia.com wrote: On Mon, May 24, 2010 at 3:52 PM, Peng Yu pengyu...@gmail.com wrote: I mainly check online python manual. But I feel that it would be nice if there is command line manual available (just like

Re: python command line manual

2010-05-26 Thread Tim Golden
On 26/05/2010 14:50, Aahz wrote: In articlemailman.574.1274742650.32709.python-l...@python.org, Chris Rebertc...@rebertia.com wrote: On Mon, May 24, 2010 at 3:52 PM, Peng Yupengyu...@gmail.com wrote: I mainly check online python manual. But I feel that it would be nice if there is command

Python-URL! archives

2010-05-26 Thread Mark Lawrence
According to http://www.python.org/community/lists/ these are archived here http://www.equi4.com/wikis/urls/82. As the latter hasn't been updated since 2000-07-20 isn't it time to change the former :) Regards. Mark Lawrence -- http://mail.python.org/mailman/listinfo/python-list

Re: python command line manual

2010-05-26 Thread Mark Lawrence
On 26/05/2010 14:59, Tim Golden wrote: On 26/05/2010 14:50, Aahz wrote: In articlemailman.574.1274742650.32709.python-l...@python.org, Chris Rebertc...@rebertia.com wrote: On Mon, May 24, 2010 at 3:52 PM, Peng Yupengyu...@gmail.com wrote: I mainly check online python manual. But I feel that

Re: function that counts...

2010-05-26 Thread Albert van der Horst
In article 4bf442cd$0$31377$4fafb...@reader1.news.tin.it, superpollo ute...@esempio.net wrote: ... how many positive integers less than n have digits that sum up to m: In [197]: def prttn(m, n): tot = 0 for i in range(n): s = str(i) sum = 0 for j in

Re: speed up a numpy code with huge array

2010-05-26 Thread bobicanprogram
On May 26, 7:43 am, Alexzive zasaconsult...@gmail.com wrote: thank you all for the tips. I 'll try them soon. I also notice another bottleneck, when python tries to access some array data stored in the odb files (--- in text below), even before starting the algoritm: ### EPS_nodes =

Re: Another Little MySQL Problem

2010-05-26 Thread Kushal Kumaran
On Tue, 2010-05-25 at 14:45 -0400, Victor Subervi wrote: Hi; I have this code: clientCursor.execute('select ID from %s' % (personalDataTable)) upds = [itm[0] for itm in clientCursor] print input type='hidden' name='upds' value='%s' / % upds The problem is that the values

Re: UnicodeDecodeError having fetch web page

2010-05-26 Thread Kushal Kumaran
On Tue, 2010-05-25 at 20:12 +, Rob Williscroft wrote: Barry wrote in news:83dc485a-5a20-403b-99ee-c8c627bdbab3 @m21g2000vbr.googlegroups.com in gmane.comp.python.general: Hi, The code below is giving me the error: Traceback (most recent call last): File

Re: Does pickled objects work fine between different OS?

2010-05-26 Thread Daniel Fetchinson
If I dump a Python dictionary into a file named data.pkl using Pickle module on a Linux operating system, will the data contained in data.pkl load fine in a Windows OS? Yes. I mean will I be able to load the dictionary data contained in data.pkl just fine on Windows XP? Yes. Cheers,

Re: Does pickled objects work fine between different OS?

2010-05-26 Thread Ross Ridge
Oltmans rolf.oltm...@gmail.com wrote: If I dump a Python dictionary into a file named data.pkl using Pickle module on a Linux operating system, will the data contained in data.pkl load fine in a Windows OS? I mean will I be able to load the dictionary data contained in data.pkl just fine on

Re: Does pickled objects work fine between different OS?

2010-05-26 Thread Grant Edwards
On 2010-05-26, Oltmans rolf.oltm...@gmail.com wrote: If I dump a Python dictionary into a file named data.pkl using Pickle module on a Linux operating system, will the data contained in data.pkl load fine in a Windows OS? That depends on the data and the version of Python. Older versions

python setup.py install_data question

2010-05-26 Thread Kent Tenney
In a docutils svn checkout. [docutils/trunk/docutils]$ python setup.py install --root /tmp OK [docutils/trunk/docutils]$ python setup.py install_data --root /tmp distutils.errors.DistutilsFileError: could not delete

Re: Troubles with python internationalization

2010-05-26 Thread Dan Stromberg
On May 25, 10:46 am, Pascal Chambon chambon.pas...@wanadoo.fr wrote: * code safety : it seems default python string formatting technics (% operator, .format() method) are normally used when one needs to substitute placeholders in translated strings. But the thing is : I DONT want my view to

uk girls

2010-05-26 Thread devi
we are write here uk girls body language uk girls clture and that feature what about this last man visit in earth. visit www.ukgirlsbody.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

uk girls

2010-05-26 Thread devi
we are write here uk girls body language uk girls clture and that feature what about this last man visit in earth. visit www.onlineairlinesjobs.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Yet Another Configuration Parser Module

2010-05-26 Thread christian schulze
Hey folks, I've written a small configuration parser for a recent project. I think it's pretty usefull and not that fat or complex as the regular python configuration modules like ConfigParser. The file contains everything you need to know. http://crac.pcriot.com/dl/config.py If you have any

Re: Another Little MySQL Problem

2010-05-26 Thread Victor Subervi
On Wed, May 26, 2010 at 11:25 AM, Kushal Kumaran kushal.kuma...@gmail.comwrote: On Tue, 2010-05-25 at 14:45 -0400, Victor Subervi wrote: Hi; I have this code: clientCursor.execute('select ID from %s' % (personalDataTable)) upds = [itm[0] for itm in clientCursor] print

Error

2010-05-26 Thread William Miner
I¹m relative new to python and I puzzled by the following strange (to me) behavior. I was taking pieces from two old scripts to build a new one. When I began to debug it I got the following error message: Traceback (most recent call last): File

Re: Ugly modification of a class, can it be done better ?

2010-05-26 Thread Stef Mientki
On 21-05-2010 03:27, Steven D'Aprano wrote: Sorry for breaking threading, but Stef's original post has not come through to me. On Thu, May 20, 2010 at 8:13 PM, Stef Mientki stef.mien...@gmail.com wrote: So I want to change the behavior of the class dynamically. I've done it

Re: Error

2010-05-26 Thread Chris Rebert
On Wed, May 26, 2010 at 10:48 AM, William Miner william.mi...@enig.com wrote: I’m relative new to python and I puzzled by the following strange (to me) behavior. I was taking pieces from two old scripts to build a new one. When I began to debug it I got the following error message: Traceback

Re: UnicodeDecodeError having fetch web page

2010-05-26 Thread Rob Williscroft
Kushal Kumaran wrote in news:1274889564.2339.16.ca...@nitrogen in gmane.comp.python.general: On Tue, 2010-05-25 at 20:12 +, Rob Williscroft wrote: Barry wrote in news:83dc485a-5a20-403b-99ee-c8c627bdbab3 @m21g2000vbr.googlegroups.com in gmane.comp.python.general: Hi, The code

Re: Error

2010-05-26 Thread MRAB
William Miner wrote: I’m relative new to python and I puzzled by the following strange (to me) behavior. I was taking pieces from two old scripts to build a new one. When I began to debug it I got the following error message: Traceback (most recent call last): File

Re: Error

2010-05-26 Thread D'Arcy J.M. Cain
On Wed, 26 May 2010 13:48:42 -0400 William Miner william.mi...@enig.com wrote: #!/usr/bin/env python import sys, math, os, shutil, commands, re, mpmath from mpmath import * When I deleted this line, the script ran. Why did the line from mpmath import * Trash the search function fro the

Re: TypeError: _new_() takes exactly 3 arguments (2 given) - what does it mean?

2010-05-26 Thread Terry Reedy
On 5/24/2010 2:52 PM, Jesse McDonnell wrote: I'm attempting to install Powerline http://code.google.com/p/powerline/, a computer reservation software based on CherryPy/Python using a MYSql database, at my local library and I've run up against an error that I cannot google my way out of! The

Re: Error

2010-05-26 Thread Gary Herron
On 05/26/2010 10:48 AM, William Miner wrote: I'm relative new to python and I puzzled by the following strange (to me) behavior. I was taking pieces from two old scripts to build a new one. When I began to debug it I got the following error message: Traceback (most recent call last): File

multiprocessing and accessing server's stdout

2010-05-26 Thread Tim Arnold
Hi, I'm using multiprocessing's BaseManager to create a server on one machine and a client on another. The client fires a request and the server does some work, the result of which ends up on a shared file system that both the client and server can see. However, I need the client machine to see

Re: TypeError: _new_() takes exactly 3 arguments (2 given) - what does it mean?

2010-05-26 Thread Carl Banks
[Again, can't see the original, sorry] On May 26, 11:30 am, Terry Reedy tjre...@udel.edu wrote: On 5/24/2010 2:52 PM, Jesse McDonnell wrote: I'm attempting to install Powerlinehttp://code.google.com/p/powerline/, a computer reservation software based on CherryPy/Python using a MYSql

Fetching a gzipped webpage

2010-05-26 Thread Barry
Hi, Here's my attempt at petching a webpage which is gzip encoded - import urllib.request import gzip import io request = urllib.request.Request(url='http://en.wiktionary.org/wiki/ baby',headers={'Accept': 'text/html','User-Agent':'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us)

Re: Another Little MySQL Problem

2010-05-26 Thread John Nagle
Kushal Kumaran wrote: On Tue, 2010-05-25 at 14:45 -0400, Victor Subervi wrote: Hi; I have this code: clientCursor.execute('select ID from %s' % (personalDataTable)) upds = [itm[0] for itm in clientCursor] print input type='hidden' name='upds' value='%s' / % upds The problem is

Re: MySQL, Python, NumPy and formatted read

2010-05-26 Thread John Nagle
Ian Hoffman wrote: Hello, I'm having significant Python difficulties (and I'm new to Python). I'm trying to read BLOB ASCII (numerical) data from a MySQL database using MySQLdb in a formatted fashion. The BLOB data is a sequence of numbers separated by newlines (\n), like this: 5 6 10 45 etc.

Re: Fetching a gzipped webpage

2010-05-26 Thread Peter Otten
Barry wrote: Here's my attempt at petching a webpage which is gzip encoded - import urllib.request import gzip import io request = urllib.request.Request(url='http://en.wiktionary.org/wiki/ baby',headers={'Accept': 'text/html','User-Agent':'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0

Fastest way to apply a function to an iterable

2010-05-26 Thread Shashank Singh
What is the most efficient way of applying a function to all the elements of an iterable while discarding the result (i.e. operations are done only for side-effects). For example if I want to save all elements in a list of items (and am not interested in what save() returns), the simplest way is:

Indentation

2010-05-26 Thread William Miner
I have a script which I would now put inside a loop. Is there any way to ³automatically² indent the old script so it can be put inside the new loop. Doing it by hand seems so inelegant and time consuming. By the way, thanks for the answer to my previous question. Thanks! Buff Miner -- Enig

Re: Indentation

2010-05-26 Thread Adam Tauno Williams
On Wed, 2010-05-26 at 16:13 -0400, William Miner wrote: I have a script which I would now put inside a loop. Is there any way to “automatically” indent the old script so it can be put inside the new loop. Doing it by hand seems so inelegant and time consuming. Open script in MonoDevelop

Re: Error

2010-05-26 Thread Alister
On Wed, 26 May 2010 11:09:58 -0700, Chris Rebert wrote: On Wed, May 26, 2010 at 10:48 AM, William Miner william.mi...@enig.com wrote: I’m relative new to python and I puzzled by the following strange (to me) behavior. I was taking pieces from two old scripts to build a new one. When I began

Re: Another Little MySQL Problem

2010-05-26 Thread Alister
On Wed, 26 May 2010 12:43:29 -0700, John Nagle wrote: Kushal Kumaran wrote: On Tue, 2010-05-25 at 14:45 -0400, Victor Subervi wrote: Hi; I have this code: clientCursor.execute('select ID from %s' % (personalDataTable)) upds = [itm[0] for itm in clientCursor] print input

atexit/signal for non-interactive jobs

2010-05-26 Thread kj
I want to implement clean-up functions for scripts to be run on a Linux cluster (through LSF). The goal is to make sure that a minimal wrap-up sequence (print diagnostic info, flush buffers, etc.) gets executed if the job is terminated for some reason. (The most common reason for premature

Using Babel: How to protect translator comments (and old translations) in GNU gettext PO files?

2010-05-26 Thread python
We're using the Python based Babel gettext utilities. Is there any technique we can use to make sure that translator comments and old (obsolete) translations (marked with #~) in PO files are preserved across PO file updates? Thanks, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Kohonen neural network

2010-05-26 Thread Lex Lebedeff
On Wed, 26 May 2010 05:26:56 -0700, alex23 wrote: On May 26, 7:21 pm, Lex Lebedeff l...@from.hell wrote: Has anyone tried to build an implementation of subject in Python? Any help is appreciated! http://www.dia.fi.upm.es/~jamartin/download.htm Seriously, though, any reason why you

Re: Fastest way to apply a function to an iterable

2010-05-26 Thread Stefan Behnel
Shashank Singh, 26.05.2010 21:48: What is the most efficient way of applying a function to all the elements of an iterable while discarding the result (i.e. operations are done only for side-effects). For example if I want to save all elements in a list of items (and am not interested in what

Re: multiprocessing and accessing server's stdout

2010-05-26 Thread Adam Tauno Williams
On Wed, 2010-05-26 at 11:47 -0700, Tim Arnold wrote: Hi, I'm using multiprocessing's BaseManager to create a server on one machine and a client on another. The client fires a request and the server does some work, the result of which ends up on a shared file system that both the client and

Re: Indentation

2010-05-26 Thread Tim Chase
On 05/26/2010 03:13 PM, William Miner wrote: I have a script which I would now put inside a loop. Is there any way to ³automatically² indent the old script so it can be put inside the new loop. Doing it by hand seems so inelegant and time consuming. It's usually a function of your editor --

Re: Inheritable Slots Metaclass

2010-05-26 Thread Carl Banks
On May 26, 5:49 am, Rebel Lion r38311...@gmail.com wrote: I made a metaclass to inherit __slots__ automatically. I think this feature should be included in builtin object's metaclass. I'd be ok with a metatype in the standard library that makes slots more transparent, but since slots are

Re: Fastest way to apply a function to an iterable

2010-05-26 Thread Peter Otten
Stefan Behnel wrote: Shashank Singh, 26.05.2010 21:48: What is the most efficient way of applying a function to all the elements of an iterable while discarding the result (i.e. operations are done only for side-effects). For example if I want to save all elements in a list of items (and am

Re: Fastest way to apply a function to an iterable

2010-05-26 Thread Shashank Singh
On Thu, May 27, 2010 at 1:56 AM, Stefan Behnel stefan...@behnel.de wrote: If all items have the exact same type, you can get away with an unbound method: class MyType(object): ... def safe(self): ... itemlist = [ MyType() for i in range(20) ] # this is

Re: Fastest way to apply a function to an iterable

2010-05-26 Thread Stefan Behnel
Shashank Singh, 26.05.2010 23:16: I probably didn't state the problem properly. I was assuming the availability of a static method that could be passed on to map based solution (or imap for that matter). The question was, if one wants to apply a function on each member of list and discard

Re: Inheritable Slots Metaclass

2010-05-26 Thread geremy condra
On Wed, May 26, 2010 at 1:50 PM, Carl Banks pavlovevide...@gmail.com wrote: On May 26, 5:49 am, Rebel Lion r38311...@gmail.com wrote: I made a metaclass to inherit __slots__ automatically. I think this feature should be included in builtin object's metaclass. I'd be ok with a metatype in the

Re: Another Little MySQL Problem

2010-05-26 Thread John Nagle
Alister wrote: I think you should probably also write your execute differently: clientCursor.execute('select ID from %s' , (personalDataTable,)) this ensures the parameters are correctly escaped to prevent mysql injection attacks,the , after personalDataTable is necessary to ensure the

Re: Another Little MySQL Problem

2010-05-26 Thread Christian Heimes
Actually, no. The names of tables are not quoted in SQL. One writes SELECT ID FROM mytable; not SELECT ID FROM mytable; nit picking mode: Some RDBMS support case sensitive table names. You have to quote the table name if you using the feature. Yeah I know, it's pretty

Re: atexit/signal for non-interactive jobs

2010-05-26 Thread Cameron Simpson
On 26May2010 20:19, kj no.em...@please.post wrote: | If I start the script interactively and after a few seconds (i.e. | before it terminates) I hit Ctrl-C (which sends a TERM signal to | the process), the wrapup function gets called as desired (although | this action appears to be triggered by

Re: Inheritable Slots Metaclass

2010-05-26 Thread Carl Banks
On May 26, 2:51 pm, geremy condra debat...@gmail.com wrote: On Wed, May 26, 2010 at 1:50 PM, Carl Banks pavlovevide...@gmail.com wrote: On May 26, 5:49 am, Rebel Lion r38311...@gmail.com wrote: I made a metaclass to inherit __slots__ automatically. I think this feature should be included

confusing error with nntplib

2010-05-26 Thread Eduardo Alvarez
When trying to use nntplib to connect to the news server nntp.aioe.org, a bizarre sequence of events occurs: 1) I import the module, and create an instance, as follows: s = nntplib.NNTP('nntp.aioe.org') I get no errors, which leads me to believe all went well. The I try fetching info on a

Re: Inheritable Slots Metaclass

2010-05-26 Thread Rebel Lion
I'd be ok with a metatype in the standard library that makes slots more transparent, but since slots are intended as an optimization, it doesn't really need (and might be detrimental to have) transparency for ordinary objects. But why there is __slots__ if it's not indeed needed. we should

Re: Inheritable Slots Metaclass

2010-05-26 Thread John Nagle
Rebel Lion wrote: I'd be ok with a metatype in the standard library that makes slots more transparent, but since slots are intended as an optimization, it doesn't really need (and might be detrimental to have) transparency for ordinary objects. But why there is __slots__ if it's not indeed

Re: Another Little MySQL Problem

2010-05-26 Thread Alister
On Wed, 26 May 2010 15:30:16 -0700, John Nagle wrote: Alister wrote: I think you should probably also write your execute differently: clientCursor.execute('select ID from %s' , (personalDataTable,)) this ensures the parameters are correctly escaped to prevent mysql injection

Re: Inheritable Slots Metaclass

2010-05-26 Thread Carl Banks
On May 26, 8:33 pm, Rebel Lion r38311...@gmail.com wrote: I'd be ok with a metatype in the standard library that makes slots more transparent, but since slots are intended as an optimization, it doesn't really need (and might be detrimental to have) transparency for ordinary objects. But

Re: UnicodeDecodeError having fetch web page

2010-05-26 Thread Kushal Kumaran
On Wed, May 26, 2010 at 11:40 PM, Rob Williscroft r...@rtw.me.uk wrote: Kushal Kumaran wrote in news:1274889564.2339.16.ca...@nitrogen in gmane.comp.python.general: On Tue, 2010-05-25 at 20:12 +, Rob Williscroft wrote: Barry wrote in news:83dc485a-5a20-403b-99ee-c8c627bdbab3

Re: Inheritable Slots Metaclass

2010-05-26 Thread Carl Banks
On May 26, 9:55 pm, Carl Banks pavlovevide...@gmail.com wrote: I don't want to sound to pessimistic about it, I really wouldn't mind a metaclass that makes slots more normal; but you have work to do. Just as a minor followup, I'll mention that slots and inheritance have some issues that aren't

Re: Kohonen neural network

2010-05-26 Thread alex23
Lex Lebedeff l...@from.hell wrote: Thanx, I've already googled this stuff. Rather unreadable and freaky code. Then please remember to mention what you've already seen tried when asking in the future, it saves us all from wasting each others time. --

AUSTRALIAN LEADERSHIP AWARDS SCHOLARSHIPS FOR THE YEAR 2010 - 2011 on http://scholarships-education.blogspot.com/2010/05/australian-leadership-awards.html SCHOLARSHIPS IN AUSTRALIA, UK, CANADA, PA

2010-05-26 Thread Naeem
AUSTRALIAN LEADERSHIP AWARDS SCHOLARSHIPS FOR THE YEAR 2010 - 2011 on http://scholarships-education.blogspot.com/2010/05/australian-leadership-awards.html SCHOLARSHIPS IN AUSTRALIA, UK, CANADA, PAKISTAN, AMERICA, EUROPEAN UNIONAUSTRALIAN LEADERSHIP AWARDS SCHOLARSHIPS FOR THE YEAR 2010 - 2011

[issue8819] variable resolution within exec() incorrect

2010-05-26 Thread Colin Hawkett
Colin Hawkett hawk...@gmail.com added the comment: Agreed, this is the same issue. I'll make my argument that this is a bug (intentional or otherwise) on that issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8819

[issue7150] datetime operations spanning MINYEAR give bad results

2010-05-26 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I'll take a look at this patch later today. -- assignee: belopolsky - mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7150

[issue4810] timeit needs official '--' flag

2010-05-26 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: This -- trick is implemented by the getopt module. OTOH on my system, 'grep' also recognizes this, and I could not find any documentation about it, neither with grep --help nor man grep. -- nosy: +amaury.forgeotdarc

[issue991196] An inconsistency with nested scopes

2010-05-26 Thread Colin Hawkett
Colin Hawkett hawk...@gmail.com added the comment: #8819 was closed as duplicate. That issue linked a description of the problem on stack overflow http://stackoverflow.com/questions/2904274/globals-and-locals-in-python-exec. I would like to argue that this is a bug, and should be fixed in

[issue8817] Expose round-to-nearest division algorithm in Objects/longobject.c

2010-05-26 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Ah, good point. I knew there was a reason I didn't like Py_XDECREF. I'll fix this and then apply this patch tonight. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8817

[issue8819] variable resolution within exec() incorrect

2010-05-26 Thread Colin Hawkett
Colin Hawkett hawk...@gmail.com added the comment: Apologies for raising it in the tracker against your advice. My thinking was that you were suggesting discussions about 3.x content shouldn't be in the tracker, and I wanted to argue that it is a bug and should be fixed in 2.6+ --

[issue8819] variable resolution within exec() incorrect

2010-05-26 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Hmm. To get this changed in 2.x you'd have to convince people that it really is a bug. You probably also need to do that very soon for there to be any hope of 2.7 having changed behaviour. I'd suggest bringing this up on the python-dev

[issue5689] please support lzma compression as an extension and in the tarfile module

2010-05-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: If the underlying library is LGPL, it would require us to distribute its sources along with the Windows binaries, which I'm not willing to do. Martin, this is wrong, you don't have to bundle the source *in* the object code package. Making it

[issue991196] An inconsistency with nested scopes

2010-05-26 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue991196 ___ ___

[issue5094] datetime lacks concrete tzinfo impl. for UTC

2010-05-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The second is whether we should take this opportunity to fix datetime being a C extension module exclusively. I know PyPy has their own pure Python version of datetime that they plan to eventually contribute. We might as well use this as the

[issue1731717] race condition in subprocess module

2010-05-26 Thread Stefan
Stefan s.ant...@telekom.de added the comment: I have exactly the same problem. Is there a thread-safe alternative to execute subprocesses in threads? -- nosy: +santoni ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1731717

[issue6312] httplib fails with HEAD requests to pages with transfer-encoding: chunked

2010-05-26 Thread Dirkjan Ochtman
Dirkjan Ochtman dirk...@ochtman.nl added the comment: The fix in r80583 is bad. It fails to close() the response (which previously worked as expected), meaning that the connection can't be re-used. (I ran into this because Gentoo has backported the 2.6-maint fixes to their 2.6.5

[issue6312] httplib fails with HEAD requests to pages with transfer-encoding: chunked

2010-05-26 Thread Senthil Kumaran
Senthil Kumaran orsent...@gmail.com added the comment: I am just reopening this, as per dcj's comment. -- resolution: fixed - accepted status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6312

[issue8781] 32-bit wchar_t doesn't need to be unsigned to be usable (I think)

2010-05-26 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Antoine Pitrou wrote: Antoine Pitrou pit...@free.fr added the comment: The problem with a signed Py_UNICODE is implicit sign extension (rather than zero extension) in some conversions, for example from char or unsigned char to

[issue991196] An inconsistency with nested scopes

2010-05-26 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I'm guessing that somewhere in the python source there is some code that goes [...] Unfortunately it's not nearly that simple. As I mentioned in my message on python-dev, the problem is that 'y' gets bound with a 'STORE_NAME' opcode,

[issue8822] datetime naive and aware types should have a well-defined definition that can be cross-referenced

2010-05-26 Thread anatoly techtonik
New submission from anatoly techtonik techto...@gmail.com: 'naive' and 'aware' are key datetime types - they need a proper definition and anchor for crossrefences. If you take a look at http://docs.python.org/library/datetime.html - the definition of distinction between them is too vague and

[issue2810] _winreg.EnumValue sometimes raises WindowsError (More data is available)

2010-05-26 Thread Brian Curtin
Brian Curtin cur...@acm.org added the comment: Committed to trunk in r81517 and release26-maint in r81540. I'll cover the 3.x stuff today and then close it out. -- assignee: stutzbach - brian.curtin resolution: - fixed stage: patch review - committed/rejected

[issue8823] urllib2 does not catch httplib.BadStatusLine

2010-05-26 Thread AdamN
New submission from AdamN a...@varud.com: When running urllib2 and getting a BadStatus from an http server, this error is raised: File /var/www/pinax-env/pline/apps/page/models.py, line 303, in render content = urllib2.urlopen(self.url,timeout=10).read() File

[issue8823] urllib2 does not catch httplib.BadStatusLine

2010-05-26 Thread AdamN
Changes by AdamN a...@varud.com: -- versions: +Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8823 ___ ___ Python-bugs-list mailing list

  1   2   >