Release of PyGreSQL 4.0 (update)

2009-01-03 Thread D'Arcy J.M. Cain
Update: The Windows binaries are now available on the web site. We are please to announce the release of PyGreSQL 4.0. his is a major release and you should check it carefully before using in existing applications. There may be some incompatibilities. PyGreSQL is a Python module that

Re: Is there a better algorithm?

2009-01-03 Thread Hendrik van Rooyen
bearophile wrote: Fuzzyman: for i in l: u = None if len(i) == 2: k, v = i else: k, u, v = i That's the best solution I have seen in this thread so far (but I suggest to improve indents and use better variable names). In programming it's generally better to follow the KISS

patch

2009-01-03 Thread Pavel Kosina
Týká se to Pythonu okrajově, přesto to dávám sem. Myslím, že by se mohlo hodit i ostatním, kdo chtějí zkoušet pod Windows nové věci z development verze: Jak opatchovat (pythonýrský) soubor pod Windows? Co jsem udělal: 1/ stáhl jsem http://gnuwin32.sourceforge.net/packages/patch.htm 2/

ACL in python

2009-01-03 Thread John Boloshevich
Hello, does anybody know about an ACL implementation for python, which is not tied to the filesystem? I would like to use ACL on different objects not on files, so the POSIX file access solution is not the one I am looking for. I would like to be able to define ACOs, AROs, but it would be even

Re: Why not Ruby?

2009-01-03 Thread Marc 'BlackJack' Rintsch
On Fri, 02 Jan 2009 09:00:01 -0800, r wrote: On Jan 2, 6:45 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Thu, 01 Jan 2009 17:38:02 -0800, r wrote: He was not cross posting. You don't actually know what cross-posting is, do you? You've just earned a plonking for the

Re: why cannot assign to function call

2009-01-03 Thread Marc 'BlackJack' Rintsch
On Fri, 02 Jan 2009 04:39:15 -0600, Derek Martin wrote: On Tue, Dec 30, 2008 at 02:21:29PM +, John O'Hagan wrote: What the Python community often overlooks, when this discussion again rears its ugly head (as it seems to every other hour or so), is that its assignment model is BIZARRE, as

Re: Ideas to optimize this getitem/eval call?

2009-01-03 Thread mario
On Jan 3, 7:16 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: I was about to make a comment about this being a security hole, Strange that you say this, as you are also implying that *all* the widely-used templating systems for python are security holes... Well, you would be

Re: ACL in python

2009-01-03 Thread Tino Wildenhain
John Boloshevich wrote: Hello, does anybody know about an ACL implementation for python, which is not tied to the filesystem? I would like to use ACL on different objects not on files, so the POSIX file access solution is not the one I am looking for. You mean something like the restricted

Re: Ideas to optimize this getitem/eval call?

2009-01-03 Thread mario
correction: the code posted in previous message should have been: def __getitem__(self, expr): try: return eval(self.codes[expr], self.globals, self.locals) except: # We want to catch **all** evaluation errors! # KeyError, NameError,

Re: multiprocessing vs thread performance

2009-01-03 Thread Nick Craig-Wood
mk mrk...@gmail.com wrote: After reading http://www.python.org/dev/peps/pep-0371/ I was under impression that performance of multiprocessing package is similar to that of thread / threading. However, to familiarize myself with both packages I wrote my own test of spawning and returning

Re: greenlets and how they can be used

2009-01-03 Thread Mark Wooding
James Mills prolo...@shortcircuit.net.au wrote: The greenlet from http://codespeak.net/py/dist/greenlet.html is a rather interesting way of handling flow of control. Ahh, yes. It's actually a rather old idea, but too rarely used. What can greenlet's be used for ? What use-cases have you

Re: why cannot assign to function call

