[issue17519] unittest should not try to run abstract classes

2021-04-01 Thread Stephen Thorne
Stephen Thorne added the comment: I have done some experimentation here and thought through this feature request. The concept we are trying to deliver is: "I would like to share functionality between test classes, by having an abstract parent, with concrete leaves" The metaclass a

[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2012-08-19 Thread Stephen Thorne
Stephen Thorne added the comment: Please see attached new patch, based on review comments. -- Added file: http://bugs.python.org/file26894/zipimport-issue14905-2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14905

[issue14826] urllib2.urlopen fails to load URL

2012-07-08 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: Here's a followup patch that fixes the trunk build for me. This will unbreak the builds as well as fixing this bug, but it should be investigated why URLopener calls to_bytes() and Request does not. Ideally this interface should

[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists

2012-07-07 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: Here is a patch that synthesises the directory names at the point where file names are read in. The unit test now passes, and has had the expected failure removed. Patch collaboration with Diarmuid Bourke diarmuidbou...@gmail.com

[issue11319] Command line option -t (and -tt) does not work for a particular case

2012-07-07 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: In discussion with GvR, we've decided we're not interested in intentionally rejecting code that is valid for tab width values between 1 and 8 inclusive. Thanks for the bug report! -- nosy: +jerub

[issue1508475] transparent gzip compression in urllib

2012-07-07 Thread Stephen Thorne
Changes by Stephen Thorne step...@thorne.id.au: -- nosy: +jerub ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1508475 ___ ___ Python-bugs-list

[issue14988] _elementtree: Raise ImportError when importing of pyexpat fails

2012-07-07 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: With the attached patch, with python3.3(trunk) I instead get: ./python.exe -c 'import _elementtree' Traceback (most recent call last): File string, line 1, in module File frozen importlib._bootstrap, line 1294, in _find_and_load

[issue14826] urllib2.urlopen fails to load URL

2012-07-07 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: Here is a patch that uses the same quoting logic in urllib.request.Request.__init__ as is used by urllib.request.URLopener.open() -- keywords: +patch nosy: +jerub versions: +Python 3.3 -Python 2.7 Added file: http://bugs.python.org

[issue11104] distutils sdist ignores MANIFEST

2012-02-03 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: Yep - 2.7.2 was released 11th June 2011, the fix was committed Aug 1st 2011. So it won't be in the current 2.7 release. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue11104] distutils sdist ignores MANIFEST

2011-06-25 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: Éric mentioned that i should check that this behaviour matches the documentation. I have gone and looked for all instances of MANIFEST in the documentation and found one place which was inconsistent. I've added the doc patch to the patch

[issue10510] distutils upload/register should use CRLF in HTTP requests

2011-06-25 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: I'm having a look at this ticket now. It looks like this can be rewritten to use common code, and it would probably be good to use the 'email' module for creating the MIME segements properly. -- nosy: +jerub

[issue10510] distutils upload/register should use CRLF in HTTP requests

2011-06-25 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: Okay, I looked at this, then I ran into str/byte type problems with the email module. Will wait until 'email' is sorted out before I consider a ticket like this one again. -- ___ Python tracker

[issue11104] distutils sdist ignores MANIFEST

2011-06-24 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: I have 2 patches, with tests, that applies on python2.7 and the python3 series of branches, attached this ticket. I have also got a signed contributor agreement lodged with the PSF. Can I please have someone either apply my patches

[issue11104] distutils sdist ignores MANIFEST

2011-06-24 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: Oh! I didn't see any notification that there was a review done. Thanks, I'll attend to that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11104

[issue11104] distutils sdist ignores MANIFEST

2011-06-24 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: This patch is an updated patch that fixes the things noted in the review from eric.araujo. -- Added file: http://bugs.python.org/file22437/manifest-respect-3 ___ Python tracker rep

[issue11104] distutils sdist ignores MANIFEST

2011-06-24 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: Updated the patch to address the 'why not use .strip()' question. I used .rstrip('\r\n') on the basis that filenames may have leading or trailing spaces, and if you need that, you need to be able to specify that in a MANIFEST

[issue11104] distutils sdist ignores MANIFEST

2011-06-04 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: I've taken the sdist.patch and wrote some tests for it. The resulting patch is attached as 'manifest-respect.patch'. -- nosy: +jerub Added file: http://bugs.python.org/file22242/manifest-respect.patch

[issue11104] distutils sdist ignores MANIFEST

2011-06-04 Thread Stephen Thorne
Stephen Thorne step...@thorne.id.au added the comment: This patch is tested against the 3.1 and default branches, the previous patch attached was against the 2.7 branch. -- Added file: http://bugs.python.org/file22243/manifest-respect-3.patch

Re: python admin abuse complaint

2010-02-04 Thread Stephen Thorne
On Feb 5, 8:26 am, Xah Lee xah...@gmail.com wrote: I appreciate that you taking this more seriously than normal newsgroups postings. In fact, for this complaint, the response you made is all i asked for. trolling cruft snipped I am taking this as seriously as all the articles you have posted

Re: python admin abuse complaint

2010-02-04 Thread Stephen Thorne
On Feb 5, 9:02 am, Steve Holden st...@holdenweb.com wrote: • The list of ban'd person's names, the reason for banning, and the name of admin who ban'd them, should be public. (irc already provides means for this that allows admins to annotate in the ban list.) In particular, if you are

Re: python admin abuse complaint

2010-02-03 Thread Stephen Thorne
tricky (12:12:21 PM) OhnoesRaptor: I know how to do sockets right eggy, just wondering whats up with thepythonverison :D (12:12:24 PM) mode (+o dash) by ChanServ (12:12:30 PM) You have been kicked by dash: (No.) G'day, My name is Stephen Thorne, and my nick on #python is Jerub. dash and I

Re: no sign() function ?

2008-12-22 Thread Stephen Thorne
sign(x): return cmp(x, 0) -- Regards, Stephen Thorne Development Engineer NetBox Blue - 1300 737 060 -- http://mail.python.org/mailman/listinfo/python-list

Re: Removing None objects from a sequence

2008-12-14 Thread Stephen Thorne
elements from a list that are 'False' when considered as a boolean. So None, [], '', False, etc. filter(None, myseq) an example: l = ['1', 2, 0, None, '5'] filter(None, l) ['1', 2, '5'] -- Regards, Stephen Thorne Development Engineer NetBox Blue - 1300 737 060 Scanned by the NetBox from NetBox

Re: How do I manually uninstall setuptools (installed by egg)?

2008-12-14 Thread Stephen Thorne
here: http://bazaar.launchpad.net/~jerub/packaging/trunk/annotate/11?file_id=bdist_deb.py-20080507003948-5c5mn3f68meq60hs-1 -- Regards, Stephen Thorne Development Engineer NetBox Blue - 1300 737 060 Scanned by the NetBox from NetBox Blue (http://netboxblue.com/) Can you afford to be without

Re: how to convert '\xf0' to 0xf0 ?

2008-12-11 Thread Stephen Thorne
(struct) for more information -- Regards, Stephen Thorne Development Engineer NetBox Blue - 1300 737 060 Scanned by the NetBox from NetBox Blue (http://netboxblue.com/) -- http://mail.python.org/mailman/listinfo/python-list

Re: expect-like package

2005-12-20 Thread Stephen Thorne
at these: http://www.idyll.org/~t/www-tools/twill.html http://pbp.berlios.de/ http://www.openqa.org/selenium/ -- Stephen Thorne Development Engineer -- http://mail.python.org/mailman/listinfo/python-list

Re: Not Equal to Each Other?

2005-11-03 Thread Stephen Thorne
. -- Stephen Thorne Development Engineer -- http://mail.python.org/mailman/listinfo/python-list

Re: global interpreter lock

2005-09-14 Thread Stephen Thorne
somereturnvalue http://svn.twistedmatrix.com/cvs/sandbox/radix/newdefgen.py?view=markuprev=14348 -- Stephen Thorne Development Engineer -- http://mail.python.org/mailman/listinfo/python-list

Re: optimizing out getattr

2005-09-14 Thread Stephen Thorne
spent inside this function? If you don't, then you're wasting your time doing unnecessery optimisation. -- Stephen Thorne Development Engineer -- http://mail.python.org/mailman/listinfo/python-list

Re: Who uses input()? [was Re: question on input]

2005-07-17 Thread Stephen Thorne
input() using code - not until py3k as a logical cause/effect. No one should be using input() anyway, the only place it's at-all appropriate is in a python tutorial, with the 'guess the number' game. -- Stephen Thorne Development Engineer -- http://mail.python.org/mailman/listinfo/python-list

Re: scripting browsers from Python

2005-06-01 Thread Stephen Thorne
with debug messages and non-zero exit codes. You can also load python code up so you can do arbitary stuff. -- Stephen Thorne Development Engineer -- http://mail.python.org/mailman/listinfo/python-list

Re: vim configuration for python

2005-05-25 Thread Stephen Thorne
file will be rendered as 8 wide. -- Stephen Thorne Development Engineer -- http://mail.python.org/mailman/listinfo/python-list

Re: Weird...

2005-04-11 Thread Stephen Thorne
On Apr 11, 2005 7:57 AM, Joshua Ginsberg [EMAIL PROTECTED] wrote: {'a':1,'b':'2','c':[3,4]}.keys() ['a', 'c', 'b'] How come? :-) Dicts are not ordered. See note (3) on this page : http://www.python.org/doc/current/lib/typesmapping.html -- Stephen Thorne Development Engineer -- http

Re: newbie help

2005-03-23 Thread Stephen Thorne
that helps you. -- Stephen Thorne Development Engineer -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for a 10-14 years old?

2005-03-23 Thread Stephen Thorne
material on their website under a Free license. -- Stephen Thorne Development Engineer -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython: accessing wxFrame methods in __del__ fails

2005-03-23 Thread Stephen Thorne
= self.GetPositionTuple() -- Stephen Thorne Development Engineer -- http://mail.python.org/mailman/listinfo/python-list

Re: C pointers/Python

2005-03-22 Thread Stephen Thorne
structure looks like this ..., how do I marshall dispatch that to callbacks so I can talk the protocol properly? Here is a link to the working C code http://...;) and there is a large group of wonderful people here that would love to show you the pythonic way of achieving your goal. -- Stephen Thorne

Re: (noob alert) why doesn't this work?

2005-03-22 Thread Stephen Thorne
will be used, because you don't reset the variables each time around the loop. -- Stephen Thorne Development Engineer, NetBoxBlue.com -- http://mail.python.org/mailman/listinfo/python-list

Re: comparison puzzle? bug?

2005-03-22 Thread Stephen Thorne
print statements. -- Stephen Thorne Development Engineer, NetBoxBlue.com -- http://mail.python.org/mailman/listinfo/python-list

Re: C pointers/Python

2005-03-21 Thread Stephen Thorne
to copy the result into. In Python, we return the result as an object. As for pointers, we don't need them. -- Stephen Thorne Development Engineer, NetBoxBlue.com -- http://mail.python.org/mailman/listinfo/python-list

Re: C pointers/Python

2005-03-21 Thread Stephen Thorne
testit( buffer ): for i in range( len ): buffer[A+i]=data[B+i] for some constants A,B That's unpythonic. The correct solution is to return the result. Anything else is trying to squeeze a C idiom into python for no gain. -- Stephen Thorne Development Engineer, NetBoxBlue.com -- http

Re: Web framework

2005-03-15 Thread Stephen Thorne
On Sun, 13 Mar 2005 13:21:27 -0800, Venkat B [EMAIL PROTECTED] wrote: I'd say Nevow! For apache setup, you might be interested in my wsgi [1] implementation. Hi Sridhar, Are you aware of Nevow's integrability with the webservers (CGIHTTPServer in particular) that come packaged with

Re: Convert python to exe

2005-03-13 Thread Stephen Thorne
On 13 Mar 2005 14:31:53 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi I have a python script under linux, I wonder if I can be converted to an executable or not? Yes, you can use cx_Freeze. Regards, Stephen Thorne -- http://mail.python.org/mailman/listinfo/python-list

Re: FW: list reduction

2005-03-10 Thread Stephen Thorne
it. Apologies if this is a bad question. Thanks -- James Stroud, Ph.D. UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 -- http://mail.python.org/mailman/listinfo/python-list -- Stephen Thorne Development Engineer

Re: PyAsm

2005-03-10 Thread Stephen Thorne
On 10 Mar 2005 12:35:36 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hey Roger, I didn't realize that Stefan replied to the list and sent a private email reply. There seemed to be a lag in google groups today. I basically told him that I might be crazy enough to write an assembler in

Re: modifiable config files in compiled code?

2005-03-10 Thread Stephen Thorne
=[('.', ['config.py'])]# Package config.py seperately. ) Regards, Stephen Thorne -- http://mail.python.org/mailman/listinfo/python-list

Re: injecting set into 2.3's builtins?

2005-03-10 Thread Stephen Thorne
: try: set except NameError: from sets import Set as set in my code in a few places. Its not any worse than: try: True,False except NameError: True, False = 1==1,1==0 which is in quite a bit of python2.2 code. -- Stephen Thorne Development Engineer, NetBoxBlue.com -- http

Re: py2exe error: 2.4.2.4: No such file or directory

2005-03-07 Thread Stephen Thorne
On Mon, 07 Mar 2005 16:20:30 -0600, Larry Bates [EMAIL PROTECTED] wrote: I had occasion to look back at a project I did over a year ago and needed to make one small change. I use py2exe to package it for distribution via Inno Setup. After making my change I tried to run my setup script that

Re: function with a state

2005-03-06 Thread Stephen Thorne
in range(10): assert myFun()+1 == myFun() assert myFun()*2+3 == myFun()+myFun() assert range(myFun(), myFun()+9) == [myFun() for x in range(10)] assert range(myFun()+2, myFun()+11) == [myFun() for x in range(10)] :)) couldn't-help-feeding-the-troll-ly-y'rs. Stephen Thorne. -- http://mail.python.org

