Re: ANN: New Book: Programming in Python 3

2008-12-04 Thread Mark Summerfield
On 2008-12-04, Dotan Cohen wrote: > 2008/12/4 Mark Summerfield <[EMAIL PROTECTED]>: > > Now that Python 3 final has been released I thought it would be a good > > time to mention that there's a new book to go with it: > > > > "Programming in Python 3: > > A Complete Introduction to the Python Langu

Re: Multiple Versions of Python on Windows XP

2008-12-04 Thread Glenn Linderman
On approximately 12/4/2008 5:29 AM, came the following characters from the keyboard of Colin J. Williams: Glenn Linderman wrote: The equivalent of those commands is available via Windows Explorer, Tools / Folder Options, File Types, scroll-scroll-scroll your way to .py, Click Advanced, fidd

Re: generating a liste of characters

2008-12-04 Thread Matt Nordhoff
This is a slightly old post, but oh well... Shane Geiger wrote: > import string > alphabet=list(string.letters[0:26]) > print alphabet Most of the string module's constants are locale-specific. If you want the ASCII alphabet instead of the current language's, you need to use string.ascii_{letters

Re: CONNECTION TIMED OUT ERROR using urllib2

2008-12-04 Thread rishi pathak
Before executing script do export http_proxy=http://:/ On Fri, Dec 5, 2008 at 12:06 PM, svalbard colaco <[EMAIL PROTECTED]>wrote: > Hi rishi, > > Thanks for ur reply, > yes i set the following enviroment variables (FC6 platform) > http_proxy,http_user,http_password > > But i get the same error;

Free Domain Name for life. supports for CNAME, A, MX, NS records! - Full DNS control - URL forwarding

2008-12-04 Thread srimo
Register A Domain Name Free for life. Up to 2 free domain names. - You can transfer ownership of you domain to another person. Get a cool, simple and FREE domain! No Ads supports for CNAME, A, MX, NS records! Search for the domain you want - if it's available, register it today for FREE! Full DN

Re: CONNECTION TIMED OUT ERROR using urllib2

2008-12-04 Thread svalbard colaco
Hi rishi, Thanks for ur reply, yes i set the following enviroment variables (FC6 platform) http_proxy,http_user,http_password But i get the same error; Can u tell me which other variables i need to set or am i going wrong in the syntax of these variables? Regards sv On Fri, Dec 5, 2008 at 11:5

Re: Overriding a method at the instance level on a subclass of a builtin type

2008-12-04 Thread Arnaud Delobelle
"Zac Burns" <[EMAIL PROTECTED]> writes: > Ok. Feature request then - assignment of a special method name to an > instance raises an error. I haven't got the time to implement it, but I'm sure you can obtain the behaviour you want. -- Arnaud -- http://mail.python.org/mailman/listinfo/python-lis

Re: CONNECTION TIMED OUT ERROR using urllib2

2008-12-04 Thread rishi pathak
Are you sitting behind a proxy. If so then you have to set proxy for http On Fri, Dec 5, 2008 at 11:47 AM, svalbard colaco <[EMAIL PROTECTED]>wrote: > Hi all > > I have written a small code snippet to open a URL using urllib2 to open a > web page , my python version is 2.4 but i get an urlopen er

CONNECTION TIMED OUT ERROR using urllib2

2008-12-04 Thread svalbard colaco
Hi all I have written a small code snippet to open a URL using urllib2 to open a web page , my python version is 2.4 but i get an urlopen error called connection timed out The following is the code snippet *import urllib2 f = urllib2.urlopen('http://www.google.com/') print f.read(100)* where

Re: Porting to 3.0, test coverage

2008-12-04 Thread Kay Schluehr
On 4 Dez., 23:40, Paul Hildebrandt <[EMAIL PROTECTED]> wrote: > I was just reading what's new with Python > 3.0http://docs.python.org/dev/3.0/whatsnew/3.0.html > > I like this prerequisite to porting: "Start with excellent test > coverage" > > May I suggest looking into Pythoscope for those lookin

Re: "as" keyword woes

2008-12-04 Thread Steven D'Aprano
On Thu, 04 Dec 2008 08:44:19 -0800, Matimus wrote: > The point was that there > is that new releases don't _break_ anything. But that's clearly not true, because the OP is pointing out that the new release from 2.5 to 2.6 *does* break his code. -- Steven -- http://mail.python.org/mailman/list

Re: Don't you just love writing this sort of thing :)

2008-12-04 Thread Steven D'Aprano
On Fri, 05 Dec 2008 13:27:35 +1300, Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Cong > Ma wrote: > >> The "if ... != None" is not necessary... "if PatchDatePat.search(f)" >> is OK. > > I don't do that. Perhaps you should? Since the context has been deleted, it's hard to tell

Reduce Debt

2008-12-04 Thread Lizzy
Burnt Out Ex-Factory Worker Rakes In $253,877.33 in 90 days from home.Now he's showing people all across america how to generate between $5,ooo -$10,000 a wek right from home with his Instance Incom Plan Will You be next?http://www.dollarsquickmoneyincome.com Earn -- http://mail.python.org/mailman

RELEASED Python 2.6.1

2008-12-04 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hot on the heals of Python 3.0 comes the Python 2.6.1 bug-fix release. This is the latest production-ready version in the Python 2.6 family. Dozens of issues have fixed since Python 2.6 final was released in October. Please see the NEWS file

Earn More Money

2008-12-04 Thread Lizzy
Burnt Out Ex-Factory Worker Rakes In $253,877.33 in 90 days from home.Now he's showing people all across america how to generate between $5,ooo -$10,000 a wek right from home with his Instance Incom Plan Will You be next?http://www.dollarsquickmoneyincome.com -- http://mail.python.org/mailman/list

Earn More Money

2008-12-04 Thread Lizzy
Burnt Out Ex-Factory Worker Rakes In $253,877.33 in 90 days from home.Now he's showing people all across america how to generate between $5,ooo -$10,000 a wek right from home with his Instance Incom Plan Will You be next?http://www.dollarsquickmoneyincome.com -- http://mail.python.org/mailman/list

Earn Serous money

2008-12-04 Thread Lizzy
Burnt Out Ex-Factory Worker Rakes In $253,877.33 in 90 days from home.Now he's showing people all across america how to generate between $5,ooo -$10,000 a wek right from home with his Instance Incom Plan Will You be next?http://www.dollarsquickmoneyincome.com -- http://mail.python.org/mailman/list

Earn More Noney

2008-12-04 Thread Lizzy
Burnt Out Ex-Factory Worker Rakes In $253,877.33 in 90 days from home.Now he's showing people all across america how to generate between $5,ooo -$10,000 a wek right from home with his Instance Incom Plan Will You be next?http://www.dollarsquickmoneyincome.com -- http://mail.python.org/mailman/list

Earn more money

2008-12-04 Thread Lizzy
Burnt Out Ex-Factory Worker Rakes In $253,877.33 in 90 days from home.Now he's showing people all across america how to generate between $5,ooo -$10,000 a wek right from home with his Instance Incom Plan Will You be next?http://www.dollarsquickmoneyincome.com -- http://mail.python.org/mailman/list

getting error...... Traceback (most recent call last): File "", line 1, in File "C:\Python25\Lib\site-packages\xlrd\__init__.py", line 370, in open_workbook biff_version = bk.getbof(XL

2008-12-04 Thread pk sahoo
hallo everybody, when i am running the following command >>> import xlrd >>> book=xlrd.open_workbook("C:\\a.xls") i am getting the following error.. *Traceback (most recent call last): File "", line 1, in File "C:\Python25\Lib\site-packages\xlrd\__init__.py", line 370, in open_workb ook

Re: Running a Python script from crontab

2008-12-04 Thread Philip Semanchuk
On Dec 4, 2008, at 4:21 AM, Astley Le Jasper wrote: On Dec 4, 12:34 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] central.gen.new_zealand> wrote: In message <[EMAIL PROTECTED]>, Philip Semanchuk wrote: In my experience, the environment in which a cron job runs is different from the environmen

Geeting the error Open failed: : Expected BOF record; found 0x3f3c

2008-12-04 Thread pk sahoo
hallo everybody, when i m running the command python runxlrd.py 3rows a.xls i m getting the following error === File: a.xls === *** Open failed: : Expected BOF record; found 0x3f3c what is the reason regards prasanna -- http://mail.python.org/mailman/listinfo/python-list

Re: Overriding a method at the instance level on a subclass of a builtin type

2008-12-04 Thread Aaron Brady
On Dec 4, 11:16 am, "Zac Burns" <[EMAIL PROTECTED]> wrote: > The class method seems to be the most promising, however I have more > 'state' methods to worry about so I might end up building new classes > on the fly rather than have a class per permutation of states! Now the > code isn't quite as cl

Re: RELEASED Python 3.0 final

2008-12-04 Thread Ben Finney
James Stroud <[EMAIL PROTECTED]> writes: > comp.lang.python3k ? The language has undergone an incompatible divide. Hopefully the community need not do the same. -- \ “People come up to me and say, ‘Emo, do people really come up | `\to you?’”

Re: Python 3.0 C API migration tools, or docs?

2008-12-04 Thread illume
Cool thanks Benjamin! Maybe it should be in a wiki as well? So that as people convert their modules we can add notes as well. I started a wiki with that in mind here: http://wiki.python.org/moin/cporting It'd be good if there was a link from the 2to3 docs, and in the C API docs to either/both

allocating an unsigned int memory buffer for C (swig) struct

2008-12-04 Thread njuk . njuk
i am using python (via swig) to interface with the comedi (http:// www.comedi.org/) library for some simple data acquisition. a general category of problems i am having has to do with basic comedi structs whose members require being set to a pointer of an allocated memory buffer. one specific exa

How can I do this (from Perl) in Python? (closures)

2008-12-04 Thread junk.mail.only
I > came up with the following, but it fails: > > def make_counter(start_num): > start = start_num > def counter(): > start += 1 > return counter > > from_ten = make_counter(10) > from_three = make_counter(3) In Python, you have stricter scoping rules than Perl. You c

Re: RELEASED Python 3.0 final

2008-12-04 Thread James Stroud
Barry Warsaw wrote: On behalf of the Python development team and the Python community, I am happy to announce the release of Python 3.0 final. comp.lang.python3k ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3.0 C API migration tools, or docs?

2008-12-04 Thread Benjamin
On Dec 4, 7:45 pm, illume <[EMAIL PROTECTED]> wrote: > Hi, > > are there migration tools for C API migration to python 3? > > I'm sure there must be some code somewhere to help change stuff over > right? > > I don't see any docs for migrating code from 2.x to 3.x > either:http://docs.python.org/3.

Re: Mathematica 7 compares to other languages

2008-12-04 Thread jason-sage
Xah Lee wrote: alright, here's my improved code, pasted near the bottom. let me say a few things about Jon's code. If we rate that piece of mathematica code on the level of: Beginner Mathematica programer, Intermediate, Advanced, where Beginner is someone who just learned tried to program Mathe

Re: RELEASED Python 3.0 final

2008-12-04 Thread Roger Vossler
Hi, Congratulations to the Python 3.0 team!! Great! I was able to download the Python 3.0 documentation. Looks good. Any hints when the Mac OSX version of Python 3.0 will be available? Cheers, Roger. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 3 read() function

2008-12-04 Thread Terry Reedy
Christian Heimes wrote: Terry Reedy wrote: Timing of os interaction may depend on os. I verified above on WinXp with 4 meg Pythonxy.chm file. Eye blink versus 3 secs, duplicated. I think something is wrong that needs fixing in 3.0.1. http://bugs.python.org/issue4533 I've attached a patch

Re: pretty strange behavior of "strip"

2008-12-04 Thread Terry Reedy
Guy Doune wrote: Hi everybody, Could it be a bug? Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html',

Python 3.0 C API migration tools, or docs?

2008-12-04 Thread illume
Hi, are there migration tools for C API migration to python 3? I'm sure there must be some code somewhere to help change stuff over right? I don't see any docs for migrating code from 2.x to 3.x either: http://docs.python.org/3.0/c-api/index.html Help needed with this! cheers, -- http://mail

Re: Running Python 2 and Python 3 on the same machine

2008-12-04 Thread Terry Reedy
Martin v. Löwis wrote: Since the source code is incompatible, I was expecting the Python executable to have a new name such as 'python3' It does: the executable is called python3.0. Why do you say that? As I reported on the py3 list when requesting a new name -- in particular, python3, the

Re: Running Python 2 and Python 3 on the same machine

2008-12-04 Thread Martin v. Löwis
> Since the source code is incompatible, I was expecting the Python > executable to have a new name such as 'python3' It does: the executable is called python3.0. > or for the default > source code filename to change to '.py3' or something. Such a proposal would be rejected. In a few years from

Re: Mathematica 7 compares to other languages

2008-12-04 Thread Xah Lee
alright, here's my improved code, pasted near the bottom. let me say a few things about Jon's code. If we rate that piece of mathematica code on the level of: Beginner Mathematica programer, Intermediate, Advanced, where Beginner is someone who just learned tried to program Mathematica no more t

Re: RELEASED Python 3.0 final

2008-12-04 Thread Martin v. Löwis
> I would like to ask, how long will Python 2 be developed? Just for curiosity. > There won't be a 2.10 release of Python. Whether that means that 2.9 will be the last one, or whether development stops earlier, remains to be seen. Regards, Martin -- http://mail.python.org/mailman/listinfo/python

Re: Importing Version Specific Modules

2008-12-04 Thread Michael Crute
On Thu, Dec 4, 2008 at 7:33 PM, <[EMAIL PROTECTED]> wrote: >Michael> try: >Michael> from string import Template >Michael> except ImportError: >Michael> from our.compat.string import Template > > This is "easier to ask forgiveness than permission" (EAFP). This tends to > be

Re: Importing Version Specific Modules

2008-12-04 Thread skip
Michael> if sys.version_info[:2] >= (2, 5): Michael> from string import Template Michael> else: Michael> from our.compat.string import Template This is "look before you leap" (LBYL). Michael> try: Michael> from string import Template Michael> except Import

Re: Don't you just love writing this sort of thing :)

2008-12-04 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Cong Ma wrote: > The "if ... != None" is not necessary... "if PatchDatePat.search(f)" is > OK. I don't do that. -- http://mail.python.org/mailman/listinfo/python-list

Re: To Troll or Not To Troll (aka: "as" keyword woes)

2008-12-04 Thread Warren DeLano
> From: Ben Finney <[EMAIL PROTECTED]> > > "Chris Mellon" <[EMAIL PROTECTED]> writes: > > > Peculiarities in usenet resulted in this discussion having several > > threads and I missed some messages before I wrote this email. > > I'll put this more bluntly: Warren's messages to date > egregious

Re: Mathematica 7 compares to other languages

2008-12-04 Thread sln
On Wed, 3 Dec 2008 16:32:57 -0800 (PST), Xah Lee <[EMAIL PROTECTED]> wrote: >On Dec 3, 4:22 pm, "Thomas M. Hermann" <[EMAIL PROTECTED]> wrote: >> On Dec 3, 5:26 pm, Xah Lee <[EMAIL PROTECTED]> wrote: >> >> >> >> > Agreed. My paypal address is “xah @@@ xahlee.org”. (replace the triple >> > @ to sin

Re: Overriding a method at the instance level on a subclass of a builtin type

2008-12-04 Thread Zac Burns
Ok. Feature request then - assignment of a special method name to an instance raises an error. -- Zachary Burns (407)590-4814 Aim - Zac256FL Production Engineer (Digital Overlord) Zindagi Games On Thu, Dec 4, 2008 at 10:13 AM, George Sakkis <[EMAIL PROTECTED]> wrote: > On Dec 4, 1:03 pm, "Zac B

Re: using distutils to cross-compile extensions?

2008-12-04 Thread David Cournapeau
On Fri, Dec 5, 2008 at 7:42 AM, Michael George <[EMAIL PROTECTED]> wrote: > Hi, > > Please CC me in replying as I am off list. > > I have an extension module that I've built using distutils. I wonder if > it's possible to use distutils to cross-compile it for windows on my linux > box, and whether

Re: pretty strange behavior of "strip"

2008-12-04 Thread MRAB
Guy Doune wrote: Hi everybody, Could it be a bug? Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html',

Re: pretty strange behavior of "strip"

2008-12-04 Thread James Mills
On Fri, Dec 5, 2008 at 9:35 AM, Guy Doune <[EMAIL PROTECTED]> wrote: test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html', '01.html', '05.html', '07.html', '02.html', '08.html'] test > ['03.html', '06.html', 'questions.html', '04.html', 'toc.html', '01.html', > '05.htm

Re: pretty strange behavior of "strip"

2008-12-04 Thread Ned Deily
In article <[EMAIL PROTECTED]>, Guy Doune <[EMAIL PROTECTED]> wrote: > Could it be a bug? > > Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) > [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> test=['03.html', '06.h

Re: pretty strange behavior of "strip"

2008-12-04 Thread Robert Kern
Guy Doune wrote: Hi everybody, Could it be a bug? Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html',

Re: Find Files in a Folder Between 2 Dates

2008-12-04 Thread Tim Chase
Is there a way to find all the files in a folder, between 2 dates? For example: Firstdate = 20080101 Seconddate = 20080102 Find all the files in C:\Folder that are between Firstdate and SecondDate. This should do it: import time import os firstdate = "20080101" seconddate

pretty strange behavior of "strip"

2008-12-04 Thread Guy Doune
Hi everybody, Could it be a bug? Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> test=['03.html', '06.html', 'questions.html', '04.html', 'toc.html', '01.html', '05.html

watch football online for free

2008-12-04 Thread mido
watch football online for free Watch with us through the Internet the most important football games, watched all the competition directly and free Egyptian league - Champions of Europe - the English league - regular French - German Bundesliga - Dutch league - Portuguese league - Spanish league -

Importing Version Specific Modules

2008-12-04 Thread Michael Crute
Which method makes the most sense for importing a module in python that is version specific? My use case is that I'm writing code that will be deployed into a python 2.3 environment and in a few months be upgraded to python 2.5. This: if sys.version_info[:2] >= (2, 5): from string import Templ

Re: Checking if an int fits in 32 bits?

2008-12-04 Thread John Machin
On Dec 5, 7:11 am, Roy Smith <[EMAIL PROTECTED]> wrote: > At first I thought pack() might raise an exception on a value > overflow, that but doesn't seem to be the case: > > >>> [hex(ord(c)) for c in struct.pack('!i', 9L)] > > ['0xde', '0x9f', '0xff', '0xff'] Python 2.5.2 (r25

Re: To Troll or Not To Troll

2008-12-04 Thread Ben Finney
"Chris Mellon" <[EMAIL PROTECTED]> writes: > Peculiarities in usenet resulted in this discussion having several > threads and I missed some messages before I wrote this email. I'll put this more bluntly: Warren's messages to date egregiously break the flow of discussion. Warren, in the interest

Re: Running a Python script from crontab

2008-12-04 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Astley Le Jasper wrote: > On Dec 4, 12:34 am, Lawrence D'Oliveiro <[EMAIL PROTECTED] > central.gen.new_zealand> wrote: >> >> For example, here are some headers from a recent run of the >> maildir backup task I have scheduled twice a day: >> >> Subject: Cron <[EMAIL

Re: Don't you just love writing this sort of thing :)

2008-12-04 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Duncan Booth wrote: > Have you ever considered trying to write readable code instead? > > (I must admit I haven't checked whether GZipFile works with the 'with' > statement... That's why I prefer writing _correct_ code instead. -- http://mail.python.org/mailma

Re: using distutils to cross-compile extensions?

2008-12-04 Thread Robert Kern
Michael George wrote: Hi, Please CC me in replying as I am off list. I have an extension module that I've built using distutils. I wonder if it's possible to use distutils to cross-compile it for windows on my linux box, and whether the pain involved is great. Can anyone point me in the ri

Porting to 3.0, test coverage

2008-12-04 Thread Paul Hildebrandt
I was just reading what's new with Python 3.0 http://docs.python.org/dev/3.0/whatsnew/3.0.html I like this prerequisite to porting: "Start with excellent test coverage" May I suggest looking into Pythoscope for those looking to boost test coverage. http://pythoscope.org Paul -- http://mail.pyth

using distutils to cross-compile extensions?

2008-12-04 Thread Michael George
Hi, Please CC me in replying as I am off list. I have an extension module that I've built using distutils. I wonder if it's possible to use distutils to cross-compile it for windows on my linux box, and whether the pain involved is great. Can anyone point me in the right direction? Thanks

Find Files in a Folder Between 2 Dates

2008-12-04 Thread Gregory Plantaine
Is there a way to find all the files in a folder, between 2 dates? For example: Firstdate = 20080101 Seconddate = 20080102 Find all the files in C:\Folder that are between Firstdate and SecondDate. -- http://mail.python.org/mailman/listinfo/python-list

Re: simplest way to strip a comment from the end of a line?

2008-12-04 Thread Paul McGuire
Yowza! My eyes glaze over when I see re's like "r'(?m)^(?P.*? (".*?".*?)*)(?:#.*?)?$"! Here's a simple recognizer that reads source code and suppresses comments. A comment will be a '#' character followed by the rest of the line. We need the recognizer to also detect quoted strings, so that any

Re: Python 3 read() function

2008-12-04 Thread Christian Heimes
Terry Reedy wrote: Timing of os interaction may depend on os. I verified above on WinXp with 4 meg Pythonxy.chm file. Eye blink versus 3 secs, duplicated. I think something is wrong that needs fixing in 3.0.1. http://bugs.python.org/issue4533 I've attached a patch to the bug. reading was

Re: simplest way to strip a comment from the end of a line?

2008-12-04 Thread MrJean1
Using rsplit('#', 1) works for lines *with* comments: >>> 'this is a test'.rsplit('#', 1) ['this is a test'] >>> 'this is a test #with a comment'.rsplit('#', 1) ['this is a test ', 'with a comment'] >>> "this is a '#gnarlier' test #with a comment".rsplit('#', 1) ["this is a '#gnarlier' test ", '

Re: Checking if an int fits in 32 bits?

2008-12-04 Thread Jean-Paul Calderone
On Thu, 4 Dec 2008 12:11:08 -0800 (PST), Roy Smith <[EMAIL PROTECTED]> wrote: I'm working with marshaling data over a binary wire protocol. I'm using struct.pack() to handle the low-level encoding of ints. One of the things I need to do is make sure an int can be represented in 4 bytes. Is the

Re: "as" keyword woes

2008-12-04 Thread Steven D'Aprano
On Thu, 04 Dec 2008 10:44:33 -0600, Chris Mellon wrote: > On Thu, Dec 4, 2008 at 8:45 AM, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: >> On Thu, 04 Dec 2008 20:53:38 +1000, James Mills wrote: >> >>> Readability of your code becomes very important especially if you're >>> working with many develop

Re: schizophrenic view of what is white space

2008-12-04 Thread Jean-Paul Calderone
On Thu, 04 Dec 2008 22:40:46 +0100, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: [snip] Whitespace is probably not controversial, but many parsers tend to expect things like \d to match [0-9], not any Unicode character marked as "digit". For example, I'm not sure if this behavior would be a good de

Re: RELEASED Python 3.0 final

2008-12-04 Thread George Sakkis
On Dec 4, 4:49 pm, [EMAIL PROTECTED] wrote: >     Andreas> Whenever has it been a pythonic ideal to "not allow" stuff? You >     Andreas> get warnings. Everything else is up to you. > > It's more than warnings.  With properly crafted combinations of spaces and > tabs you can get code which looks l

Re: schizophrenic view of what is white space

2008-12-04 Thread Hrvoje Niksic
MRAB <[EMAIL PROTECTED]> writes: > I'm not sure why the Unicode flag is needed in the API. I reckon > that it should just look at the text that the regular expression is > being applied to: if it's Unicode then follow the Unicode rules, if > not then don't. It might be that using Unicode tables f

Re: RELEASED Python 3.0 final

2008-12-04 Thread skip
Andreas> Whenever has it been a pythonic ideal to "not allow" stuff? You Andreas> get warnings. Everything else is up to you. It's more than warnings. With properly crafted combinations of spaces and tabs you can get code which looks like it has a certain indentation to the human observe

Re: Pythonic design patterns

2008-12-04 Thread Bruno Desthuilliers
Slaunger a écrit : Thank you all for sharing your views, links and suggestions on my question. I see where this is getting, and I have extracted the following points: 1. Many classic design patterns, especially the creational ones (Factory, etc.) aren't really that useful in Python as the built-

Re: Why shouldn't you put config options in py files

2008-12-04 Thread James Matthews
I am going to have to agree with your colleague. I use Django a lot and you are editing config.py and urls.py which are all python code. On Thu, Dec 4, 2008 at 10:30 PM, Bruno Desthuilliers < [EMAIL PROTECTED]> wrote: > HT a écrit : > >> A colleague of mine is arguing that since it is easy to wri

Re: Why shouldn't you put config options in py files

2008-12-04 Thread Bruno Desthuilliers
HT a écrit : A colleague of mine is arguing that since it is easy to write config like: FOO = {'bar': ('a': 'b'), 'abc': ('z': 'x')} in config.py and just import it to get FOO, but difficult to achieve the same using an ini file and ConfigParser, and since Python files are just text, we should

Re: Pythonic design patterns

2008-12-04 Thread Slaunger
Thank you all for sharing your views, links and suggestions on my question. I see where this is getting, and I have extracted the following points: 1. Many classic design patterns, especially the creational ones (Factory, etc.) aren't really that useful in Python as the built-in features in the la

Re: "as" keyword woes

2008-12-04 Thread Carl Banks
On Dec 4, 2:42 pm, Albert Hopkins <[EMAIL PROTECTED]> wrote: > It's been a while so I can't remember, but it seems like "yield" was > dropped in to python relatively quickly in 2.2.  Was there a similar > outrage when "yield" became a keyword? This is just one guy complaining. Yes, I'd imagine wh

Running Python 2 and Python 3 on the same machine

2008-12-04 Thread Paul Watson
The migration strategy detailed in PEP 3000 using 2to3 is quite nice. However, I am looking for suggestions for migrating to 3 while I still have code that requires 2. Since the source code is incompatible, I was expecting the Python executable to have a new name such as 'python3' or for the defau

Re: To Troll or Not To Troll

2008-12-04 Thread James Stroud
Chris Mellon wrote: On Thu, Dec 4, 2008 at 1:10 PM, Warren DeLano <[EMAIL PROTECTED]> wrote: Yet Another Python Troll (the ivory tower reference, as well as the abrupt shift from complaining about keywords to multiprocessing), I have to point out that Python does add new keywords, it has done so

Re: Good introductory book?

2008-12-04 Thread Mike Driscoll
On Dec 3, 8:44 am, "Ken D'Ambrosio" <[EMAIL PROTECTED]> wrote: > Hi, all.  I'm getting ready to do some projects in Python, and I've cut my > teeth a little bit, but I've found the "Learning|Programming Python" books > from O'Reilly to be more-or-less useless (to my surprise -- I'm usually an > O'R

Re: ANN: New Book: Programming in Python 3

2008-12-04 Thread Dotan Cohen
2008/12/4 Mark Summerfield <[EMAIL PROTECTED]>: > Now that Python 3 final has been released I thought it would be a good time > to mention that there's a new book to go with it: > > "Programming in Python 3: > A Complete Introduction to the Python Language" > ISBN 0137129297 > http://www.qtrac.eu/p

"as" keyword woes

2008-12-04 Thread Warren DeLano
> I still have not > >> seen a single post from you even hinting that you might have any > >> responsibility in the matter. > > > > Well then, let me set the record straight on that one point: > > > > I admit that it was entirely my mistake (and mine alone) to implicitly > > assume, by adopting suc

Re: ANN: New Book: Programming in Python 3

2008-12-04 Thread James Matthews
I am going to be checking Amazon now and ordering the book. Thanks James On Thu, Dec 4, 2008 at 9:42 PM, Alan G Isaac <[EMAIL PROTECTED]> wrote: > Mark Summerfield wrote: > >> "Programming in Python 3: >> A Complete Introduction to the Python Language" >> ISBN 0137129297 >> http://www.qtrac.eu/p

Re: Mathematica 7 compares to other languages

2008-12-04 Thread Dotan Cohen
2008/12/4 Kaz Kylheku <[EMAIL PROTECTED]>: > Really? I will trade you one Xah Lee for three Jon Harrops and I will even > Xah Lee is interesting because he brings up lots of good points. Also, the few times we've seen his skilz he has shown that he really knows how to code. I am willing to put up

Re: Checking if an int fits in 32 bits?

2008-12-04 Thread Roy Smith
On Dec 4, 3:33 pm, Thomas Heller <[EMAIL PROTECTED]> wrote: > Roy Smith schrieb: > > > I'm working with marshaling data over a binary wire protocol.  I'm > > using struct.pack() to handle the low-level encoding of ints.  One of > > the things I need to do is make sure an int can be represented in

Re: Python 3 read() function

2008-12-04 Thread Istvan Albert
Turns out write performance is also slow! The program below takes 3 seconds on python 2.5 17 seconds on python 3.0 yes, 17 seconds! tested many times in various order. I believe the slowdowns are not constant (3x) but some sort of nonlinear function (quadratic?) play with the N to see it.

Re: "as" keyword woes

2008-12-04 Thread Albert Hopkins
It's been a while so I can't remember, but it seems like "yield" was dropped in to python relatively quickly in 2.2. Was there a similar outrage when "yield" became a keyword? -a -- http://mail.python.org/mailman/listinfo/python-list

Re: To Troll or Not To Troll

2008-12-04 Thread Chris Mellon
On Thu, Dec 4, 2008 at 2:11 PM, Warren DeLano <[EMAIL PROTECTED]> wrote: >> I still would have to call your management of the problem considerably >> into question - your expertise at writing mathematical software may >> not be in question, but your skills and producing and managing a >> software p

Re: Good introductory book?

2008-12-04 Thread Scott David Daniels
Kottiyath wrote: If you want more of examples of how everything is done, then Python Cookbook is another one. You can get many recipes at http://code.activestate.com/recipes/langs/python/ too - the book is just selected recipes from this site Actually, it is significantly more than "ju

Re: Python Runtime Method Call Binding

2008-12-04 Thread k3xji
Thanks for the tips. >3/ Now fact is that even all this won't probably be enough to implement >a robust generic profiler - something which obviously requires a deep >understanding of the language *and* it's implementation. Indeed. Maybe not generic,but with these information at least I can write

Re: Checking if an int fits in 32 bits?

2008-12-04 Thread Thomas Heller
Roy Smith schrieb: > I'm working with marshaling data over a binary wire protocol. I'm > using struct.pack() to handle the low-level encoding of ints. One of > the things I need to do is make sure an int can be represented in 4 > bytes. Is there a portable way to do that? For now, I'm doing sig

Re: Python Runtime Method Call Binding

2008-12-04 Thread Bruno Desthuilliers
k3xji a écrit : test failed !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: "as" keyword woes

2008-12-04 Thread Carl Banks
On Dec 4, 3:44 am, James Stroud <[EMAIL PROTECTED]> wrote: > You probably aren't a developer for the cPython implementation, but, if > you were, I'd recommend taking rants like Warren's to heart because they > are born of honest frustration and practical concern. Hopefully > developers for python 2

Re: Off Topic: Re: Obama's Birth Certificate - Demand that US presidential electors investigate Obama's eligibility

2008-12-04 Thread Dan Upton
[snip > > > Follow-ups again set to talk.politics. Of course that may be futile in > dealing with this kind of scumbag. > > -- > --Bryan Also, changing newsgroups followups doesn't affect replying to the mailing list. -- http://mail.python.org/mailman/listinfo/python-list

Re: schizophrenic view of what is white space

2008-12-04 Thread MRAB
Terry Reedy wrote: MRAB wrote: Robin Becker wrote: Jean-Paul Calderone wrote: . You have to give the re module an additional hint that you care about unicode: [EMAIL PROTECTED]:~$ python Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux

Re: Why shouldn't you put config options in py files

2008-12-04 Thread rdmurray
On Thu, 4 Dec 2008 at 11:35, HT wrote: I can think of lots of arguments why this is a bad idea, but I don't seem to be able to think of a really convincing one. I think it depends on the problem domain. As someone else said, there are issues with being able to inject arbitrary code via the con

Re: "as" keyword woes

2008-12-04 Thread Carl Banks
On Dec 3, 11:42 pm, "Warren DeLano" <[EMAIL PROTECTED]> wrote: > Except that Python syntax has proven itself to be a non-backwards > compatible moving target.  Eliminating cruft and adding new > functionality is one thing, but introducing a whole new two-letter > keyword so long after the game has

Re: "as" keyword woes

2008-12-04 Thread Alan G Isaac
Warren DeLano wrote: what I can't understand is the decision to break 2.6 instead of 3.0. 2.x was supposed to remain backwards compatible, with the thinking that 2.x would be maintained in parallel for quite some time. 3.x was supposed to be the compatibility break. I do not understand why a

Checking if an int fits in 32 bits?

2008-12-04 Thread Roy Smith
I'm working with marshaling data over a binary wire protocol. I'm using struct.pack() to handle the low-level encoding of ints. One of the things I need to do is make sure an int can be represented in 4 bytes. Is there a portable way to do that? For now, I'm doing signed ints, but I'll certainl

RE: To Troll or Not To Troll

2008-12-04 Thread Warren DeLano
> I still would have to call your management of the problem considerably > into question - your expertise at writing mathematical software may > not be in question, but your skills and producing and managing a > software product are. You have nobody at your organization, which > sells a product tha

Re: Why shouldn't you put config options in py files

2008-12-04 Thread HT
Chris Rebert wrote: > On Thu, Dec 4, 2008 at 11:35 AM, HT <[EMAIL PROTECTED]> wrote: >> FOO = {'bar': ('a': 'b'), 'abc': ('z': 'x')} > > I'll assume you meant ('a', 'b') as colons in parens don't make sense. Yes, sorry. > Well, it is pretty weird to be allowed to put arbitrary code in a mere > c

Re: simplest way to strip a comment from the end of a line?

2008-12-04 Thread eric
On Dec 4, 5:15 pm, eric <[EMAIL PROTECTED]> wrote: > On Dec 4, 4:50 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > > > I have lines in a config file which can end with a comment (delimited   > > by # as in Python), but which may also contain string literals   > > (delimited by double quotes).  A comme

  1   2   3   >