2009-01-03 Thread Bruno Desthuilliers
Derek Martin a écrit : On Fri, Jan 02, 2009 at 09:05:51PM +0100, Bruno Desthuilliers wrote: Python seems rather weird, and I think from the frequency with which these discussions occur on this list, clearly it *IS* difficult for a neophyte Python programmer to understand the assignment model.

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread Bruno Desthuilliers
sprad a écrit : I've done a good bit of Perl, but I'm new to Python. I find myself doing a lot of typecasting (or whatever this thing I'm about to show you is called), Actually, it's just plain object instanciation. and I'm wondering if it's normal, or if I'm missing an important idiom.

Doubt on creating threads

2009-01-03 Thread koranthala
I was going through Python posts and this post caught my attention http://groups.google.com/group/comp.lang.python/browse_thread/thread/f99326a4e5d394e/14cd708956bd1c1a#14cd708956bd1c1a quote You have missed an important point. A well designed application does neither create so many threads nor

Re: why cannot assign to function call

2009-01-03 Thread John O'Hagan
On Tue, 30th Dec 2008, Aaron Brady wrote: Accepting that, I'll adopt the terms John proposed, 'change' vs. 'exchange', the former when the material configuration changes, the latter when the communication axioms change. b= [2, 3] b= [3, 4] 'b' has exchanged. (Somewhat ungrammatical.) b= [2,

Re: select.select and socket.setblocking

2009-01-03 Thread Bryan Olson
Laszlo Nagy wrote: [...] I have read the socket programming howto ( http://docs.python.org/howto/sockets.html#sockets ) but it does not explain how a blocking socket + select is different from a non blocking socket + select. Is there any difference? There is, but it may not effect you. There

Re: why cannot assign to function call

2009-01-03 Thread Grant Edwards
On 2009-01-03, Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: On Fri, 02 Jan 2009 04:39:15 -0600, Derek Martin wrote: What the Python community often overlooks, when this discussion again rears its ugly head (as it seems to every other hour or so), is that its assignment model is BIZARRE, as

strange thing after call PyObject_CallMethod

2009-01-03 Thread Exe
Hello everybody! I'm in trouble. This code shows that ob_refcnt increased by python if on_recv method throws exception. This occurs only if base C-class subclassed in python code. == my_old_refcnt = Py_REFCNT(self); py_result = PyObject_CallMethod(self, on_recv, (y#), recvbuf, result);

Re: Doubt on creating threads

2009-01-03 Thread Jean-Paul Calderone
On Sat, 3 Jan 2009 08:39:52 -0800 (PST), koranth...@gmail.com wrote: I was going through Python posts and this post caught my attention http://groups.google.com/group/comp.lang.python/browse_thread/thread/f99326a4e5d394e/14cd708956bd1c1a#14cd708956bd1c1a quote You have missed an important

Re: strange thing after call PyObject_CallMethod

2009-01-03 Thread Martin v. Löwis
Why this happenning and who makes Py_INCREF(self)? There are multiple possible explanations, but I think you have ruled out most of them: 1. on_recv might be returning self. So py_result would be the same as self, and hence be an additional reference. However, you said that on_recv raised

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread Russ P.
On Jan 2, 10:50 pm, Ben Finney bignose+hates-s...@benfinney.id.au wrote: s0s...@gmail.com writes: On Jan 2, 7:20 pm, Ben Finney bignose+hates-s...@benfinney.id.au wrote: They don't need to be creative; they merely need to conform with the naming scheme as laid out in the PEP. If it's

Re: Doubt on creating threads

2009-01-03 Thread Simon Forman
On Jan 3, 8:39 am, koranth...@gmail.com wrote: I was going through Python posts and this post caught my attentionhttp://groups.google.com/group/comp.lang.python/browse_thread/thread/... quote  You have missed an important point. A well designed application does  neither create so many

Re: Returning a string

2009-01-03 Thread Diez B. Roggisch
Kless schrieb: How is possible that I can print a variable, but when I use *return var* it returns an empty string http://paste.pocoo.org/show/97588/ I don't see anything that indicates that the returned object is the empty string. Simply because there is no code testing for that. And of

Re: Returning a string

2009-01-03 Thread Kless
On 3 ene, 19:12, Diez B. Roggisch de...@nospam.web.de wrote: Kless schrieb: How is possible that I can print a variable, but when I use *return var* it returns an empty string http://paste.pocoo.org/show/97588/ I don't see anything that indicates that the returned object is the empty

Re: Returning a string

2009-01-03 Thread Simon Forman
On Jan 3, 11:20 am, Kless jonas@googlemail.com wrote: On 3 ene, 19:12, Diez B. Roggisch de...@nospam.web.de wrote: Kless schrieb: How is possible that I can print a variable, but when I use *return var* it returns an empty string http://paste.pocoo.org/show/97588/ I don't see

Re: Returning a string

2009-01-03 Thread Kless
On 3 ene, 19:40, Simon Forman sajmik...@gmail.com wrote: On Jan 3, 11:20 am, Kless jonas@googlemail.com wrote: Afghanistan AF Out[19]: u'AF' AFG Out[19]: u'AFG' 004 Out[19]: u'004' What? That's the output got from ipython. As you can see, it prints 'Afghanistan' but it can

Re: Returning a string

2009-01-03 Thread Diez B. Roggisch
Kless schrieb: On 3 ene, 19:12, Diez B. Roggisch de...@nospam.web.de wrote: Kless schrieb: How is possible that I can print a variable, but when I use *return var* it returns an empty string http://paste.pocoo.org/show/97588/ I don't see anything that indicates that the returned object is

Re: Returning a string

2009-01-03 Thread Diez B. Roggisch
Kless schrieb: On 3 ene, 19:40, Simon Forman sajmik...@gmail.com wrote: On Jan 3, 11:20 am, Kless jonas@googlemail.com wrote: Afghanistan AF Out[19]: u'AF' AFG Out[19]: u'AFG' 004 Out[19]: u'004' What? That's the output got from ipython. As you can see, it prints 'Afghanistan' but it

Re: Returning a string

2009-01-03 Thread Marc 'BlackJack' Rintsch
On Sat, 03 Jan 2009 11:46:10 -0800, Kless wrote: On 3 ene, 19:40, Simon Forman sajmik...@gmail.com wrote: On Jan 3, 11:20 am, Kless jonas@googlemail.com wrote: Afghanistan AF Out[19]: u'AF' AFG Out[19]: u'AFG' 004 Out[19]: u'004' What? That's the output got from ipython.

Re: Returning a string

2009-01-03 Thread Kless
On 3 ene, 19:51, Diez B. Roggisch de...@nospam.web.de wrote: Kless schrieb: On 3 ene, 19:40, Simon Forman sajmik...@gmail.com wrote: On Jan 3, 11:20 am, Kless jonas@googlemail.com wrote: Afghanistan AF Out[19]: u'AF' AFG Out[19]: u'AFG' 004 Out[19]: u'004' What?

Re: Reverse order of bit in repeating seqence of byte string

2009-01-03 Thread imageguy
On Jan 2, 7:33 pm, John Machin sjmac...@lexicon.net wrote: For some very strange definition of works. You say you have 'bgr' and want to convert it to 'rbg'. The following code converts 'bgr' to 'rgb', which is somewhat more plausible, but not what you said you wanted. Well that's

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread alex goretoy
for each his own. Any more word on userio? On Sat, Jan 3, 2009 at 6:14 PM, Russ P. russ.paie...@gmail.com wrote: On Jan 2, 10:50 pm, Ben Finney bignose+hates-s...@benfinney.id.aubignose%2bhates-s...@benfinney.id.au wrote: s0s...@gmail.com writes: On Jan 2, 7:20 pm, Ben Finney

ResponseNotReady exception

2009-01-03 Thread asit
import httplib class Server: #server class def __init__(self, host): self.host = host def fetch(self, path): http = httplib.HTTPConnection(self.host) http.putrequest(GET, path) r = http.getresponse() print str(r.status) + : + r.reason

Re: select.select and socket.setblocking

2009-01-03 Thread Saju Pillai
Bryan Olson fakeaddr...@nowhere.org wrote: Where does this come up? Suppose that to take advantage of multi-core processors, our server runs as four processes, each with a single thread that responds to events via select(). Clients all connect to the same server port, so the socket listening

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread vk
Any more word on userio? None yet, I'm afraid. Should've started a different thread for it - but it's stuck here (in obscurity) forever xd. -- http://mail.python.org/mailman/listinfo/python-list

Re: strange thing after call PyObject_CallMethod

2009-01-03 Thread Bug Hunter
Thank you for so amazing debugging tutorial :). I owe you a beer. I found source of problem: then unhandled in python code exception occurs frame_dealloc() (Objects/frameobject.c:422) not called. Even if I call PyErr_Print(). But! If I call PyErr_Clear() then all okay! Docs says that both this

Re: ResponseNotReady exception

2009-01-03 Thread Chris Rebert
On Sat, Jan 3, 2009 at 12:38 PM, asit lipu...@gmail.com wrote: import httplib class Server: #server class def __init__(self, host): self.host = host def fetch(self, path): http = httplib.HTTPConnection(self.host) http.putrequest(GET, path) According to the

Port of python stdlib to other languages.

2009-01-03 Thread vk
Have there been ports of the Python standard library to other languages? I would imagine using pickle, urllib, and sys in C (with pythonic naming conventions) would be easier than using other libraries to do the same thing. -- http://mail.python.org/mailman/listinfo/python-list

Re: Port of python stdlib to other languages.

2009-01-03 Thread Diez B. Roggisch
vk schrieb: Have there been ports of the Python standard library to other languages? I would imagine using pickle, urllib, and sys in C (with pythonic naming conventions) would be easier than using other libraries to do the same thing. AFAIK not. You could try elmer (found on SF) to expose

win32gui

2009-01-03 Thread Gandalf
Hi, I'm trying to capture the text word under the user cursor, so I was searching the win32 lib for functions I can use. i used this to fined the controller under the cursor win32gui.WindowFromPoint(win32gui.GetCursorPos()) to get the controller, but then when I try to read the text with this

Re: ResponseNotReady exception

2009-01-03 Thread asit
On Jan 4, 1:59 am, Chris Rebert c...@rebertia.com wrote: On Sat, Jan 3, 2009 at 12:38 PM, asit lipu...@gmail.com wrote: import httplib class Server:    #server class    def __init__(self, host):        self.host = host    def fetch(self, path):        http =

compiling python2.5 on linux under wine

2009-01-03 Thread Luke Kenneth Casson Leighton
hey, has anyone investigated compiling python2.5 using winegcc, under wine? i'm presently working my way through it, just for kicks, and was wondering if anyone would like to pitch in or stare at the mess under a microscope. it's not as crazed as it sounds. cross-compiling python2.5 for win32

Re: select.select and socket.setblocking

2009-01-03 Thread Roy Smith
Bryan Olson fakeaddr...@nowhere.org wrote: There are cases where a socket can select() as readable, but not be readable by the time of a following recv() or accept() call. All such cases with which I'm familiar call for a non-blocking socket. I used to believe that if select() said data was

Re: math module for Decimals

2009-01-03 Thread Mark Dickinson
On Dec 31 2008, 11:02 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Sun, 28 Dec 2008 06:38:32 -0800, Mark Dickinson wrote: On Dec 28, 7:28 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: Ah crap, I forgot that from_float() has been left out of the

Re: math module for Decimals

2009-01-03 Thread Mark Dickinson
On Jan 3, 9:27 pm, Mark Dickinson dicki...@gmail.com wrote: Decimal.from_float() implemented by Raymond Hettinger for Python 2.7 and Python 3.1, within 72 hours of Steven submitting the feature request.  If only all issues could be resolved this quickly. :-) Rats. I left out the crucial line