Re: Static python program

2005-03-05 Thread Stephen Thorne
On Fri, 04 Mar 2005 12:10:00 +0100, Daniel Frickemeier [EMAIL PROTECTED] wrote: I´m developing a small python-program wiht the mysql-python-module. The program should run on a server without any mysql-installation. Is there any posibility to kompile a python with static libaries? Sure, have a

Re: Question - What is a faster alternative to recursion?

2005-03-02 Thread Stephen Thorne
On Wed, 02 Mar 2005 00:58:58 -0600, actuary77 [EMAIL PROTECTED] wrote: Yes, iteration is 100 times faster than recursion. The problem I have is: # need to call this function 50 times with seed of 10 (afunc(afunc(afunc(... afunc(10)) required_iterations_ 50 function:

Re: Distributing applications

2005-03-02 Thread Stephen Thorne
On Wed, 2 Mar 2005 13:07:25 -0600, Jaime Wyant [EMAIL PROTECTED] wrote: snip However, if you have an idea on updating py2exe bundled apps, I'm all ears... I'm working on a little project that requires remote updating. What I basically came up with is two nested applications. program/program.exe

Re: Attaching to a Python Interpreter a la Tcl

2005-02-23 Thread Stephen Thorne
On 23 Feb 2005 02:37:48 -0800, DE [EMAIL PROTECTED] wrote: Hello, Some long time ago, I used to use Tcl/Tk. I had an tcl embedded into my app. The coolest thing was however, I was able to attach to the interpreter (built in to my app) via a tcl shell in which I could type in regular tcl

