[ANNOUNCE] PyGObject 2.26.0 - stable release

2010-09-28 Thread John Palmieri
I am pleased to announce version 2.26.0 of the Python bindings for GObject. Including the stable improvements in the base pygobject modules this is the first stable release to include the Introspection modules. These new modules are considered beta quality and we don't guarantee API

Python Ireland presents October Talks @ Science Gallery (Wed 13th Oct, 19:00)

2010-09-28 Thread Vicky Twomey-Lee
Hi All, When: Wed 13th Oct, 2010 (19:00 - 21:00) Where: The Science Gallery What: - Database madness with mongoengine and SQLAlchemy - Jaime Buelta - Buildout - Diarmuid Bourke - Pub afterwards - Trinity Capital Hotel This event is free and all levels are welcome. More details -

bzr 2.2.1 released !

2010-09-28 Thread Vincent Ladeuil
The Bazaar team is happy to announce availability of a new release of the bzr adaptive version control system. Bazaar is part of the GNU system http://gnu.org/. This is a bugfix release which also includes bugfixes from 2.0.6 and 2.1.3. None are critical, but upgrading is recommended for all

[ANN] (probably) last version of Pylint supporting python 2.3 released

2010-09-28 Thread Sylvain Thénault
Hi there! As someone stuck with python 2.3 tried to use pylint, we made some fixes to get python 2.3 supports back. This resulted in the release of pylint 0.21.3, logilab-astng 0.20.3 and logilab-common 0.52 today. At the time of porting pylint to py3k, this will much probably be the latest set

Pyro 4.2 released!

2010-09-28 Thread Irmen de Jong
Pyro 4.2 - I'm pleased to announce the release of Pyro 4.2! Detailed info here: http://www.razorvine.net/python/Pyro Download here: http://www.xs4all.nl/~irmen/pyro4/download/ Python package index entry: http://pypi.python.org/pypi/Pyro4 License: MIT software license. Note: Pyro 4 is

tix problem in ubuntu karmic

2010-09-28 Thread harryos
hi I posted this question in ubuntu users forum but no help was forthcoming.. I hope someone can help me here. I had been using jaunty as o.s and was coding in python 2.6. While using Tix widgets in my code I came across a bug as mentioned in

Re: Nautilus Python

2010-09-28 Thread Wayne Brehaut
On Mon, 27 Sep 2010 20:57:09 -0700 (PDT), Peter peter.milli...@gmail.com wrote: On Sep 28, 12:31 pm, Steven D'Aprano steve-REMOVE- t...@cybersource.com.au wrote: On Mon, 27 Sep 2010 15:28:34 -0700, Eduardo Ribeiro wrote: But it doesn't work. What do you mean doesn't work? - It crashes the

Re: Introducing Kids to Programming: 2 or 3?

2010-09-28 Thread Wayne Brehaut
On Mon, 27 Sep 2010 12:45:44 -0400, Andreas Waldenburger use...@geekmail.invalid wrote: On Mon, 27 Sep 2010 17:48:06 +0200 Marco Gallotta ma...@gallotta.co.za wrote: Since these are kids, we feel the nice changes in 3 such as removing integer division will help in teaching. It will also remove

How to match where the search started?

2010-09-28 Thread Florian Kaufmann
From the documentation: 7.2.4. Regular Expression Objects, search(string[, pos[, endpos]]) ... the '^' pattern character matches at the real beginning of the string and at positions just after a newline, but not necessarily at the index where the search is to start But I'd like to do just

Re: How to match where the search started?

2010-09-28 Thread Florian Kaufmann
The thing is that the (\=|...) group is not really part of the match. I think this gives you more the idea what I want reo = re.compile( r'(\=|.)...' ); while True mo = reo.search(text,pos) if not mo: break if text[mo.start()] == '\\' # a pseudo match. continue after the backslash

Re: How to match where the search started?

2010-09-28 Thread Florian Kaufmann
The thing is that the (\=|...) group is not really part of the match. I think this gives you more the idea what I want reo = re.compile( r'(\=|.)...' ); while True mo = reo.search(text,pos) if not mo: break if text[mo.start()] == '\\' # a pseudo match. continue after the backslash

Re: Strong typing vs. strong testing

2010-09-28 Thread Malcolm McLean
On Sep 27, 7:46 pm, namekuseijin namekusei...@gmail.com wrote: On 27 set, 05:46, TheFlyingDutchman zzbba...@aol.com wrote: Fact is: almost all user data from the external words comes into programs as strings. No typesystem or compiler handles this fact all that graceful...- Hide quoted text