Re: Reverse order of bit in repeating seqence of byte string

2009-01-03 Thread John Machin
On Jan 4, 7:10 am, imageguy imageguy1...@gmail.com wrote: On Jan 2, 7:33 pm, John Machin sjmac...@lexicon.net wrote: For some very strange definition of works. You say you have 'bgr' and want to convert it to 'rbg'. The following code converts 'bgr' to 'rgb', which is somewhat more

deleting a method

2009-01-03 Thread Filip Gruszczyński
I am trying to delete a method from a class. It's easy to delete other attributes, but when I try: class A: ... def foo(): ... pass ... a = A() del a.foo I get Traceback (most recent call last): File stdin, line 1, in module AttributeError: A instance has no attribute 'foo'

Re: deleting a method

2009-01-03 Thread MRAB
Filip Gruszczyński wrote: I am trying to delete a method from a class. It's easy to delete other attributes, but when I try: class A: ... def foo(): ... pass ... a = A() del a.foo I get Traceback (most recent call last): File stdin, line 1, in module AttributeError: A

Re: deleting a method

2009-01-03 Thread Ben Finney
MRAB goo...@mrabarnett.plus.com writes: Filip Gruszczyński wrote: Traceback (most recent call last): File stdin, line 1, in module AttributeError: A instance has no attribute 'foo' Why is it so and how may still delete it? 'a' is an instance of class A. You're trying to delete