Re: perl -p -i -e trick in Python?

2005-02-15 Thread Stephen Thorne
On Wed, 16 Feb 2005 15:18:57 +0900, Wonjae Lee [EMAIL PROTECTED] wrote: I read the comment of http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/277753. (Title : Find and replace string in all files in a directory) perl -p -i -e 's/change this/..to this/g' trick looks handy. Does

Re: convert list of tuples into several lists

2005-02-10 Thread Stephen Thorne
On Fri, 11 Feb 2005 07:35:43 +0100, Pierre Quentel [EMAIL PROTECTED] wrote: Steven Bethard a écrit : Cappy2112 wrote: What does the leading * do? Tells Python to use the following iterable as the (remainder of the) argument list: Could someone explain why this doesn't work :

That horrible regexp idiom

2005-02-09 Thread Stephen Thorne
: ' pass Thankyou for your time. Stephen Thorne [1] Actual confusement may vary. -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop in list.

2005-02-08 Thread Stephen Thorne
On Tue, 08 Feb 2005 23:07:09 -0500, Caleb Hattingh [EMAIL PROTECTED] wrote: ' a = [i*2*b for i in range(3) for b in range(4)] ' a [0, 0, 0, 0, 0, 2, 4, 6, 0, 4, 8, 12] Might take you a while to correlate the answer with the loop, but you should be able to see after a while that this nesting

