Re: convert xhtml back to html

2008-04-24 Thread bryan rasmussen
I'll second the recommendation to use xsl-t, set the output to html. The code for an XSL-T to do it would be basically: xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0 xsl:output method=html / xsl:template match=/xsl:copy-of select=///xsl:template /xsl:stylesheet

Re: Where to get BeautifulSoup--www.crummy.com appears to be down.

2008-04-24 Thread Paul Rubin
Paul Boddie [EMAIL PROTECTED] writes: simple Python-only modules, all you'd really need to do to prove the concept is to develop the client-side Windows software (eg. apt-get for Windows) which downloads package lists, verifies signatures, and works out where to put the package contents. ...

question

2008-04-24 Thread Enrique Alvarez
hi, I want to ask something about programming in python, I'm beginning, I download the souce code of an antispyware in python I m talking about nixory: http://nixory.sourceforge.net/ this is a antyspyware only for mozilla firefox and my question is: how could I implement more functions of

Re: Installer

2008-04-24 Thread M.-A. Lemburg
On 2008-04-24 18:39, Chris wrote: Hey all, I've created a python program that relies on pysqlite, wxpython, and matplotlib. Is there any way of creating an installer that will install all these modules, python 2.5 and my program? Assuming that you're on Windows, a well-working approach is to

Re: function that accepts any amount of arguments?

2008-04-24 Thread Steve Holden
Jonathan Gardner wrote: On Apr 24, 5:28 am, malkarouri [EMAIL PROTECTED] wrote: What's wrong with raising ZeroDivisionError (not stopping the exception in the first place)? Because when I use your module, call avg (or mean) without args, I should see an error that says, Hey, you have to pass

Re: function that accepts any amount of arguments?

2008-04-24 Thread member thudfoo
On 4/24/08, Jonathan Gardner [EMAIL PROTECTED] wrote: On Apr 24, 5:28 am, malkarouri [EMAIL PROTECTED] wrote: What's wrong with raising ZeroDivisionError (not stopping the exception in the first place)? Because when I use your module, call avg (or mean) without args, I should see

Re: function that accepts any amount of arguments?

2008-04-24 Thread [EMAIL PROTECTED]
On 24 avr, 14:28, malkarouri [EMAIL PROTECTED] wrote: On Apr 24, 12:43 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: [...] Not quite sure what's the best thing to do in the second case - raise a ValueError if args is empty, or silently return 0.0 - but I'd tend to choose the first

where can I find gdkimlib (imlib bindings)?

2008-04-24 Thread Xavier Toth
I'm trying to get some old code that imported GdkImlib to work but I can't find these a current version of these binding, anyone know where they are? -- http://mail.python.org/mailman/listinfo/python-list

Re: NameError: global name 'Response' is not defined

2008-04-24 Thread Ben Kaplan
Are you importing pylons? How are you doing it? If you are doing from pylons import Response or from pylons import *, then you have another problem. If you are just doing import pylons, then you need to do return pylons.Response(...) - Original Message From: Lalit [EMAIL PROTECTED]

Re: python-ldap - Operations Error

2008-04-24 Thread t . a . adjuster
On Apr 24, 2:02 pm, [EMAIL PROTECTED] wrote: Not sure if this is an AD thing or just something i needed to do with our particular server/config. Glad to hear my posting helped somebody. In our case, our domain controller was passing us referrals to the Configuration, ForestDNSZones, and

Re: function that accepts any amount of arguments?

2008-04-24 Thread Steve Holden
member thudfoo wrote: On 4/24/08, Jonathan Gardner [EMAIL PROTECTED] wrote: On Apr 24, 5:28 am, malkarouri [EMAIL PROTECTED] wrote: What's wrong with raising ZeroDivisionError (not stopping the exception in the first place)? Because when I use your module, call avg (or mean) without

Parsing text file with #include and #define directives

2008-04-24 Thread python
I'm parsing a text file for a proprietary product that has the following 2 directives: #include somefile #define name value Defined constants are referenced via #name# syntax. I'm looking for a single text stream that results from processing a file containing these directives. Even better would

Re: Psyco alternative