Re: Strong typing vs. strong testing

2010-09-28 Thread Malcolm McLean
On Sep 27, 9:29 pm, p...@informatimago.com (Pascal J. Bourguignon) wrote: On the other hand, with the dynamic typing mindset, you might even wrap your values (of whatever numerical type) in a symbolic expression mentionning the unit and perhaps other meta data, so that when the other module

About __class__ of an int literal

2010-09-28 Thread AlexWalk
In python 3.1.2(I'm using windows edition, 32bit), accessing __class__ of an int literal will raise a SyntaxException, while other literals will not. For example. 1.__class__ is an error, while 1.1.__class__ runs ok. I searched the python issue tracker but failed to find relevant reports. I

Re: Strong typing vs. strong testing

2010-09-28 Thread Richard
Malcolm McLean malcolm.mcle...@btinternet.com writes: On Sep 27, 9:29 pm, p...@informatimago.com (Pascal J. Bourguignon) wrote: On the other hand, with the dynamic typing mindset, you might even wrap your values (of whatever numerical type) in a symbolic expression mentionning the unit and

Re: Strong typing vs. strong testing

2010-09-28 Thread Tim Bradshaw
On 2010-09-28 10:55:19 +0100, Malcolm McLean said: I'd like to design a language like this. If you add a quantity in inches to a quantity in centimetres you get a quantity in (say) metres. If you multiply them together you get an area, if you divide them you get a dimeionless scalar. If you

Re: About __class__ of an int literal

2010-09-28 Thread Tim Golden
On 28/09/2010 10:27, AlexWalk wrote: In python 3.1.2(I'm using windows edition, 32bit), accessing __class__ of an int literal will raise a SyntaxException, while other literals will not. For example. 1.__class__ is an error, while 1.1.__class__ runs ok. I searched the python issue tracker

Re: Strong typing vs. strong testing

2010-09-28 Thread BartC
Malcolm McLean malcolm.mcle...@btinternet.com wrote in message news:1d6e115c-cada-46fc-9444-01e80e0af...@c10g2000yqh.googlegroups.com... On Sep 27, 9:29 pm, p...@informatimago.com (Pascal J. Bourguignon) wrote: On the other hand, with the dynamic typing mindset, you might even wrap your

Re: Strong typing vs. strong testing

2010-09-28 Thread Albert van der Horst
In article 87fwwvrnmf@kuiper.lan.informatimago.com, Pascal J. Bourguignon p...@informatimago.com wrote: namekuseijin namekusei...@gmail.com writes: in C I can have a function maximum(int a, int b) that will always work. Never blow up, and never give an invalid answer. If someone tries to

Re: Strong typing vs. strong testing

2010-09-28 Thread Malcolm McLean
On Sep 28, 12:19 pm, Tim Bradshaw t...@tfeb.org wrote: There are several existing systems which do this.  The HP48 (and descendants I expect) support units which are essentially dimensions.  I don't remember if it signals errors for incoherent dimensions.   Mathematica also has some units

Re: How to match where the search started?

2010-09-28 Thread Thomas Jollans
On Tuesday 28 September 2010, it occurred to Florian Kaufmann to exclaim: From the documentation: 7.2.4. Regular Expression Objects, search(string[, pos[, endpos]]) ... the '^' pattern character matches at the real beginning of the string and at positions just after a newline, but not

Re: Strong typing vs. strong testing

2010-09-28 Thread Tim Bradshaw
On 2010-09-28 14:39:27 +0100, Malcolm McLean said: he problem is that if you allow expressions rather than terms then the experssions can get arbitrarily complex. sqrt(1 inch + 1 Second), for instance. I can't imagine a context where 1 inch + 1 second would not be an error, so this is a

Re: How to match where the search started?

2010-09-28 Thread MRAB
On 28/09/2010 09:10, Florian Kaufmann wrote: From the documentation: 7.2.4. Regular Expression Objects, search(string[, pos[, endpos]]) ... the '^' pattern character matches at the real beginning of the string and at positions just after a newline, but not necessarily at the index where the

Re: relative imports and sub-module execution

2010-09-28 Thread Diez B. Roggisch
King animator...@gmail.com writes: Hi, After reading couple of docs and articles, I have implemented a simple test package with nested modules. When running main.py, everything is working fine. Some of my sub- modules has some small test routines for debug purpose. It's because I am using

Re: minimal D: need software testers

2010-09-28 Thread Brian Curtin
On Mon, Sep 27, 2010 at 10:07, Kruptein darragh@gmail.com wrote: Hey, I've released the second alpha for minimal-D a program I've written in python which should make developing easier. I need people to test the app on bugs and give ideas. It is written in python using the wxPython

Re: How to match where the search started?

2010-09-28 Thread Florian Kaufmann
If you want to anchor the regex at the start position 'pos' then use the 'match' method instead. The wickedly problem is that matching at position 'pos' is not a requirement, its an option. Look again at my 2nd example, the r'(\=|.)...' part, which (of course wrongly) assumes that \= means

Re: Strong typing vs. strong testing

2010-09-28 Thread Niklas Holsti
Albert van der Horst wrote: In article 87fwwvrnmf@kuiper.lan.informatimago.com, ... I would even go further. Types are only part of the story. You may distinguish between integers and floating points, fine. But what about distinguishing between floating points representing lengths and

Re: tix problem in ubuntu karmic

2010-09-28 Thread Jeff Hobbs
On Sep 27, 11:30 pm, harryos oswald.ha...@gmail.com wrote: I had been using  jaunty as o.s and was coding in python 2.6. While using Tix widgets in my code I came across a bug as mentioned in https://bugs.launchpad.net/ubuntu/+source/tix/+bug/371720 ... So ,I  thought upgrading to karmic

[ANN] (probably) last version of Pylint supporting python 2.3 released

2010-09-28 Thread Sylvain Thénault
Hi there! As someone stuck with python 2.3 tried to use pylint, we made some fixes to get python 2.3 supports back. This resulted in the release of pylint 0.21.3, logilab-astng 0.20.3 and logilab-common 0.52 today. At the time of porting pylint to py3k, this will much probably be the latest set

Re: toy list processing problem: collect similar terms

2010-09-28 Thread Xah Lee
On Sep 27, 9:34 pm, John Bokma j...@castleamber.com wrote: Seebs usenet-nos...@seebs.net writes: fup set to poster On 2010-09-28, John Bokma j...@castleamber.com wrote: Seebs usenet-nos...@seebs.net writes: On 2010-09-26, J?rgen Exner jurge...@hotmail.com wrote: It was livibetter who

Re: How to match where the search started?

2010-09-28 Thread MRAB
On 28/09/2010 17:32, Florian Kaufmann wrote: If you want to anchor the regex at the start position 'pos' then use the 'match' method instead. The wickedly problem is that matching at position 'pos' is not a requirement, its an option. Look again at my 2nd example, the r'(\=|.)...' part, which

Re: (and scheme lisp) x Python and modern langs [was Re: gossip, Guy Steel, Lojban, Racket]

2010-09-28 Thread Xah Lee
xah wrote: in anycase, how's “do” not imperative? On Sep 28, 6:27 am, namekuseijin namekusei...@gmail.com wrote: how's “do” a “named let”? can you show example or reference of that proposal? (is it worthwhile?) I'll post it again in the hope you'll read this time: (do ((i 0 (+ 1 i))  ;

Re: Strong typing vs. strong testing

2010-09-28 Thread Thomas A. Russ
Malcolm McLean malcolm.mcle...@btinternet.com writes: I'd like to design a language like this. If you add a quantity in inches to a quantity in centimetres you get a quantity in (say) metres. If you multiply them together you get an area, if you divide them you get a dimeionless scalar. If

Re: toy list processing problem: collect similar terms

2010-09-28 Thread John Bokma
Xah Lee xah...@gmail.com writes: can you stop this? Can you stop crossposting? And if there is really, really a need to crosspost, can you please set the follow-up to? doesn't seems fruitful to keep on this. if you don't like my posts, ignore them? i don't post in comp.lang.python or

Re: Strong typing vs. strong testing

2010-09-28 Thread George Neuner
On 28 Sep 2010 12:42:40 GMT, Albert van der Horst alb...@spenarnc.xs4all.nl wrote: I would say the dimensional checking is underrated. It must be complemented with a hard and fast rule about only using standard (SI) units internally. Oil output internal : m^3/sec Oil output printed:

Re: Strong typing vs. strong testing

2010-09-28 Thread MRAB
On 28/09/2010 19:21, George Neuner wrote: On 28 Sep 2010 12:42:40 GMT, Albert van der Horst alb...@spenarnc.xs4all.nl wrote: I would say the dimensional checking is underrated. It must be complemented with a hard and fast rule about only using standard (SI) units internally. Oil output

list problem...

2010-09-28 Thread Rog
Hi all, Have been grappling with a list problem for hours... a = [2, 3, 4, 5,.] b = [4, 8, 2, 6,.] Basicly I am trying to place a[0], b[0] in a seperate list IF a[2] and b[2] is present. I have tried sets, zip etc with no success. I am tackling Euler projects with Python 3.1, with minimal

Re: list problem...

2010-09-28 Thread Shashwat Anand
On Wed, Sep 29, 2010 at 12:14 AM, Rog r...@pynguins.com wrote: Hi all, Have been grappling with a list problem for hours... a = [2, 3, 4, 5,.] b = [4, 8, 2, 6,.] Basicly I am trying to place a[0], b[0] in a seperate list IF a[2] and b[2] is present. You are not exactly clear with

Re: list problem...

2010-09-28 Thread geremy condra
On Tue, Sep 28, 2010 at 11:44 AM, Rog r...@pynguins.com wrote: Hi all, Have been grappling with a list problem for hours... a = [2, 3, 4, 5,.] b = [4, 8, 2, 6,.] Basicly I am trying to place a[0], b[0] in a seperate list IF a[2] and b[2] is present. I have tried sets, zip etc with

Reoedering indexes in list of list

2010-09-28 Thread Toto
Hello, I have a list of list assume myList[x][y] is integer I would like to create an alias to that list which I could call this way: alias[y][x] returns myList[x][y] how can I do that ? (python 2.6) (I have a feeling I should use 'property' ;) Thanks, -- --

Re: Reoedering indexes in list of list

2010-09-28 Thread Chris Rebert
On Tue, Sep 28, 2010 at 11:55 AM, Toto emays...@gmail.com wrote: Hello, I have a list of list assume myList[x][y] is integer I would like to create an alias to that list which I could call this way: alias[y][x] returns myList[x][y] If your alias can be read-only: alias = zip(*myList)

Re: toy list processing problem: collect similar terms

2010-09-28 Thread Paul Rubin
John Bokma j...@castleamber.com writes: Xah Lee xah...@gmail.com writes: ... Can you stop crossposting? John, can you ALSO stop crossposting? -- http://mail.python.org/mailman/listinfo/python-list

Re: list problem...

2010-09-28 Thread Rog
On Tue, 28 Sep 2010 11:59:08 -0700, geremy condra wrote: On Tue, Sep 28, 2010 at 11:44 AM, Rog r...@pynguins.com wrote: Hi all, Have been grappling with a list problem for hours... a = [2, 3, 4, 5,.] b = [4, 8, 2, 6,.] Basicly I am trying to place a[0], b[0] in a seperate list IF

Re: Strong typing vs. strong testing

2010-09-28 Thread Nick
t...@sevak.isi.edu (Thomas A. Russ) writes: Malcolm McLean malcolm.mcle...@btinternet.com writes: I'd like to design a language like this. If you add a quantity in inches to a quantity in centimetres you get a quantity in (say) metres. If you multiply them together you get an area, if you

Re: Strong typing vs. strong testing

2010-09-28 Thread Keith Thompson
George Neuner gneun...@comcast.net writes: On 28 Sep 2010 12:42:40 GMT, Albert van der Horst alb...@spenarnc.xs4all.nl wrote: I would say the dimensional checking is underrated. It must be complemented with a hard and fast rule about only using standard (SI) units internally. Oil output

Re: Reoedering indexes in list of list

2010-09-28 Thread Toto
If your alias can be read-only: alias = zip(*myList) a=[['00','01'],['10','11']] l=zip(*a) print(l) returns... [('00', '10'), ('01', '11')] IS NOT AT ALL WHAT I WANT ;-) What I want is print a[1][0] '10' but print l[1][0] '01' notice the indexes of the list l are inverted... --

Re: Python 2.7 installation problem

2010-09-28 Thread Ned Deily
In article aanlktim=kdpmjm84fi+ez4jmsmab_znwgarruntur...@mail.gmail.com, Ronald Guida odd...@gmail.com wrote: Sorry, I have one additional piece of information that might be helpful to others. I have discovered that the *.so files that were not installed, were actually installed to the

Re: Reoedering indexes in list of list

2010-09-28 Thread Toto
again I want: alias[y][x] returns myList[x][y] print a[1][0] '10' but print l[1][0] '01' notice the indexes  of the list l are inverted... -- http://mail.python.org/mailman/listinfo/python-list

Re: Reoedering indexes in list of list

2010-09-28 Thread Toto
heu the zip trick actually works... my mistake! -- http://mail.python.org/mailman/listinfo/python-list

Re: [ctpug] Introducing Kids to Programming: 2 or 3?

2010-09-28 Thread Piet Delport
On Mon, Sep 27, 2010 at 5:48 PM, Marco Gallotta ma...@gallotta.co.zawrote: We received a grant from Google to reach 1,000 kids in South Africa with our course in 2011. People have also shown interest in running the course in Croatia, Poland and Egypt. We're also eyeing developing African

Re: Reoedering indexes in list of list

2010-09-28 Thread Arnaud Delobelle
Toto emays...@gmail.com writes: If your alias can be read-only: alias = zip(*myList) a=[['00','01'],['10','11']] l=zip(*a) print(l) returns... [('00', '10'), ('01', '11')] IS NOT AT ALL WHAT I WANT ;-) What I want is print a[1][0] '10' but print l[1][0] '01' notice the

Re: About __class__ of an int literal

2010-09-28 Thread Stefan Schwarzer
Hello Alex, On 2010-09-28 11:27, AlexWalk wrote: In python 3.1.2(I'm using windows edition, 32bit), accessing __class__ of an int literal will raise a SyntaxException, while other literals will not. For example. 1.__class__ is an error, while 1.1.__class__ runs ok. I searched the python

Re: About __class__ of an int literal

2010-09-28 Thread Hans Mulder
Tim Golden wrote: On 28/09/2010 10:27, AlexWalk wrote: In python 3.1.2(I'm using windows edition, 32bit), accessing __class__ of an int literal will raise a SyntaxException, while other literals will not. For example. 1.__class__ is an error, while 1.1.__class__ runs ok. I searched the

Re: list problem...

2010-09-28 Thread Shashwat Anand
On Wed, Sep 29, 2010 at 1:15 AM, rog r...@pynguins.com wrote: Shashwat Anand wrote: On Wed, Sep 29, 2010 at 12:14 AM, Rog r...@pynguins.com mailto: r...@pynguins.com wrote: Hi all, Have been grappling with a list problem for hours... a = [2, 3, 4, 5,.] b = [4, 8, 2,

Re: toy list processing problem: collect similar terms

2010-09-28 Thread John Bokma
Paul Rubin no.em...@nospam.invalid writes: John Bokma j...@castleamber.com writes: Xah Lee xah...@gmail.com writes: ... Can you stop crossposting? John, can you ALSO stop crossposting? Since the issue is on-topic in all groups: no. I did set a follow-up header, which you ignored and on

Pyro 4.2 released

2010-09-28 Thread Irmen de Jong
Pyro 4.2 - I'm pleased to announce the release of Pyro 4.2! Detailed info here: http://www.razorvine.net/python/Pyro Download here: http://www.xs4all.nl/~irmen/pyro4/download/ Python package index entry: http://pypi.python.org/pypi/Pyro4 License: MIT software license. Note: Pyro 4 is

Re: Strong typing vs. strong testing

2010-09-28 Thread Tim Rowe
On 27 September 2010 18:46, namekuseijin namekusei...@gmail.com wrote: Fact is:  almost all user data from the external words comes into programs as strings. Sorry, sent this to the individual, not the group. I'd be very surprised if that were true. I suspect the majority of programs are in

JSONBOT 0.4 RELEASED

2010-09-28 Thread Bart Thate
Yesterday i pushed version 0.4 of JSONBOT to pypi and googlecode. This version has a rewritten core that makes it easier to develop bots for and has lots of bugs fixed. A karma plugin was added as well as a silent mode that forwards bot responses to /msg. You can grab a copy on

function decorators

2010-09-28 Thread Nick Donohue
I came across this code just now: def time_me(function): def wrap(*arg): start = time.time() r = function(*arg) end = time.time() print %s (%0.3f ms) %(function.func_name, (end-start)*1000) return wrap @time_me def some_function(somearg) some_function(arg) I've been looking

Re: Strong typing vs. strong testing

2010-09-28 Thread Erik Max Francis
Malcolm McLean wrote: On Sep 27, 9:29 pm, p...@informatimago.com (Pascal J. Bourguignon) wrote: On the other hand, with the dynamic typing mindset, you might even wrap your values (of whatever numerical type) in a symbolic expression mentionning the unit and perhaps other meta data, so that

Re: function decorators

2010-09-28 Thread Seebs
On 2010-09-28, Nick Donohue ndono...@gmail.com wrote: why would I use these? wouldn't it be more flexible to not write the decorator before the function definition, so I could choose to wrap it or not? The utility is that it lets you modify all calls to a function at once, without changing all

Re: function decorators

2010-09-28 Thread Diez B. Roggisch
Nick Donohue ndono...@gmail.com writes: I came across this code just now: def time_me(function): def wrap(*arg): start = time.time() r = function(*arg) end = time.time() print %s (%0.3f ms) %(function.func_name, (end-start)*1000) return wrap @time_me def

Re: function decorators

2010-09-28 Thread Ian Kelly
On Tue, Sep 28, 2010 at 4:02 PM, Nick Donohue ndono...@gmail.com wrote: I came across this code just now: def time_me(function): def wrap(*arg): start = time.time() r = function(*arg) end = time.time() print %s (%0.3f ms) %(function.func_name, (end-start)*1000) return wrap

Upload files with wsgi

2010-09-28 Thread Hidura
Hello, i have a project on Python3k, and i have a very big problem i don' t find how take an upload file i am using the wsgiref lib, and or theres any way to connect to the client in order to get the file by myself? Thank you Diego Hidalgo. -- Enviado desde mi dispositivo móvil Diego I.

Re: (and scheme lisp) x Python and modern langs [was Re: gossip, Guy Steel, Lojban, Racket]

2010-09-28 Thread Xah Lee
2010-09-28 On Sep 28, 12:07 pm, namekuseijin namekusei...@gmail.com wrote: On 28 set, 14:56, Xah Lee xah...@gmail.com wrote: ultimately, all lang gets transformed at the compiler level to become machine instructions, which is imperative programing in the ultimate sense. You say that

Re: Upload files with wsgi

2010-09-28 Thread John Nagle
On 9/28/2010 3:31 PM, Hidura wrote: Hello, i have a project on Python3k, and i have a very big problem i don' t find how take an upload file i am using the wsgiref lib, and or theres any way to connect to the client in order to get the file by myself? Thank you Diego Hidalgo. This is not

utf-8 and ctypes

2010-09-28 Thread Brendan Miller
I'm using python 2.5. Currently I have some python bindings written in ctypes. On the C side, my strings are in utf-8. On the python side I use ctypes.c_char_p to convert my strings to python strings. However, this seems to break for non-ascii characters. It seems that characters not in the

Re: Strong typing vs. strong testing

2010-09-28 Thread Keith Thompson
Erik Max Francis m...@alcyone.com writes: [...] print c # floating point accuracy aside 299792458.0 m/s Actually, the speed of light is exactly 299792458.0 m/s by definition. (The meter and the second are defined in terms of the same wavelength of light; this was changed relatively

partial sums problem

2010-09-28 Thread kj
The following attempt to get a list of partial sums fails: s = 0 [((s += t) and s) for t in range(1, 10)] File stdin, line 1 [((s += t) and s) for t in range(1, 10)] ^ SyntaxError: invalid syntax What's the best way to get a list of partial sums? TIA! kj --

Re: partial sums problem

2010-09-28 Thread Gary Herron
On 09/28/2010 03:57 PM, kj wrote: The following attempt to get a list of partial sums fails: s = 0 [((s += t) and s) for t in range(1, 10)] File stdin, line 1 [((s += t) and s) for t in range(1, 10)] ^ SyntaxError: invalid syntax What's the best way to get a

Re: Upload files with wsgi

2010-09-28 Thread Hidura
I am trying to upload any type of file ext to an app written in Py3k, using Apache+mod_wsgi i can't use django or cherryPy because i manage the data in the request creating an xml to store the data from selected areas and send it to the server. I am using the wsgiref library to handle the request

Re: utf-8 and ctypes

2010-09-28 Thread MRAB
On 28/09/2010 23:54, Brendan Miller wrote: I'm using python 2.5. Currently I have some python bindings written in ctypes. On the C side, my strings are in utf-8. On the python side I use ctypes.c_char_p to convert my strings to python strings. However, this seems to break for non-ascii

Re: partial sums problem

2010-09-28 Thread Emile van Sebille
On 9/28/2010 3:57 PM kj said... The following attempt to get a list of partial sums fails: s = 0 [((s += t) and s) for t in range(1, 10)] File stdin, line 1 [((s += t) and s) for t in range(1, 10)] ^ SyntaxError: invalid syntax What's the best way to get a list of

Re: partial sums problem

2010-09-28 Thread MRAB
On 28/09/2010 23:57, kj wrote: The following attempt to get a list of partial sums fails: s = 0 [((s += t) and s) for t in range(1, 10)] File stdin, line 1 [((s += t) and s) for t in range(1, 10)] ^ SyntaxError: invalid syntax What's the best way to get a list of partial

Re: partial sums problem

2010-09-28 Thread Seebs
On 2010-09-28, Gary Herron gher...@digipen.edu wrote: Python does have s+=t as a statement, and it does have list comprehensions [... for ...] as expressions, but you cannot put a statement inside an expression. I've inferred that, in Python, all assignments are by definition statements,

Re: partial sums problem

2010-09-28 Thread Ian Kelly
On Tue, Sep 28, 2010 at 4:57 PM, kj no.em...@please.post wrote: The following attempt to get a list of partial sums fails: s = 0 [((s += t) and s) for t in range(1, 10)] File stdin, line 1 [((s += t) and s) for t in range(1, 10)] ^ SyntaxError: invalid syntax Because in

Re: Strong typing vs. strong testing

2010-09-28 Thread Rob Warnock
EXECUTIVE SUMMARY: 1 inch + 1 second = ~4.03e38 grams. GORY DETAILS: Tim Bradshaw t...@tfeb.org wrote: +--- | Malcolm McLean said: | he problem is that if you allow expressions rather than terms then | the experssions can get arbitrarily complex. sqrt(1 inch + 1 Second), |

Re: About __class__ of an int literal

2010-09-28 Thread Terry Reedy
On 9/28/2010 5:27 AM, AlexWalk wrote: In python 3.1.2(I'm using windows edition, 32bit), accessing __class__ of an int literal will raise a SyntaxException, while other literals will not. For example. 1.__class__ is an error, while 1.1.__class__ runs ok. Third solution: type(0) is 0

Re: Strong typing vs. strong testing

2010-09-28 Thread Chris Rebert
On Tue, Sep 28, 2010 at 2:55 AM, Malcolm McLean malcolm.mcle...@btinternet.com wrote: On Sep 27, 9:29 pm, p...@informatimago.com (Pascal J. Bourguignon) wrote: On the other hand, with the dynamic typing mindset, you might even wrap your values (of whatever numerical type) in a symbolic

Re: function decorators

2010-09-28 Thread Terry Reedy
On 9/28/2010 6:02 PM, Nick Donohue wrote: I came across this code just now: def time_me(function): def wrap(*arg): start = time.time() r = function(*arg) end = time.time() print %s (%0.3f ms) %(function.func_name, (end-start)*1000) return wrap @time_me def

Re: partial sums problem

2010-09-28 Thread Terry Reedy
On 9/28/2010 6:57 PM, kj wrote: The following attempt to get a list of partial sums fails: s = 0 [((s += t) and s) for t in range(1, 10)] File stdin, line 1 [((s += t) and s) for t in range(1, 10)] ^ SyntaxError: invalid syntax What's the best way to get a list of

Request For Comments: Learn Python The Hard Way

2010-09-28 Thread Zed Shaw
Hi Everyone, I rarely post to the list, but I'm getting near the end of the book I wrote to help people learn Python and I would like some feedback on it if you please: * Web: http://learnpythonthehardway.org/ * PDF: http://learnpythonthehardway.org/static/LearnPythonTheHardWay.pdf The book so

Re: About __class__ of an int literal

2010-09-28 Thread MRAB
On 29/09/2010 01:19, Terry Reedy wrote: On 9/28/2010 5:27 AM, AlexWalk wrote: In python 3.1.2(I'm using windows edition, 32bit), accessing __class__ of an int literal will raise a SyntaxException, while other literals will not. For example. 1.__class__ is an error, while 1.1.__class__ runs ok.

Re: Request For Comments: Learn Python The Hard Way

2010-09-28 Thread Matty Sarro
Cool idea! I'll gladly take a look and get back to you. -Matthew On Tue, Sep 28, 2010 at 9:18 PM, Zed Shaw zed.s...@gmail.com wrote: Hi Everyone, I rarely post to the list, but I'm getting near the end of the book I wrote to help people learn Python and I would like some feedback on it if

Re: Strong typing vs. strong testing

2010-09-28 Thread George Neuner
On Tue, 28 Sep 2010 12:15:07 -0700, Keith Thompson ks...@mib.org wrote: George Neuner gneun...@comcast.net writes: On 28 Sep 2010 12:42:40 GMT, Albert van der Horst alb...@spenarnc.xs4all.nl wrote: I would say the dimensional checking is underrated. It must be complemented with a hard and fast

Example or recomendation of a webserver

2010-09-28 Thread Hidura
I am working on a web project written on Py3k and using mod_wsgi on the Apache that have to recibes the request client via a xml structure and i am facing a lot of troubles with the upload files mainly because i can' t see where they are, so i' ve decide to write my own web server-django and the

Re: Example or recomendation of a webserver

2010-09-28 Thread Seebs
On 2010-09-29, Hidura hid...@gmail.com wrote: I am working on a web project written on Py3k and using mod_wsgi on the Apache that have to recibes the request client via a xml structure and i am facing a lot of troubles with the upload files mainly because i can' t see where they are, so i' ve

[issue9441] increase logging handlers test coverage

2010-09-28 Thread Vinay Sajip
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment: You're right about there not being tests, but if there had been, they would be using the PyWin32 libraries as well and so would need to be reimplemented (if the purpose is to remove the dependency). Perhaps ctypes would be an alternative

[issue9959] int(math.log(4,2)) == 1 instead of 2

2010-09-28 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I've tweaked the loghelper algorithm in r85048. Looking at [n for n in range(100) if log(2**n) != n], I get: Python 3.1: 14 bad values out of 1st 100; first is 29 Python 3.2 (patched): 10 bad values; first is 29 Python 3.2 (unpatched): 25

[issue9959] int(math.log(4,2)) == 1 instead of 2

2010-09-28 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: [n for n in range(100) if log(2**n) != n] Should be: [n for n in range(100) if log(2**n, 2) != n] -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9959

[issue9967] encoded_word regular expression in email.header.decode_header()

2010-09-28 Thread Ned Deily
Changes by Ned Deily n...@acm.org: -- nosy: +barry, r.david.murray stage: - patch review versions: -Python 2.5, Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9967 ___

[issue9950] socket.sendall() crash when receiving a signal

2010-09-28 Thread Ned Deily
Changes by Ned Deily n...@acm.org: Removed file: http://bugs.python.org/file19042/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9950 ___ ___

[issue9961] Identity Crisis! variable assignment using strftime fails comparison test.

2010-09-28 Thread Bill Hawkes
Bill Hawkes williamhawke...@yahoo.com added the comment: Yes, it is working now. Thanks for the timely response. In looking at the tutorial, the only strings used with boolean operators ( | | == | = | = | !=) were strings of the numeric variety. I saw no examples using words. I know the

[issue4111] Add Systemtap/DTrace probes

2010-09-28 Thread Mark Wielaard
Mark Wielaard m...@redhat.com added the comment: - renamed the probepoints: function__entry - frame__entry function__return - frame__exit as I believe this better describes what these do Are you sure you want to do this? You are right that it better describes the action

[issue9602] PyObject_AsCharBuffer() should only accept read-only objects

2010-09-28 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Le mardi 28 septembre 2010 à 03:11 +, Lenard Lindstrom a écrit : Let's consider Pygame, and the SDL surface it wraps as a pygame.Surface. Pygame exposes a surface's data through the buffer protocol for manipulation by a NumPy array. Now

[issue9968] Let cgi.FieldStorage have named uploaded file

2010-09-28 Thread phep
New submission from phep patrice.pil...@teletopie.net: Hi, Presently, in cgi.FieldStorage, uploaded file are accessible through a file-like object created by a call to tempfile.TemporaryFile(), probably in order to ensure the file is deleted when the process terminates. The problem is that

[issue9968] Let cgi.FieldStorage have named uploaded file

2010-09-28 Thread phep
phep patrice.pil...@teletopie.net added the comment: Oops. I forgot to aknowledge the fact that presently cgi.FieldStorage class documentation (but not the cgi module documentation) tells about the possibility to override the make_file() method in a user subclass to change the present

[issue8098] PyImport_ImportModuleNoBlock() may solve problems but causes others.

2010-09-28 Thread MunSic JEONG
Changes by MunSic JEONG rus...@gmail.com: -- nosy: +ruseel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8098 ___ ___ Python-bugs-list mailing

[issue4111] Add Systemtap/DTrace probes

2010-09-28 Thread anatoly techtonik
anatoly techtonik techto...@gmail.com added the comment: I don't understand the last request. Is there already a practice to depend on patches that were applied by people, but were not released, reviewed or documented in some PEP? -- ___ Python

[issue7980] time.strptime not thread safe

2010-09-28 Thread MunSic JEONG
Changes by MunSic JEONG rus...@gmail.com: -- nosy: +ruseel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7980 ___ ___ Python-bugs-list mailing

  1   2   >