Re: [perl-python] string pattern matching

2005-02-01 Thread Stephen Thorne
On Tue, 1 Feb 2005 18:59:18 -0500, Dan Perl [EMAIL PROTECTED] wrote: Perhaps someone will write a program to automatically follow up on every [perl-python] posting? The follow-up could just contain a statement like the one Daniel mentions. Obviously the program would be written in python.

Re: [perl-python] string pattern matching

2005-02-01 Thread Stephen Thorne
On Tue, 01 Feb 2005 21:19:34 -0500, Chris Smith [EMAIL PROTECTED] wrote: Falls into the 'cure worse than the disease' category. It's really just a prompt to explore the corners of Gnus, and determine how to give X.L. the thorough ignoring he deserves. *headdesk* I'm using gmail, and I can set

Re: Want to meet any of these people? They are registered for PyCon

2005-01-31 Thread Stephen Thorne
[1:] instead... unfortunately-not-going-to-pycon-ly y'rs. Stephen Thorne -- http://mail.python.org/mailman/listinfo/python-list

Re: The next Xah-lee post contest

2005-01-29 Thread Stephen Thorne
On Sat, 29 Jan 2005 19:05:55 +0530, Steve [EMAIL PROTECTED] wrote: Hi All, For sometime now, I have just been a passive lurker on this list. Of late I saw an increase in the number of posts by Xah Lee, and I have to admit, what he lacks in understanding of the various programming