2008-04-24 Thread Christian Tismer
[EMAIL PROTECTED] wrote: Diez B. Roggisch: the author says that the approach is flawed, so at *some* point it will be discontinued. Can't Psyco be improved, so it can compile things like: nums = (i for i in xrange(20) if i % 2) print sum(nums) Although my main goal is to support PyPy

Re: convert xhtml back to html

2008-04-24 Thread Stefan Behnel
Tim Arnold wrote: hi, I've got lots of xhtml pages that need to be fed to MS HTML Workshop to create CHM files. That application really hates xhtml, so I need to convert self-ending tags (e.g. br /) to plain html (e.g. br). This should do the job in lxml 2.x: from lxml import etree

Re: DTD validation and xmlproc

2008-04-24 Thread mmm
Regarding ... try lxml. http://codespeak.net/lxmlhttp://codespeak.net/lxml/tutorial.htmlhttp://codespeak.net/lxml/validation.html Thx Stefan, it seems that lxml does everything I need. I have not figured out all of the bells and whistles but the tutorials are getting me up to speed. Based 2

Class Inheritance - What am I doing wrong?

2008-04-24 Thread Brian Munroe
My example: class A(object): def __init__(self, name): self.__name = name def getName(self): return self.__name class B(A): def __init__(self,name=None): super(A,self).__init__() def setName(self, name):

Re: Parsing text file with #include and #define directives

2008-04-24 Thread Arnaud Delobelle
[EMAIL PROTECTED] writes: I'm parsing a text file for a proprietary product that has the following 2 directives: #include somefile #define name value Defined constants are referenced via #name# syntax. I'm looking for a single text stream that results from processing a file containing

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Virgil Dupras
On Apr 24, 10:22 pm, Brian Munroe [EMAIL PROTECTED] wrote: My example: class A(object):         def __init__(self, name):                 self.__name = name         def getName(self):                 return self.__name class B(A):         def __init__(self,name=None):                

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Arnaud Delobelle
Brian Munroe [EMAIL PROTECTED] writes: My example: class A(object): def __init__(self, name): self.__name = name def getName(self): return self.__name class B(A): def __init__(self,name=None): super(A,self).__init__()

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Arnaud Delobelle
Arnaud Delobelle [EMAIL PROTECTED] writes: That is, if you also pass the name parameter to super(A,self).__init__ in B's __init__ method Oops. should be super(B, self).__init__(name), of course. -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Gary Herron
Brian Munroe wrote: My example: class A(object): def __init__(self, name): self.__name = name def getName(self): return self.__name class B(A): def __init__(self,name=None): super(A,self).__init__() def

Re: Psyco alternative

2008-04-24 Thread kib
Christian Tismer a écrit : [EMAIL PROTECTED] wrote: Diez B. Roggisch: the author says that the approach is flawed, so at *some* point it will be discontinued. Can't Psyco be improved, so it can compile things like: nums = (i for i in xrange(20) if i % 2) print sum(nums) Although my

Re: convert xhtml back to html