Re: Testing if an index is in a slice

2009-01-03 Thread Bryan Olson
ajaksu wrote: On Jan 1, 4:12 pm, mma...@gmx.net wrote: I would like to check if an index is in a slice or not without iterating over the slice. Something like: isinslice(36, slice(None, 34, -1)) True I think it'd be feasible for slices that can be mapped to ranges[1], but slices are more

Re: why cannot assign to function call

2009-01-03 Thread Aaron Brady
On Jan 3, 11:25 am, John O'Hagan resea...@johnohagan.com wrote: On Tue, 30th Dec 2008, Aaron Brady wrote: Accepting that, I'll adopt the terms John proposed, 'change' vs. 'exchange', the former when the material configuration changes, the latter when the communication axioms change. b= [2,

Re: socket send help

2009-01-03 Thread Bryan Olson
Gabriel Genellina wrote: greyw...@gmail.com escribió: [...] A simple server: from socket import * myHost = '' Try with myHost = '127.0.0.1' instead - a firewall might be blocking your server. Just a nit: I'd say the reason to use '127.0.0.1' instead of the empty string is that a

Re: Doubt on creating threads

2009-01-03 Thread Bryan Olson
koranth...@gmail.com wrote: I am creating an application and it creates ~1-2 threads every second and kill it within 10 seconds. After reading this I am worried. Is creating a thread a very costly operation? Compared to a procedure call it's expensive, but a couple threads per second is

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread Steven D'Aprano
On Sat, 03 Jan 2009 20:35:25 +, alex goretoy wrote: for each his own. Please don't top-post. Please don't quote the ENTIRE body of text (PLUS doubling it by including a completely useless HTML version) just to add a trivial comment. Trim the text you are replying to. Any more word on

Re: math module for Decimals

2009-01-03 Thread Steven D'Aprano
On Sat, 03 Jan 2009 13:34:11 -0800, Mark Dickinson wrote: On Jan 3, 9:27 pm, Mark Dickinson dicki...@gmail.com wrote: Decimal.from_float() implemented by Raymond Hettinger for Python 2.7 and Python 3.1, within 72 hours of Steven submitting the feature request.  If only all issues could be

Re: Noob question: Is all this typecasting normal?

2009-01-03 Thread Steven D'Aprano
On Sat, 03 Jan 2009 16:19:58 +0100, Bruno Desthuilliers wrote: But indeed, you obviously cannot add strings with numerics nor concatenate numerics with strings. This would make no sense. The OP comes from a Perl background, which AFAIK allows you to concat numbers to strings and add strings

Re: Why not Ruby?

2009-01-03 Thread Jack.Chu
On Jan 1, 3:55 am, Roger rdcol...@gmail.com wrote: On Dec 31, 12:55 pm, Xah Lee xah...@gmail.com wrote: Just spent 3 hours looking into Ruby today. Here's my short impression for those interested. Who are you? In case no one tells you, you are a cocky, egotistical windbag with opinions

Re: Ideas to optimize this getitem/eval call?

2009-01-03 Thread Steven D'Aprano
On Sat, 03 Jan 2009 04:14:14 -0800, mario wrote: On Jan 3, 7:16 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: [...] I must say though, your choice of builtins to prohibit seems rather arbitrary. What is dangerous about (e.g.) id() and isinstance()? Preventive, probably.

Re: strange behavior of math.sqrt() in new 3.0 version

2009-01-03 Thread Eric Kemp
Tim Roberts wrote: Scott David Daniels scott.dani...@acm.org wrote: I avoid using single-letter variables except where I know the types from the name (so I use i, j, k, l, m, n as integers, s as string, and w, x, y, and z I am a little looser with (but usually float or complex). It's amazing

Re: When does python 3.1, 3.2 version out?

2009-01-03 Thread Benjamin
On Jan 3, 8:47 pm, 叮叮当当 guoti...@gmail.com wrote: Now, the 3.0 version is out for a time. I wonder when the python 3.1 is out, and what change is in python 3.1. There's no schedule yet. Hopefully, one will come into being around PyCon. -- http://mail.python.org/mailman/listinfo/python-list

simple turn-based multiplayer game via TCP server/client

2009-01-03 Thread greyw...@gmail.com
Hi everyone, I'm learning python to get a multiplayer roleplaying game up and running. I didn't see any simple examples of multiplayer games on the web so I thought I'd post mine here. I choose Rock, Paper, Scissors as a first game to experiment with as the game logic/options are easy to

Re: win32gui

2009-01-03 Thread Tim Roberts
Gandalf goldn...@gmail.com wrote: I'm trying to capture the text word under the user cursor, so I was searching the win32 lib for functions I can use. You should know that, in the general case, this is impossible. Remember that the screen image you are looking at is just a big array of dots.

Re: Port of python stdlib to other languages.

2009-01-03 Thread vk
AFAIK not. You could try elmer Elmer looks very interesting, but not really what I was getting at. What do you need C for anyway? Or, to put it the other way round - why not expose whatever you need in C as python extension, and write your app in Python? I'm not looking to write a Python app

Re: Doubt on creating threads

2009-01-03 Thread koranthala
On Jan 4, 4:59 am, Bryan Olson fakeaddr...@nowhere.org wrote: koranth...@gmail.com wrote: I am creating an application and it creates ~1-2 threads every second and kill it within 10 seconds. After reading this I am worried. Is creating a thread a very costly operation? Compared to a

Re: Port of python stdlib to other languages.

2009-01-03 Thread Mensanator
On Jan 3, 10:15�pm, vk vmi...@gmail.com wrote: AFAIK not. You could try elmer Elmer looks very interesting, but not really what I was getting at. What do you need C for anyway? Or, to put it the other way round - why not expose whatever you need in C as python extension, and write your

Memoizing and WeakValueDictionary

2009-01-03 Thread Paul McGuire
Just wanted to share some experience I had in doing some memory and performance tuning of a graphics script. I've been running some long- running scripts on high-resolution images, and added memoizing to optimize/minimize object creation (my objects are immutable, so better to reuse objects from

Re: simple turn-based multiplayer game via TCP server/client

2009-01-03 Thread alex goretoy
Since we are on the subject of Rock, Paper, Scissors. I've recntly watched this one video on how to make a .deb out of .py files and the tutor was using a rock, paper scissors game. Not sure how this may come of use to you but, I'll post it anyway for you to look at. May help somehow.

Re: why cannot assign to function call

2009-01-03 Thread Steven D'Aprano
I'm answering both John and Aaron's comments in the following. Mostly John at the start, Aaron toward the end. On Sat, 03 Jan 2009 15:42:47 -0800, Aaron Brady wrote: On Jan 3, 11:25 am, John O'Hagan resea...@johnohagan.com wrote: [...] According to this, when you replace every floorboard

Re: Testing if an index is in a slice

2009-01-03 Thread ajaksu
On Jan 3, 8:53 pm, Bryan Olson fakeaddr...@nowhere.org wrote: If we add a parameter for the length of the list to which the slice is applied, then inslice() is well-defined. Cool! I thought it would easy to write, Heh, I gave up on the example I mentioned above :) but that was hours ago

[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Pavel Kosina
Pavel Kosina g...@post.cz added the comment: You can open script made in python 2.x and it stops immediately working after saving, if it is coding-aware. You can have bigger project and use idle for editing config and text files from this project too. It is unfair to change without notification

[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Pavel Kosina
Pavel Kosina g...@post.cz added the comment: I forgot about Perhaps IDLE should offer to convert it on opening. That would be nice, too. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4815 ___

[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: Here is a patch to provide an explicit message that the file will be converted when the file is opened (also querying what encoding should be converted from), answering the complaint that the conversion is without notice. If you want to edit

[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Pavel Kosina
Pavel Kosina g...@post.cz added the comment: Sorry, where is the patch? ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4815 ___ ___ Python-bugs-list mailing

[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Martin v. Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- keywords: +patch Added file: http://bugs.python.org/file12561/conv.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4815 ___

[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Martin v. Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- keywords: +needs review priority: - release blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4815 ___

[issue4796] Decimal to receive from_float method

2009-01-03 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: -- assignee: rhettinger - marketdickinson keywords: +needs review -patch Added file: http://bugs.python.org/file12562/decimal2.diff ___ Python tracker rep...@bugs.python.org

[issue4796] Decimal to receive from_float method

2009-01-03 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: Removed file: http://bugs.python.org/file12558/decimal.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4796 ___

[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Pavel Kosina
Pavel Kosina g...@post.cz added the comment: OK, I got it. In my opinion it would nice if user can either convert file to utf8 or to do nothing and add new encodings declaration or cancel. Current Cancel gives an Decoding error. If you give an encodings that doesn't exist, it shouldn't

[issue4796] Decimal to receive from_float method

2009-01-03 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Instead of the repeated divisions and Inexact tests, how about a direct approach: n/2**k = (n*5**k)/10**k, so something like: sign = 0 if copysign(1.0, self) == 1.0 else 1 n, d = abs(self).as_integer_ratio() k = d.bit_length() -

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-03 Thread Thomas Finley
New submission from Thomas Finley tfin...@gmail.com: This is a patch for the Python 3.1 build checked out from http://svn.python.org/projects/python/branches/py3k The current behavior of itertools.combinations(iterable,r) and itertools.permutations(iterable,r) is to throw a ValueError if

[issue4608] urllib.request.urlopen does not return an iterable object

2009-01-03 Thread Jakub Wilk
Jakub Wilk uba...@users.sf.net added the comment: Oops, __next__ is OK. Sorry for the confusion. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4608 ___ ___

[issue4817] PyOS_GetLastModificationTime is unused

2009-01-03 Thread Ulrich Eckhardt
New submission from Ulrich Eckhardt eckha...@satorlaser.com: This is just to record that the above function is wrongly documented, inconsistently implemented, but fortunately unused, so it can be removed. In addition to the patch attached, there are two files that can be removed:

[issue4751] Patch for better thread support in hashlib

2009-01-03 Thread ebfe
Changes by ebfe knabberknusperh...@yahoo.de: Removed file: http://bugs.python.org/file12557/md5module_small_locks.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4751 ___

[issue4796] Decimal to receive from_float method

2009-01-03 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: A couple more things: 1. There's a typo 'equilvalent' in the decimal.py part of the patch. 2. Can I suggest using return d._fix(self) instead of return self.plus(d) in create_decimal_from_float. The plus method does two things: rounds

[issue4818] Patch for thread-support in md5module.c

2009-01-03 Thread ebfe
New submission from ebfe knabberknusperh...@yahoo.de: Here is another patch, this time for the fallback-md5-module. I know that situations are rare where openssl is not present but threading is. However they might occur out there and the md5module needed some love anyway: - The MD5 class from

[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: In my opinion it would nice if user can either convert file to utf8 or to do nothing and add new encodings declaration or cancel. Ypu can still add an encoding declaration after the file got converted. Cancelling is also possible. If you

[issue4815] idle 3.1a1 utf8

2009-01-03 Thread Martin v. Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: Removed file: http://bugs.python.org/file12561/conv.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4815 ___

[issue4818] Patch for thread-support in md5module.c

2009-01-03 Thread Martin v. Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: ebfe, please identify yourself with a real name; please also sign a contributor form. -- nosy: +loewis ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4818

[issue4812] Junk in the decimals namespace

2009-01-03 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Done (r68191 through r68194). -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4812 ___

[issue4816] Patch of itertools.{combinations, permutations} for empty combinations

2009-01-03 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I agree that the proposed behaviour seems more correct: the collection of all subsets of size 4 of range(3) is perfectly valid and well-defined; it just happens to be empty. I've also encountered this in practice (in code that was

[issue4751] Patch for better thread support in hashlib

2009-01-03 Thread ebfe
ebfe knabberknusperh...@yahoo.de added the comment: Haypo, we can probably reduce overhead by defining ENTER_HASHLIB like this: #define ENTER_HASHLIB(obj) \ if ((obj)-lock) { \ if (!PyThread_acquire_lock((obj)-lock, 0)) { \ Py_BEGIN_ALLOW_THREADS \

[issue1717] Get rid of more refercenes to __cmp__

2009-01-03 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: [Georg Brandl, on spark.py] This is used by asdl_c.py which generates Python-ast.c -- it should be updated. The only issue here is a single comment, which reads: # GenericASTMatcher. AST nodes must have __getitem__ and __cmp__ Still,

[issue1717] Get rid of more references to __cmp__

2009-01-03 Thread Martin v. Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- title: Get rid of more refercenes to __cmp__ - Get rid of more references to __cmp__ ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1717 ___

[issue4580] slicing of memoryviews when itemsize != 1 is wrong

2009-01-03 Thread Martin v. Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- keywords: -needs review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4580 ___ ___

[issue4580] slicing of memoryviews when itemsize != 1 is wrong

2009-01-03 Thread Martin v. Löwis
Changes by Martin v. Löwis mar...@v.loewis.de: -- assignee: - pitrou resolution: - accepted ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4580 ___

[issue4818] Patch for thread-support in md5module.c

2009-01-03 Thread Lukas Lueg
Lukas Lueg knabberknusperh...@yahoo.de added the comment: Sent the form by fax ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4818 ___ ___ Python-bugs-list

[issue4819] Misc/cheatsheet needs updating

2009-01-03 Thread Mark Dickinson
New submission from Mark Dickinson dicki...@gmail.com: Misc/cheatsheet could do with an upgrade, both for the 2.x and 3.x branches. For 3.x, I guess the changes needed are quite extensive. I'm not sure how much needs to be changed or added for 2.x; at a quick glance, the 'with' statement, the

[issue4753] Faster opcode dispatch on gcc

2009-01-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: I'm not an expert in this kind of optimizations. Could we gain more speed by making the dispatcher table more dense? Python has less than 128 opcodes (len(opcode.opmap) == 113) so they can be squeezed in a smaller table. I naively assume a

[issue4806] Function calls taking a generator as star argument can mask TypeErrors in the generator

2009-01-03 Thread Hagen Fürstenau
Hagen Fürstenau hfuerste...@gmx.net added the comment: I'm getting confused about whether it's actually desired behaviour that generators can be star arguments. The error message seems to say it's not: argument after * must be a sequence. The docs seem to agree: If the syntax *expression

[issue3638] tkinter.mainloop() is meaningless and crash: remove it

2009-01-03 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file11200/tkinter_remove_mainloop.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3638 ___

  1   2   >