Re: limited python virtual machine

2005-01-29 Thread Stephen Thorne
On Sat, 29 Jan 2005 08:53:45 -0600, Skip Montanaro [EMAIL PROTECTED] wrote: One thing my company has done is written a ``safe_eval()`` that uses a regex to disable double-underscore access. Alex will the regex catch getattr(object, Alex 'subclasses'.join(['_'*2]*2)...?-)

Re: String Fomat Conversion

2005-01-27 Thread Stephen Thorne
On Thu, 27 Jan 2005 00:02:45 -0700, Steven Bethard [EMAIL PROTECTED] wrote: Stephen Thorne wrote: f = file('input', 'r') labels = f.readline() # consume the first line of the file. Easy Option: for line in f.readlines(): x, y = line.split() x = float(x) y = float(y

Re: python memory blow out

2005-01-26 Thread Stephen Thorne
chunk is no longer used. I'm not saying running a bleeding edge CVS HEAD python plus untested development patches is going to be a solution for you in the short term, but I just wanted to mention it because I'm excited about this limitation disappearing in python :). Regards, Stephen Thorne

Re: String Fomat Conversion

2005-01-26 Thread Stephen Thorne
, Stephen Thorne -- http://mail.python.org/mailman/listinfo/python-list

Re: Python with no significant whitespace