2008-04-24 Thread bryan rasmussen
wow, that's pretty nice there. Just to know: what's the performance like on XML instances of 1 GB? Cheers, Bryan Rasmussen On Thu, Apr 24, 2008 at 9:55 PM, Stefan Behnel [EMAIL PROTECTED] wrote: Tim Arnold wrote: hi, I've got lots of xhtml pages that need to be fed to MS HTML Workshop to

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Brian Munroe
Ok, so thanks everyone for the helpful hints. That *was* a typo on my part (should've been super(B...) not super(A..), but I digress) I'm building a public API. Along with the API I have a few custom types that I'm expecting API users to extend, if they need too. If I don't use name mangling,

Re: DO YOU KNOW ANY THING ABOUT ISLAM???

2008-04-24 Thread Mensanator
You mean something besides wiping my ass with a rock? -- http://mail.python.org/mailman/listinfo/python-list

Re: Billing system written in python

2008-04-24 Thread VanL
AC Perdon wrote: I was thinking of using django but Im more looking in to a ready made billing system that I will just do some tweaking and fine tunning to meet our need. like jbilling. Look at Fivedash (fivedash.com), it may be what you need. --

Re: [Python-Dev] annoying dictionary problem, non-existing keys

2008-04-24 Thread Greg Ewing
bvidinli wrote: I posted to so many lists because, this issue is related to all lists, this is an idea for python, this is related to development of python... You shouldn't post to every group that you think might be vaguely relevant. You should pick *one* that you think is *most* relevant

Re: How to find the parent of an old-style class?

2008-04-24 Thread Jasper
On Apr 24, 10:02 am, Jonathan Gardner [EMAIL PROTECTED] wrote: On Apr 24, 7:16 am, Jasper [EMAIL PROTECTED] wrote: I'm stuck using a library based on old style classes, and need to find a class's parent at runtime. With new style classes you can use .__base__ to inspect a parent, but I

Re: Psyco alternative

2008-04-24 Thread sturlamolden
On Mar 27, 4:44 pm, Jean-Paul Calderone [EMAIL PROTECTED] wrote: PyPy is self-hosted and has been for some time (a year or so?). This is technically not correct. PyPy is hosted by RPython, which is not Python but a different language all together. --

Re: Psyco alternative

2008-04-24 Thread sturlamolden
On Mar 27, 4:02 pm, king kikapu [EMAIL PROTECTED] wrote: As for psyco, are there any alternatives to use now ? When Cython has implemented all of Python's syntax, we can replace CPython's compiler and bytecode interpreter with Cython and a C compiler. Cython can be one or two orders of

Re: Psyco alternative

2008-04-24 Thread sturlamolden
On Mar 27, 5:01 pm, king kikapu [EMAIL PROTECTED] wrote: Hmmm...thanks but i think Pyrex-like solution is not the ideal one. Coming from C# and having 8 years of expertise on it, i have gain a very positive thinking about jit compilers and i think that psyco (ok, a just-in-time specializer)

Re: Psyco alternative

2008-04-24 Thread Steve Holden
sturlamolden wrote: On Mar 27, 4:44 pm, Jean-Paul Calderone [EMAIL PROTECTED] wrote: PyPy is self-hosted and has been for some time (a year or so?). This is technically not correct. PyPy is hosted by RPython, which is not Python but a different language all together. I believe, without the

Re: Psyco alternative

2008-04-24 Thread sturlamolden
On Mar 27, 5:01 pm, king kikapu [EMAIL PROTECTED] wrote: Hmmm...thanks but i think Pyrex-like solution is not the ideal one. Coming from C# and having 8 years of expertise on it, i have gain a very positive thinking about jit compilers and i think that psyco (ok, a just-in-time specializer)

Re: Psyco alternative

2008-04-24 Thread sturlamolden
On Apr 25, 2:15 am, Steve Holden [EMAIL PROTECTED] wrote: I believe, without the benefit of recent experience, that the R stands for Restricted. Thus and RPython program must of necessity also be a valid Python program. Or do you know something I don't? That is correct. But RPython is not

Re: Psyco alternative

2008-04-24 Thread sturlamolden
On Mar 28, 8:06 pm, Paul Boddie [EMAIL PROTECTED] wrote: From what I've seen from browsing publicly accessible materials, there's a certain commercial interest in seeing Psyco updated somewhat. YouTube uses Psyco. -- http://mail.python.org/mailman/listinfo/python-list

Little novice program written in Python

2008-04-24 Thread Rogério Brito
Hi, All. I'm just getting my feet wet on Python and, just for starters, I'm coding some elementary number theory algorithms (yes, I know that most of them are already implemented as modules, but this is an exercise in learning the language idioms). As you can see from the code below, my

Re: Psyco alternative

2008-04-24 Thread Steve Holden
sturlamolden wrote: On Apr 25, 2:15 am, Steve Holden [EMAIL PROTECTED] wrote: I believe, without the benefit of recent experience, that the R stands for Restricted. Thus and RPython program must of necessity also be a valid Python program. Or do you know something I don't? That is correct.

Re: py3k concerns. An example

2008-04-24 Thread Aaron Watters
On Apr 24, 10:10 am, Paul McGuire [EMAIL PROTECTED] wrote end point applications (I consider maintaining 2 branches to be in the not working category), but it does NOT WORK for people who maintain modules for other people to use, because those people may be on a range of Python versions that

Re: Calling Python code from inside php

2008-04-24 Thread Nick Stinemates
While I certainly prefer to use Python wherever I can, that does not mean that there aren't cases where legacy systems or other constraints make this impossible. If I have e.g. a type3-based website - how on earth should I replace that with Python (without wasting a lot of time)? I don't

Re: Remove multiple inheritance in Python 3000

2008-04-24 Thread Nick Stinemates
On Tue, Apr 22, 2008 at 04:07:01AM -0700, GD wrote: Please remove ability to multiple inheritance in Python 3000. Multiple inheritance is bad for design, rarely used and contains many problems for usual users. Every program can be designed only with single inheritance. I also published

Re: Little novice program written in Python

2008-04-24 Thread Raymond Hettinger
What I would like is to receive some criticism to my code to make it more Python'esque and, possibly, use the resources of the computer in a more efficient way (the algorithm implemented below is the Sieve of Eratosthenes): It looks like straight-forward code and is fine as it stands. If you

Problem building python in virtual machine running centos

2008-04-24 Thread Alexandre Gillet
Hi, I am trying to build python-2.4.5 on Centos 5.1, which is a virtual machine running with xen. I am not able to build python. The compilation crash with the following: gcc -pthread -c -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -o Objects/unicodeobject.o

Re: Psyco alternative

2008-04-24 Thread sturlamolden
On Apr 25, 3:27 am, Steve Holden [EMAIL PROTECTED] wrote: That seems a little harsh: it's Python-in-a-strait-jacket. The fact remains that since RPython programs also run under the standard interpreter (albeit a factor of maybe a hundred times more slowly) their claim of self-hosting is

Re: Remove multiple inheritance in Python 3000

2008-04-24 Thread sturlamolden
On Apr 22, 1:07 pm, GD [EMAIL PROTECTED] wrote: Please remove ability to multiple inheritance in Python 3000. Too late for that, PEPs are closed. Multiple inheritance is bad for design, rarely used and contains many problems for usual users. Every program can be designed only with single

how to mysqldb dict cursors

2008-04-24 Thread Vaibhav.bhawsar
I have been trying to get the DictCursor working with mysqldb module but can't seem to. I have pasted the basic connection code and the traceback from pydev. The connection does open with the default cursor class. can't figure this one out. many thanks. code import MySQLdb import sys # connect to

Re: Remove multiple inheritance in Python 3000

2008-04-24 Thread Steve Holden
sturlamolden wrote: On Apr 22, 1:07 pm, GD [EMAIL PROTECTED] wrote: Please remove ability to multiple inheritance in Python 3000. Too late for that, PEPs are closed. Multiple inheritance is bad for design, rarely used and contains many problems for usual users. Every program can be

Re: Psyco alternative

2008-04-24 Thread Steve Holden
sturlamolden wrote: On Apr 25, 3:27 am, Steve Holden [EMAIL PROTECTED] wrote: That seems a little harsh: it's Python-in-a-strait-jacket. The fact remains that since RPython programs also run under the standard interpreter (albeit a factor of maybe a hundred times more slowly) their claim of

Re: Calling Python code from inside php

2008-04-24 Thread sturlamolden
On Apr 24, 5:51 am, Nick Stinemates [EMAIL PROTECTED] wrote: I don't understand how the 2 are mutually exclusive? You can have PHP and Python bindings installed on the same Apache server, unless I'm mistaken? Not everyone have the luxury of having mod_python installed. It depends on the

Remove old version before upgrade?

2008-04-24 Thread Sal
I'm currently running Windows version 2.5.1 and would like to upgrade to 2.5.2. My question is, can I just go ahead and install the new version over the old or should I remove the old version with add/ remove programs first? The old version is in a directory named Python25. --

Re: Psyco alternative

2008-04-24 Thread sturlamolden
On Apr 25, 4:57 am, Steve Holden [EMAIL PROTECTED] wrote: I am simply pointing out that RPython is used for efficiency, not to do things that can't be done in standard Python. Yes. And if we only use a very small subset of Python, it would in effect be a form of assembly code. Hence my comment

Re: py3k concerns. An example

2008-04-24 Thread Terry Reedy
Aaron Watters [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] The reason that successive versions of 2.x broke so little is that starting at about 2.2, all breakages (starting with int division change) were put off until until 3.0 instead of being implemented as decided upon (with

ctypes: return a pointer to a struct

2008-04-24 Thread Jack
I'm not able to build IP2Location's Python interface so I'm trying to use ctypes to call its C interface. The functions return a pointer to the struct below. I haven't been able to figure out how I should declare the return type of the functions and read the fields. Any hint is appreciated.

Re: ctypes: return a pointer to a struct

2008-04-24 Thread sturlamolden
On Apr 25, 5:09 am, Jack [EMAIL PROTECTED] wrote: typedef struct { char *country_short; char *country_long; char *region; char *city; char *isp; float latitude; float longitude; char *domain; char *zipcode; char *timezone; char *netspeed; } IP2LocationRecord; First

Re: ctypes: return a pointer to a struct

2008-04-24 Thread sturlamolden
On Apr 25, 5:15 am, sturlamolden [EMAIL PROTECTED] wrote: First define a struct type IP2LocationRecord by subclassing from ctypes.Structure. Then define a pointer type as ctypes.POINTER(IP2LocationRecord) and set that as the function's restype attribute. See the ctypes tutorial or reference

Re: ctypes: return a pointer to a struct

2008-04-24 Thread Jack
Thanks for the prompt and detailed reply. I tried that but was getting this error: AttributeError: 'LP_IP2LocationRecord' object has no attribute 'country_short' Here's my version, which I think is equivalent to yours: (as a matter of fact, I also tried yours and got the same error.) class

Re: ctypes: return a pointer to a struct

2008-04-24 Thread sturlamolden
On Apr 25, 5:39 am, Jack [EMAIL PROTECTED] wrote: AttributeError: 'LP_IP2LocationRecord' object has no attribute 'country_short' As it says, LP_IP2LocationRecord has no attribute called 'country_short'. IP2LocationRecord does. Use the 'contents' attribute to dereference the pointer. That is:

Re: ctypes: return a pointer to a struct

2008-04-24 Thread Jack
That worked. Thank you! AttributeError: 'LP_IP2LocationRecord' object has no attribute 'country_short' As it says, LP_IP2LocationRecord has no attribute called 'country_short'. IP2LocationRecord does. Use the 'contents' attribute to dereference the pointer. That is:

Re: ctypes: return a pointer to a struct

2008-04-24 Thread sturlamolden
On Apr 25, 5:39 am, Jack [EMAIL PROTECTED] wrote: IP2Location_get_all.restype = POINTER(IP2LocationRecord) IP2LocationObj = IP2Location_open(thisdir + '/IP-COUNTRY-SAMPLE.BIN') rec = IP2Location_get_all(IP2LocationObj, '64.233.167.99') print rec.country_short print rec.contents.country_short

Re: Psyco alternative

2008-04-24 Thread Steve Holden
sturlamolden wrote: On Apr 25, 4:57 am, Steve Holden [EMAIL PROTECTED] wrote: I am simply pointing out that RPython is used for efficiency, not to do things that can't be done in standard Python. Yes. And if we only use a very small subset of Python, it would in effect be a form of assembly

Re: Remove old version before upgrade?

2008-04-24 Thread Steve Holden
Sal wrote: I'm currently running Windows version 2.5.1 and would like to upgrade to 2.5.2. My question is, can I just go ahead and install the new version over the old or should I remove the old version with add/ remove programs first? The old version is in a directory named Python25. You can

Re: How to get inner exception traceback

2008-04-24 Thread Gabriel Genellina
En Thu, 24 Apr 2008 08:20:29 -0300, Thomas Guettler [EMAIL PROTECTED] escribió: How can you get the traceback of the inner exception? try: try: import does_not_exit except ImportError: raise Exception(something wrong) except: ... Background: In Django some

Installation in a local directory

2008-04-24 Thread Sean McDaniel
Hi y'all, I'm trying to perform a local install of python at work in my user directory. Everything compiles correctly, but I can't seem to tell the configure script the location of the bin and lib directories where I want my stuff. I've think I've passed the correct flags to the 'configure'

Re: Little novice program written in Python

2008-04-24 Thread Steve Holden
Rogério Brito wrote: Hi, All. I'm just getting my feet wet on Python and, just for starters, I'm coding some elementary number theory algorithms (yes, I know that most of them are already implemented as modules, but this is an exercise in learning the language idioms). As you can see from

Re: Installation in a local directory

2008-04-24 Thread Steve Holden
Sean McDaniel wrote: Hi y'all, I'm trying to perform a local install of python at work in my user directory. Everything compiles correctly, but I can't seem to tell the configure script the location of the bin and lib directories where I want my stuff. I've think I've passed the correct

Re: Little novice program written in Python

2008-04-24 Thread castironpi
On Apr 24, 11:09 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Thu, 24 Apr 2008 21:31:15 -0300, Rogério Brito [EMAIL PROTECTED] declaimed the following in comp.lang.python: a = [i for i in range(0,n+1)]         Uhm... At least in 2.4 and earlier, range() returns a list... No need for

Re: how to mysqldb dict cursors

2008-04-24 Thread Paul McNett
Vaibhav.bhawsar wrote: I have been trying to get the DictCursor working with mysqldb module but can't seem to. I have pasted the basic connection code and the traceback from pydev. The connection does open with the default cursor class. can't figure this one out. many thanks. Try one of:

wxpython and IEHtmlWindow, Focus Problem.

2008-04-24 Thread Farsheed Ashouri
Hi everyone. I create a little browser with wxpython and IEHtmlWindow. But I have a little problem here. When I press enter in the html page, The focus goes to another panel. Why this happens? I want to load a html page and it have textares and user should able to press enter inside html page.

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Gabriel Genellina
En Thu, 24 Apr 2008 18:18:01 -0300, Brian Munroe [EMAIL PROTECTED] escribió: Ok, so thanks everyone for the helpful hints. That *was* a typo on my part (should've been super(B...) not super(A..), but I digress) I'm building a public API. Along with the API I have a few custom types that

Re: Class Inheritance - What am I doing wrong?

2008-04-24 Thread Arnaud Delobelle
Brian Munroe [EMAIL PROTECTED] writes: Ok, so thanks everyone for the helpful hints. That *was* a typo on my part (should've been super(B...) not super(A..), but I digress) I'm building a public API. Along with the API I have a few custom types that I'm expecting API users to extend, if

Re: Explicit variable declaration

2008-04-24 Thread Jason Stokes
Filip Gruszczynski [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If you want to just declare that name exist, but doesn't want to declare the type, why don't you just do this: def somefunc(): nonlocal = nonlocal local = 0 # or None or [] or an initial value #

[issue1883] Adapt pydoc to new doc system

2008-04-24 Thread Humberto Diogenes
Humberto Diogenes [EMAIL PROTECTED] added the comment: It looks like there are no automated tests for pydoc; it's even listed in test_sundry.py. There's only one file Lib/test/pydocfodder.py which defines Something just to look at via pydoc, but isn't used anywhere (I grepped and found

[issue1883] Adapt pydoc to new doc system

2008-04-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: It's not a difference between versions, but a difference between old-style and new-style classes (which derive from object). In 3.0, all classes are new-style... -- nosy: +amaury.forgeotdarc __

[issue2677] Argument rules in callables do not apply when function uses PyArg_ParseTuple

2008-04-24 Thread Ludovico Gardenghi
New submission from Ludovico Gardenghi [EMAIL PROTECTED]: (It seems strange to me that this issue hasn't been raised in the past, maybe I just failed to find it in the BTS. In that case please excuse me and please point me to the original discussion.) The Language Reference, section 5.3.4,

[issue2677] Argument rules for callables do not apply when function implementation uses PyArg_ParseTuple

2008-04-24 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: I fail to see the problem. The open function really doesn't have a named parameter called flags; the positional parameters are unnamed. So there is no violation of the language reference, AFAICT. Perhaps it would be useful to point out that

[issue2677] Argument rules for callables do not apply when function implementation uses PyArg_ParseTuple

2008-04-24 Thread Ludovico Gardenghi
Changes by Ludovico Gardenghi [EMAIL PROTECTED]: -- title: Argument rules in callables do not apply when function uses PyArg_ParseTuple - Argument rules for callables do not apply when function implementation uses PyArg_ParseTuple __ Tracker [EMAIL

[issue2677] Argument rules for callables do not apply when function implementation uses PyArg_ParseTuple

2008-04-24 Thread Ludovico Gardenghi
Ludovico Gardenghi [EMAIL PROTECTED] added the comment: I'd believe you when you say positional parameters are unnamed, but: - the language reference contains terms such as first formal parameter name. This means that positional parameters *may* have a name but may also have no name? - if you

[issue2677] Argument rules for callables do not apply when function implementation uses PyArg_ParseTuple

2008-04-24 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: I'd believe you when you say positional parameters are unnamed, but: - the language reference contains terms such as first formal parameter name. This means that positional parameters *may* have a name but may also have no name? Correct

[issue2677] Argument rules for callables do not apply when function implementation uses PyArg_ParseTuple

2008-04-24 Thread Ludovico Gardenghi
Ludovico Gardenghi [EMAIL PROTECTED] added the comment: You are not completely wrong. It's just that this detail is something most people recognize at some point and accept as a fact, regardless of what the language specification says (and, as I claim, that text isn't incorrect - or the

[issue2677] Argument rules for callables do not apply when function implementation uses PyArg_ParseTuple

2008-04-24 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Maybe yes, the easier but probably harmless solution is to change the documentation and point out that in general, you can't. Maybe this somehow leans towards promoting a bug to the rank of feature? ;-) The language spec is stuck between

[issue2677] Argument rules for callables do not apply when function implementation uses PyArg_ParseTuple

2008-04-24 Thread Ludovico Gardenghi
Ludovico Gardenghi [EMAIL PROTECTED] added the comment: At present, unspecified is surely better than you can't, that's a good point. I understand the difficulties of balancing the reference between the abstract definition and the actual implementation. But I still believe that this should not

[issue2677] Argument rules for callables do not apply when function implementation uses PyArg_ParseTuple

2008-04-24 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Making it a documentation issue; I don't think the implementation should change. Georg, if you don't see the need for action, feel free to close it. -- assignee: - georg.brandl components: +Documentation -Library (Lib) nosy:

[issue2678] hmac performance optimization

2008-04-24 Thread Nikolay Kim
New submission from Nikolay Kim [EMAIL PROTECTED]: i removed lambda in _strxor function -- components: Library (Lib) files: hmac.py.diff keywords: patch messages: 65720 nosy: fafhrd severity: normal status: open title: hmac performance optimization type: performance versions: Python 2.5

[issue2650] re.escape should not escape underscore

2008-04-24 Thread Russ Cox
Russ Cox [EMAIL PROTECTED] added the comment: The loop in escape should really use enumerate instead of for i in range(len(pattern)). It needs i to edit s[i]. Instead of using a loop, can't the test just use self.assertEqual(re.esacpe(same), same)? Done. Also, please add tests for

[issue2679] email.feedparser regex duplicate

2008-04-24 Thread Jim Jewett
New submission from Jim Jewett [EMAIL PROTECTED]: feedparser defines four regexs for end-of-line, but two are redundant. NLCRE checks for the three common line endings. NLCRE_crack also captures the line ending. NLCRE_eol also adds a $ to ensure it is at the end. NLCRE_bol ... is identical to

[issue1496032] test_float segfaults with SIGFPE on FreeBSD 6.0 / Alpha

2008-04-24 Thread Mark Dickinson
Mark Dickinson [EMAIL PROTECTED] added the comment: There are some current math and cmath test failures on the Debian alpha buildbots (2.6 and 3.0), and I think there's a good possibility that adding -mieee to BASECFLAGS would fix these. I'm struggling to find the right way to do this in

[issue2636] Regexp 2.6 (modifications to current re 2.2.2)

2008-04-24 Thread Jim Jewett
Jim Jewett [EMAIL PROTECTED] added the comment: These features are to bring the Regexp code closer in line with Perl 5.10 Why 5.1 instead of 5.8 or at least 5.6? Is it just a scope-creep issue? as well as add a few python-specific because this also adds to the scope. 2) Make named

[issue2636] Regexp 2.6 (modifications to current re 2.2.2)

2008-04-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: These features are to bring the Regexp code closer in line with Perl 5.10 Why 5.1 instead of 5.8 or at least 5.6? Is it just a scope-creep issue? 5.10.0 comes after 5.8 and is the latest version (2007/12/18)! Yes it is

[issue2636] Regexp 2.6 (modifications to current re 2.2.2)

2008-04-24 Thread Jeffrey C. Jacobs
Jeffrey C. Jacobs [EMAIL PROTECTED] added the comment: Thanks Jim for your thoughts! Armaury has already explained about Perl 5.10.0. I suppose it's like Macintosh version numbering, since Mac Tiger went from version 10.4.9 to 10.4.10 and 10.4.11 a few years ago. Maybe we should call Python

[issue2680] gotcha: _fields_ is final but accepts lists

2008-04-24 Thread Carlos Scheidegger
New submission from Carlos Scheidegger [EMAIL PROTECTED]: When creating ctypes.Structure classes dynamically, there's a gotcha. _fields_ is final, but it takes a list that can be appended to. I'm not sure this is a bug, but I would argue it is a lot more surprising than it could be: Python

[issue2681] octal literals beginning with 8 don't raise a SyntaxError

2008-04-24 Thread Lukas Meuser
New submission from Lukas Meuser [EMAIL PROTECTED]: Octal literals containing an 8 or a 9 should raise a SyntaxError, but 8 ist accepted as the first character of such a literal (e.g., 0o8 or 0o876, but not 0o678). Those literals evaluate to 0.0. The fix for this is trivial, a patch against

[issue2680] gotcha: _fields_ is final but accepts lists

2008-04-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: The __slots__ member of a class object has the same behavior. You may mutate it (even replace it) but this has no effect: only the value available when the class statement was executed is relevant. -- nosy: +amaury.forgeotdarc

[issue2681] octal literals beginning with 8 don't raise a SyntaxError

2008-04-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: Corrected as r62480. I changed your patch a little bit: it seemed more logical to use (c '0' || c = '8') As it is the exact counterpart of ('0' = c c '8') used a few lines below. Thanks for the report! -- nosy:

[issue2680] gotcha: _fields_ is final but accepts lists

2008-04-24 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: The __slots__ member of a class object has the same behavior. You may mutate it (even replace it) but this has no effect: only the value available when the class statement was executed is relevant. The rules in ctypes are a little bit more

[issue2655] Create ctypes instances from buffer interface

2008-04-24 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: The suggestion by Lenard Lindstrom was an additional method named 'from_buffer_copy'. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2655 __

[issue2672] speed of set.update(

2008-04-24 Thread John Arbash Meinel
John Arbash Meinel [EMAIL PROTECTED] added the comment: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Alexander Belopolsky wrote: Alexander Belopolsky [EMAIL PROTECTED] added the comment: This has nothing to do with set.update, the difference is due to the time to setup the generator: $

[issue2636] Regexp 2.6 (modifications to current re 2.2.2)

2008-04-24 Thread Jim Jewett
Jim Jewett [EMAIL PROTECTED] added the comment: Python 2.6 isn't the last, but Guido has said that there won't be a 2.10. Match object is a C-struct with python binding and I'm not exactly sure how to add either feature to it I may be misunderstanding -- isn't this just a matter of writing

[issue2682] cyclic reference in ctypes CFunctionType objects

2008-04-24 Thread Thomas Heller
New submission from Thomas Heller [EMAIL PROTECTED]: Zachary Pincus posted a message about this cyclic reference in ctypes CFunctionType objects. The reference has the problem that these objects are cleaned up later than expected. The attached patch fixes this problem by removing the cyclic

[issue2682] cyclic reference in ctypes CFunctionType objects

2008-04-24 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Can you please elaborate your (apparent) concerns about this patch? IOW, why did you not check it in? -- nosy: +loewis __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2682

[issue2680] gotcha: _fields_ is final but accepts lists

2008-04-24 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Closing as won't fix. -- resolution: - wont fix status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2680 __

[issue2682] cyclic reference in ctypes CFunctionType objects

2008-04-24 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Can you please elaborate your (apparent) concerns about this patch? IOW, why did you not check it in? I have no concerns about the patch, and I am currently committing it. I'm uploading so that I can points others to it, and (hopefully) to

<    1   2   3   >