2005-01-25 Thread Stephen Thorne
On Wed, 26 Jan 2005 11:31:18 +0800, mep [EMAIL PROTECTED] wrote: Hi,all Is there anybody trying to release a modification version to current python source code with no significant whitespace, say replacing whitespace by {} like C or java. I do *NOT* mean whitespace is good or bad, just

Re: Print a string in binary format

2005-01-20 Thread Stephen Thorne
in bytes]) Regards, Stephen Thorne -- http://mail.python.org/mailman/listinfo/python-list

Re: Unbinding multiple variables

2005-01-20 Thread Stephen Thorne
, Stephen Thorne. -- http://mail.python.org/mailman/listinfo/python-list

Re: list item's position

2005-01-19 Thread Stephen Thorne
'dropPredicate' returns true. This will mean that even if dropPredicate returns false for more than one element of the list, it will stop at the first element. If there are no elements for which dropPredicate returns true, the result will be an empty list. Regards, Stephen Thorne. -- http

Re: generator expressions: performance anomaly?

2005-01-18 Thread Stephen Thorne
Error, and definately not variables: $baz = 12; class Foo { var $bar = $baz*2; } I compute 60*60*24 every time around the loop: foreach ($myarray as $value) { $x = 60*60*24*$value; } Thankful, Former PHP Programmer, Stephen Thorne. -- http://mail.python.org/mailman/listinfo/python-list

Re: simultaneous multiple requests to very simple database

2005-01-18 Thread Stephen Thorne
, pythonic wrapper. It even has a .createTable() function for those times when you don't even want to log into the database. Regards, Stephen Thorne. -- http://mail.python.org/mailman/listinfo/python-list

Re: generator expressions: performance anomaly?

2005-01-18 Thread Stephen Thorne
): kwargs.update(constants_kwargs) return f(*arg, **kwargs) return closure return decorator Regards, Stephen Thorne -- http://mail.python.org/mailman/listinfo/python-list

Re: File objects? - under the hood question

2005-01-18 Thread Stephen Thorne
= f.read() The entire file is read directly into a single python str. Regards, Stephen Thorne. -- http://mail.python.org/mailman/listinfo/python-list

Re: Native widgets for Python

2005-01-17 Thread Stephen Thorne
there's someone writing 'dabo', which is apparently wxpython but more python. Stephen. On Mon, 17 Jan 2005 15:13:07 +0100, A. Klingenstein [EMAIL PROTECTED] wrote: Which other GUI library for Python other than wxpython has native widgets for MS Windows ? I know there is MFC and GDI, but I

Re: newbie q

2005-01-13 Thread Stephen Thorne
On Thu, 13 Jan 2005 17:05:39 +1000, Egor Bolonev [EMAIL PROTECTED] wrote: Stephen Thorne [EMAIL PROTECTED] / : news:[EMAIL PROTECTED] On Thu, 13 Jan 2005 15:55:10 +1000, Egor Bolonev [EMAIL PROTECTED] wrote: how to get rid of 'for' operator in the code? import os, os.path def

Re: else condition in list comprehension

2005-01-12 Thread Stephen Thorne
On 9 Jan 2005 12:20:40 -0800, Luis M. Gonzalez [EMAIL PROTECTED] wrote: Hi there, I'd like to know if there is a way to add and else condition into a list comprehension. I'm sure that I read somewhere an easy way to do it, but I forgot it and now I can't find it... for example: z=[i+2

Re: dict.updated

2005-01-12 Thread Stephen Thorne
On Wed, 12 Jan 2005 23:47:13 GMT, Rick Morrison [EMAIL PROTECTED] wrote: I could live with creating a new dict, sure (although it seems wasteful). I realize that something like this probably doesn't stand a chance of ever making it into the std library for what might be called philosophical

Re: Octal notation: severe deprecation

2005-01-12 Thread Stephen Thorne
On 12 Jan 2005 16:21:29 -0800, PJDM [EMAIL PROTECTED] wrote: Maybe P3K will have an integer literal like n_b for the integer n in base b. I would actually like to see pychecker pick up conceptual errors like this: import datetime datetime.datetime(2005, 04,04) Regards, Stephen Thorne -- http

Re: Refactoring; arbitrary expression in lists

2005-01-12 Thread Stephen Thorne
about efficiency, you could use something like: class SimpleMatch: def __init__(self, pattern): self.pattern = pattern def match(self, subject): return subject[-len(self.pattern):] == self.pattern Regards, Stephen Thorne -- http://mail.python.org/mailman/listinfo/python-list

Re: pyserial and com port interrupts

2005-01-12 Thread Stephen Thorne
port input in a timely manner in the face of having blocking procedures elsewhere in his code. Regards, Stephen Thorne [1] http://pyserial.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Gecko bindings for Python?

2005-01-12 Thread Stephen Thorne
there's wxMozilla, which is for embedding mozilla's rendering engine (I assume that's what you mean by 'Gecko') within wxpython/wxwidgets. Stephen. On 11 Jan 2005 07:10:57 -0800, Cordula's Web [EMAIL PROTECTED] wrote: Hello, I'd like to use the Gecko engine in GTK+ or Qt programs written in

Re: Refactoring; arbitrary expression in lists

2005-01-12 Thread Stephen Thorne
On Thu, 13 Jan 2005 05:18:57 GMT, Bengt Richter [EMAIL PROTECTED] wrote: On Thu, 13 Jan 2005 12:19:06 +1000, Stephen Thorne [EMAIL PROTECTED] wrote: On Thu, 13 Jan 2005 01:24:29 GMT, Bengt Richter [EMAIL PROTECTED] wrote: extensiondict = dict( php = 'application/x-php

Re: newbie q

2005-01-12 Thread Stephen Thorne
(os.path.join(src, x)) and len(x.split('.')) 1 and x.split('.')[-1].lower() == 'm3u']: os.remove(os.path.join(src, i)) if __name__ == '__main__': _test() import glob for x in glob.glob(*.m3u): os.remove(x) Regards, Stephen Thorne -- http://mail.python.org/mailman/listinfo/python-list

Re: a new Perl/Python a day

2005-01-10 Thread Stephen Thorne
On Mon, 10 Jan 2005 18:38:14 GMT, gabriele renzi [EMAIL PROTECTED] wrote: You're joking, right? please consider that the message you all are asking are crossposted to comp.lang.perl.misc and comp.lang.python, avoid the crossgroup flames :) Yuck. I'm on the python-list@python.org and I was

Re: Pre/Postconditions with decorators

2005-01-09 Thread Stephen Thorne
On 08 Jan 2005 15:50:48 -0800, Paul Rubin http://phr.cx@nospam.invalid wrote: Stephen Thorne [EMAIL PROTECTED] writes: Unresolved Problems: 1) How do you handle duck types, i.e. a method that accepts StringIO, cStringIO or any other object that has a .readlines(), .seek() and .read

Re: Pre/Postconditions with decorators

2005-01-08 Thread Stephen Thorne
On Fri, 7 Jan 2005 20:01:50 +0200, George Sakkis [EMAIL PROTECTED] wrote: Hi George, it would be nice to see how you have tackled the task. Maybe we will have a checker module in Python one day... ;-) I posted my module on http://rafb.net/paste/results/voZYTG78.html and its unit

Re: Pre/Postconditions with decorators

2005-01-06 Thread Stephen Thorne
On 6 Jan 2005 13:33:42 -0800, Rittersporn [EMAIL PROTECTED] wrote: @condition(number0 and number2,result=0) def sqrt(number): import math return math.sqrt(number) @condition(list(seq) is not None,sum(seq)==result) def my_sum(seq): tmp=0 for element in seq:

Re: Frameworks for Non-Content Oriented Web Apps

2005-01-01 Thread Stephen Thorne
On 1 Jan 2005 20:51:06 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: But is there some sort of framework or something that is actually meant for such web apps,application that make heavy use of forms, have very high amount of user interaction etc. etc Yeah, nevow, by those crazy twisted

Re: Lambda going out of fashion

2004-12-23 Thread Stephen Thorne
a named function). ultimate-ly yr's. Stephen Thorne. -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda going out of fashion

2004-12-23 Thread Stephen Thorne
to this thread. But at the end of the day, I'm not against removing lambda in py3k. slightly-less-concerned-ly yr's Stephen Thorne. -- http://mail.python.org/mailman/listinfo/python-list

Re: list Integer indexing dies??

2004-12-23 Thread Stephen Thorne
opinion TypeError: unsubscriptable object Just-in-my-own-opinion-ly y'rs Stephen Thorne -- http://mail.python.org/mailman/listinfo/python-list

Re: word to digit module

2004-12-22 Thread Stephen Thorne
On Wed, 22 Dec 2004 11:41:26 -0800, Scott David Daniels [EMAIL PROTECTED] wrote: John Machin wrote: Stephen Thorne wrote: .def toNumber2(s): . items = s.replace(',', '').split() . numbers = [translation.get(item.strip(), -1) for item in items if item.strip()] . stack = [0

Re: PHP vs. Python

2004-12-22 Thread Stephen Thorne
that are too slow in C, in pyrex, optimise them with psyco, or just plain fix your efficiency problems. Profiling in php isn't as easy as import profile profile.run(main()) Regards, Stephen Thorne. [1] I have written php commerically for over 3 years. This isn't a subjective look-from-afar. I

Re: regular expression: perl == python

2004-12-22 Thread Stephen Thorne
), but decided to leave it. I would probably actually send the entire match object to the action. Using something like: (re.compile('^(\d+)$'),lambda m:int(m.group(1)), and return action(m) but lambdas are going out fashion. :( Stephen Thorne -- http://mail.python.org/mailman/listinfo/python

Re: newbie question

2004-12-20 Thread Stephen Thorne
On Mon, 20 Dec 2004 18:06:36 -0600, Doug Holton [EMAIL PROTECTED] wrote: To actually answer your question, no, there is no standard for enums in python. There are custom hacks for it that you can search for. This is a good sugestion for Python 3.0, a.k.a. Python 3000:

Re: editing XML via DOM

2004-12-20 Thread Stephen Thorne
to parse crappy xml. A quick google comes up with: http://www.acooke.org/andrew/writing/python-xml.html which shows how to use xml.dom.ext.reader.Sax.FromXmlFile and then doing some stuff with createElement, appendChild and getElementsByTagName. Regards, Stephen Thorne -- http://mail.python.org

Re: Html or Pdf to Rtf (Linux) with Python

2004-12-17 Thread Stephen Thorne
On Fri, 17 Dec 2004 07:55:10 + (UTC), Axel Straschil [EMAIL PROTECTED] wrote: Hello! I've been able to successfully get konqueror to generate a pdf from a html file via dcop. It's something along the lines of: For that stuff, I'm using htmloc (http://www.htmldoc.org/). I found

Re: Html or Pdf to Rtf (Linux) with Python

2004-12-16 Thread Stephen Thorne
using JS/XUL/etc in mozilla. It probably is possible. There's lots of documentation about the XPCOM api available from http://xulplanet.com/ As for converting to RTF, someone has already pointed out PyRTF. Regards, Stephen Thorne -- http://mail.python.org/mailman/listinfo/python-list