ANN: new python-porting mailing list

2008-12-06 Thread Georg Brandl
Hi all, to facilitate discussion about porting Python code between different versions (mainly of course from 2.x to 3.x), we've created a new mailing list [EMAIL PROTECTED] It is a public mailing list open to everyone. We expect active participation of many people porting their

lockfile 0.6 supports Python 2.x and 3.x

2008-12-06 Thread skip
I've just released lockfile 0.6. This version supports Python 2.4, 2.5, 2.6 and 3.0. It also expands the unit tests a bit. What is lockfile? The lockfile module exports a FileLock class which provides a simple API for locking files. Unlike the Windows msvcrt.locking function, the

Re: Guido's new method definition idea

2008-12-06 Thread James Stroud
Steven D'Aprano wrote: On Fri, 05 Dec 2008 20:35:07 -0800, James Stroud wrote: Daniel Fetchinson wrote: I'd like this new way of defining methods, what do you guys think? Consider the maverick who insists on class C: def me.method(arg): self.value = arg Replace self with me.

Re: Guido's new method definition idea

2008-12-06 Thread Antoine De Groote
try this: import this and look at the 15th line... I agree that for newcomers to Python, the class method definition might seem strange. I certainly had problems with it when starting with Python, coming from Java. But in the meantime it feels right. I don't know if it is because I'm used to

Re: Pythonic design patterns

2008-12-06 Thread r . grimm
Hallo, users in this forum has been kind enough to point out. Only my implementations are often not that clean, and I may call things something different than the normal convention, which is a source of confusion for myself and others trying to communicate with me. I think, you should start

Re: Guido's new method definition idea

2008-12-06 Thread Antoine De Groote
Allowing $ as a substitute for self wouldn't require this new syntax. class C: def method($, arg): $.value = arg I'm strongly against this. This looks ugly and reminds me of Perl and Ruby. (I don't have anything against these languages, but there's a reason I use Python). Russ P.

Re: Guido's new method definition idea

2008-12-06 Thread Marc 'BlackJack' Rintsch
On Sat, 06 Dec 2008 09:56:12 +0100, Antoine De Groote wrote: try this: import this and look at the 15th line... The reason why I'm against that change too. It adds a second, alternative way to express something that is already in the language. I agree that for newcomers to Python, the

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

2008-12-06 Thread Martin v. Löwis
Ok. I built the source on an openSUSE 11.0 system. I used 'sudo make altinstll'. It created an executable /usr/local/bin/python3.0 file. Nothing was touched in /usr/bin. Ah, then you missed the fun part. Take a look at the install: target in the Makefile. I need to start writing some code

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

2008-12-06 Thread Arnaud Delobelle
Lawrence D'Oliveiro [EMAIL PROTECTED] writes: In message [EMAIL PROTECTED], Aaron Brady wrote: On Dec 5, 4:32 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: The code people write is probably a direct reflection of their thinking processes: For example, slow,

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

2008-12-06 Thread Andreas Waldenburger
On Sat, 06 Dec 2008 20:28:17 +1300 Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: Does that make any sense to you, or should I start drawing simple diagrams? People, please! Is some civility too much to ask? /W -- My real email address is constructed by swapping the domain with the recipient

Re: Guido's new method definition idea

2008-12-06 Thread Andreas Waldenburger
On 6 Dec 2008 09:18:20 GMT Marc 'BlackJack' Rintsch [EMAIL PROTECTED] wrote: On Sat, 06 Dec 2008 09:56:12 +0100, Antoine De Groote wrote: [snip reference to preferably only one way to do it] The reason why I'm against that change too. It adds a second, alternative way to express

Re: mod_python and files directory

2008-12-06 Thread Graham Dumpleton
On Dec 6, 1:52 am, mete bilgin [EMAIL PROTECTED] wrote: Hi all, I try to make a websevice with python and mod_python. İ try to make a po files, but i can not reach them in the page. When i ask the page like os.listdir('.') but i want to get files directory, what can i do? sorry for my bad

Netbeans Early Access and Python3

2008-12-06 Thread king kikapu
Hi, have anyone using this release of NetBeans (6.5 with Python support) with Python 3 without any problems ? I mean, does it work with Python3 or only with 2.x ? -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python and files directory

2008-12-06 Thread mete
but i want to take it somewhere else...i want to it work some other path in other system. On Saturday 06 December 2008 12:34:07 Graham Dumpleton wrote: On Dec 6, 1:52 am, mete bilgin [EMAIL PROTECTED] wrote: Hi all, I try to make a websevice with python and mod_python. İ try to make a po

Re: HELP!...Google SketchUp needs a Python API

2008-12-06 Thread Lie
On Dec 3, 10:06 am, r [EMAIL PROTECTED] wrote: If we can laugh what else would we do I'd like to touch also on some comments by ajaksu: [ajaksu] I'd like to try hacking some form of Python to work in SketchUp (on top of Ruby, that is). Now, why won't I try to? I'm a Linux user and we don't

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

2008-12-06 Thread Aaron Brady
On Dec 5, 7:20 pm, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Aaron Brady wrote: On Dec 5, 4:32 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: The code people write is probably a direct reflection of their

Re: slow Python 3.0 write performance?

2008-12-06 Thread Christian Heimes
Istvan Albert wrote: A previous poster suggested that in this case the slowdown is caused by the new io code being written in python rather than C. For text mode Python 3's write() method is slower than Python 2.x's method because all text is encoded. The slowdown is mostly caused by

Re: Guido's new method definition idea

2008-12-06 Thread bearophileHUGS
Antoine De Groote: Allowing $ as a substitute for self wouldn't require this new syntax. class C: def method($, arg): $.value = arg I think this (that is just sugar) may be a little better: class C: def method($, arg): $value = arg Or even this, combined with the

Insert Multiple Records Using One Insert Statemen with MySQLdb module

2008-12-06 Thread anton . ranieri . it
Hi, I'd like to insert Multiple Records Using One Insert Statement inserting one record using one insert statement works this is the example: import MySQLdb conn = MySQLdb.connect(host=localhost,.) cursore = conn.cursor() cursore.execute('INSERT INTO frutta (nome, quantita) VALUES(%s, %s)',

Re: Guido's new method definition idea

2008-12-06 Thread Aaron Brady
On Dec 5, 8:21 pm, Daniel Fetchinson [EMAIL PROTECTED] wrote: Hi folks, The story of the explicit self in method definitions has been discussed to death and we all know it will stay. However, Guido himself acknowledged that an alternative syntax makes perfect sense and having both (old and

Re: Guido's new method definition idea

2008-12-06 Thread Andreas Waldenburger
On Sat, 6 Dec 2008 04:02:54 -0800 (PST) [EMAIL PROTECTED] wrote: class C: def $method(arg): $value = arg (Note there's no point after $, it's not currently possible). Ruby uses @ and @@ for similar purposes. I agree that the code looks worse, but also shorter to read and

Re: Guido's new method definition idea

2008-12-06 Thread Andreas Waldenburger
On Sat, 6 Dec 2008 13:32:58 +0100 Andreas Waldenburger [EMAIL PROTECTED] wrote: On Sat, 6 Dec 2008 04:02:54 -0800 (PST) [EMAIL PROTECTED] suggested: class C: def $method(arg): $value = arg [snip] [snip] self is a speaking identifier, $ isn't. Also, nothing

Re: Insert Multiple Records Using One Insert Statemen with MySQLdb module

2008-12-06 Thread Albert Hopkins
On Sat, 2008-12-06 at 04:03 -0800, [EMAIL PROTECTED] wrote: Hi, I'd like to insert Multiple Records Using One Insert Statement inserting one record using one insert statement works this is the example: import MySQLdb conn = MySQLdb.connect(host=localhost,.) cursore = conn.cursor()

Re: Can't get exclusive file lock when safely renaming a file

2008-12-06 Thread Martin P. Hellwig
Steven D'Aprano wrote: cut import os, fcntl oldname = ham.txt newname = spam.txt def lock_destination(name): fileno = os.open(name, os.O_CREAT | os.O_EXCL) fcntl.flock(fileno, fcntl.LOCK_EX) # POSIX systems only return fileno # Create a test file to be renamed. f = open(oldname,

Learning Python now coming from Perl

2008-12-06 Thread Bertilo Wennergren
I'm planning to start learning Python now, using Python 3000. I have no previous Python skills, but I now Perl pretty well. I'm also well experienced with JavaScript. Any pointers and tips how I should go about getting into Python? -- Bertilo Wennergren http://bertilow.com --

Re: Multiple Versions of Python on Windows XP

2008-12-06 Thread Colin J. Williams
Glenn Linderman wrote: On approximately 12/1/2008 11:29 PM, came the following characters from the keyboard of Martin v. Löwis: It would be nice if the ftypes were version specific as created by the installer; IIRC, I created the above three from the ftype Python.File as I installed each

python book for non technical absolute beginner

2008-12-06 Thread News123
Hi, One of my 'non technical' friends complained about knowing nothing at all about programming (though using computers regularly for mails / web browsing / googling and downloading / cropping photos ) He wants to play a little with programming to stimulate parts of his otehrwise idle brain

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

2008-12-06 Thread alex23
On Dec 6, 2:22 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: I see your wink, but, please, did you read that thread started by r about the Ruby API for some piece of Google software? That was so offensively fanboyish that I almost removed Python from my computer. The one

Re: Guido's new method definition idea

2008-12-06 Thread Antoine De Groote
[EMAIL PROTECTED] wrote: Antoine De Groote: Allowing $ as a substitute for self wouldn't require this new syntax. class C: def method($, arg): $.value = arg I think this (that is just sugar) may be a little better: class C: def method($, arg): $value = arg

Re: Multiple Versions of Python on Windows XP

2008-12-06 Thread Martin v. Löwis
SciTE doesn't do that, in the default configuration it just uses whatever is called pythonw on the path, for running files having a .py or .pyw suffix. I see. By default, Python does not put itself onto PATH. Does that mean that SciTE cannot run Python scripts in the default installation?

Re: Learning Python now coming from Perl

2008-12-06 Thread Roy Smith
In article [EMAIL PROTECTED], Bertilo Wennergren [EMAIL PROTECTED] wrote: I'm planning to start learning Python now, using Python 3000. I have no previous Python skills, but I now Perl pretty well. I'm also well experienced with JavaScript. Any pointers and tips how I should go about

Re: Guido's new method definition idea

2008-12-06 Thread Antoine De Groote
Aaron Brady wrote: On Dec 5, 8:21 pm, Daniel Fetchinson [EMAIL PROTECTED] wrote: Hi folks, The story of the explicit self in method definitions has been discussed to death and we all know it will stay. However, Guido himself acknowledged that an alternative syntax makes perfect sense and

Re: Guido's new method definition idea

2008-12-06 Thread Hendrik van Rooyen
James Stroud jst...bi.ucla.edu wrote: Consider the maverick who insists on 8example with me instead of self What's the interpreter going to do with our maverick's code? Took me a while, but after I remembered that a maverick is an unmarked, wild member of the bovine species

Re: RELEASED Python 3.0 final

2008-12-06 Thread Hendrik van Rooyen
Ben Finney [EMAIL PROTECTED] wrote: I hereby recommend “pish and tosh” for use by anyone who wants to counter someone's point. It beats by a country furlong the invective that has become regrettably common here in recent months. I second the motion to use pish and tosh for a first level of

Re: Learning Python now coming from Perl

2008-12-06 Thread Bertilo Wennergren
Roy Smith wrote: Bertilo Wennergren [EMAIL PROTECTED] wrote: I'm planning to start learning Python now, using Python 3000. I have no previous Python skills, but I now Perl pretty well. I'm also well experienced with JavaScript. Any pointers and tips how I should go about getting into

Re: Guido's new method definition idea

2008-12-06 Thread Colin J. Williams
Daniel Fetchinson wrote: Hi folks, The story of the explicit self in method definitions has been discussed to death and we all know it will stay. However, Guido himself acknowledged that an alternative syntax makes perfect sense and having both (old and new) in a future version of python is a

__import__ problem

2008-12-06 Thread Kottiyath
Hi all, When I try to import a module via __import__, I am facing ImportError. But, when I tried to import it via usual 'import', it worked fine. Please see below: try: import exact except: logging.exception('Error during importing')

Re: Guido's new method definition idea

2008-12-06 Thread John Roth
On Dec 5, 7:21 pm, Daniel Fetchinson [EMAIL PROTECTED] wrote: Hi folks, The story of the explicit self in method definitions has been discussed to death and we all know it will stay. However, Guido himself acknowledged that an alternative syntax makes perfect sense and having both (old and

How you can save fuel and the environment

2008-12-06 Thread Energy Saver
Driving and Car Maintenance Transportation accounts for 66% of U.S. oil use -mainly in the form of gasoline. Luckily, there are plenty of ways to improve gas mileage. Driving Tips:- Idling gets you 0 miles per gallon. The best way to warm up a vehicle is to drive it. No more than 30 seconds of

Re: RELEASED Python 3.0 final

2008-12-06 Thread Dotan Cohen
2008/12/5 Hendrik van Rooyen [EMAIL PROTECTED]: I second the motion to use pish and tosh for a first level of disagreement. I recommend the rather archaic Balderdash as the next step in the escalation of disagreement... http://bash.org/?23396 -- Dotan Cohen http://what-is-what.com

Detaching e-mail attachments?

2008-12-06 Thread Ken D'Ambrosio
Hi, all. I've done some poking around, and can find roughly two million different ways to attach attachments to an e-mail... but darn few to detach them. Any suggestions? I'm assuming I'm just missing looking in The Right Place, but thus-far, my Googling has been for naught. Thanks! -Ken --

Re: python book for non technical absolute beginner

2008-12-06 Thread anonymous
Yes, there is an excellent book for absolute beginners call Python Programming, for the absolute beginner (second edition by Michael Dawson. Here are the reasons why it is excellent for a beginner. It doesn't go beyong basic math as do most other computer books when giving examples, exercises or

Re: Guido's new method definition idea

2008-12-06 Thread Russ P.
On Dec 6, 1:02 am, Antoine De Groote [EMAIL PROTECTED] wrote: Allowing $ as a substitute for self wouldn't require this new syntax. class C:     def method($, arg):         $.value = arg I'm strongly against this. This looks ugly and reminds me of Perl and Ruby. (I don't have anything

Re: Learning Python now coming from Perl

2008-12-06 Thread Colin J. Williams
Bertilo Wennergren wrote: Roy Smith wrote: Bertilo Wennergren [EMAIL PROTECTED] wrote: I'm planning to start learning Python now, using Python 3000. I have no previous Python skills, but I now Perl pretty well. I'm also well experienced with JavaScript. Any pointers and tips how I should

Re: Guido's new method definition idea

2008-12-06 Thread Russ P.
On Dec 6, 4:32 am, Andreas Waldenburger [EMAIL PROTECTED] wrote: On Sat, 6 Dec 2008 04:02:54 -0800 (PST) [EMAIL PROTECTED] wrote: class C:     def $method(arg):         $value = arg (Note there's no point after $, it's not currently possible). Ruby uses @ and @@ for similar purposes.

Re: Guido's new method definition idea

2008-12-06 Thread Russ P.
On Dec 6, 4:37 am, Andreas Waldenburger [EMAIL PROTECTED] wrote: On Sat, 6 Dec 2008 13:32:58 +0100 Andreas Waldenburger [EMAIL PROTECTED] wrote: On Sat, 6 Dec 2008 04:02:54 -0800 (PST) [EMAIL PROTECTED] suggested: class C:     def $method(arg):         $value = arg [snip]

Re: Guido's new method definition idea

2008-12-06 Thread Steven D'Aprano
On Sat, 06 Dec 2008 07:15:27 -0800, Russ P. wrote: On Dec 6, 4:32 am, Andreas Waldenburger [EMAIL PROTECTED] wrote: On Sat, 6 Dec 2008 04:02:54 -0800 (PST) [EMAIL PROTECTED] wrote: class C:     def $method(arg):         $value = arg (Note there's no point after $, it's not currently

Re: Learning Python now coming from Perl

2008-12-06 Thread Steven D'Aprano
On Sat, 06 Dec 2008 08:50:20 -0500, Roy Smith wrote: For your first project, pick something that's small enough that you think you could tackle it in under 50 lines of Perl. Is there anything which *can't* be written in under 50 lines of Perl? :-) One of the very first things you'll

Re: Guido's new method definition idea

2008-12-06 Thread Bruno Desthuilliers
Daniel Fetchinson a écrit : Hi folks, The story of the explicit self in method definitions has been discussed to death and we all know it will stay. However, Guido himself acknowledged that an alternative syntax makes perfect sense and having both (old and new) in a future version of python is

Re: Guido's new method definition idea

2008-12-06 Thread Antoine De Groote
Russ P. wrote: On Dec 6, 1:02 am, Antoine De Groote [EMAIL PROTECTED] wrote: Allowing $ as a substitute for self wouldn't require this new syntax. class C: def method($, arg): $.value = arg I'm strongly against this. This looks ugly and reminds me of Perl and Ruby. (I don't

Re: Guido's new method definition idea

2008-12-06 Thread Russ P.
On Dec 6, 7:34 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Sat, 06 Dec 2008 07:15:27 -0800, Russ P. wrote: On Dec 6, 4:32 am, Andreas Waldenburger [EMAIL PROTECTED] wrote: On Sat, 6 Dec 2008 04:02:54 -0800 (PST) [EMAIL PROTECTED] wrote: class C:     def

Re: Pythonic design patterns

2008-12-06 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Hallo, users in this forum has been kind enough to point out. Only my implementations are often not that clean, and I may call things something different than the normal convention, which is a source of confusion for myself and others trying to communicate with me.

CVS Folders/Contents to Automatic Website - Program suggestions

2008-12-06 Thread Phoe6
Hello all, I use cvs to maintain all my python snippets, notes, c, c++ code. As the hosting provider provides a public webserver also, I was thinking that I should convert the cvs folders automatically to website. 1) cvs2web is not what i mean. 2) doxygen may not be suitable. I tried with

Re: Python 3.0 automatic decoding of UTF16

2008-12-06 Thread Johannes Bauer
[EMAIL PROTECTED] schrieb: 2 problems: endianness and trailing zer byte. This works for me: This is very strange - when using utf16, endianness should be detected automatically. When I simply truncate the trailing zero byte, I receive: Traceback (most recent call last): File ./modify.py,

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

2008-12-06 Thread Paul Watson
On Sat, 2008-12-06 at 10:57 +0100, Martin v. Löwis wrote: Ok. I built the source on an openSUSE 11.0 system. I used 'sudo make altinstll'. It created an executable /usr/local/bin/python3.0 file. Nothing was touched in /usr/bin. Ah, then you missed the fun part. Take a look at the

Re: Guido's new method definition idea

2008-12-06 Thread bearophileHUGS
Steven D'Aprano: If a line of code uses too many instance attributes to fit comfortably on a line, spread it over two lines. There is no newline shortage, they are a renewable resource. Splitting lines is generally possible, but sometimes it's not I want, for example to keep a formula whole.

Re: Python 3.0 automatic decoding of UTF16

2008-12-06 Thread Johannes Bauer
John Machin schrieb: On Dec 6, 5:36 am, Johannes Bauer [EMAIL PROTECTED] wrote: So UTF-16 has an explicit EOF marker within the text? I cannot find one in original file, only some kind of starting sequence I suppose (0xfeff). The last characters of the file are 0x00 0x0d 0x00 0x0a, simple

Re: Python 3.0 automatic decoding of UTF16

2008-12-06 Thread MRAB
Johannes Bauer wrote: [EMAIL PROTECTED] schrieb: 2 problems: endianness and trailing zer byte. This works for me: This is very strange - when using utf16, endianness should be detected automatically. When I simply truncate the trailing zero byte, I receive: Traceback (most recent call

Re: HELP!...Google SketchUp needs a Python API

2008-12-06 Thread r
[Lie] Sketchup's target users is not power users but those who need quick sketches, so scripting isn't an extremely important feature in Sketchup.[/Lie] Your Wrong, SketchUp PRO is marketed at ACAD users and other high profile CAD and CAM applications. SketchUp models can be exported to ACAD and

Rich Comparisons Gotcha

2008-12-06 Thread Rasmus Fogh
Dear All, For the first time I have come across a Python feature that seems completely wrong. After the introduction of rich comparisons, equality comparison does not have to return a truth value, and may indeed return nothing at all and throw an error instead. As a result, code like if foo ==

Re: Can't get exclusive file lock when safely renaming a file

2008-12-06 Thread Steve M
On Dec 6, 12:25 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: The rename works, but here is my problem: after getting what I thought was an exclusive lock on the new file, but before calling os.rename(), I can still over-write it from another process: $ echo this comes from

Re: as keyword woes

2008-12-06 Thread Mensanator
On Dec 6, 8:16�am, Wolfgang Strobl [EMAIL PROTECTED] wrote: Dennis Lee Bieber [EMAIL PROTECTED]: On 05 Dec 2008 05:21:25 GMT, Steven D'Aprano [EMAIL PROTECTED] declaimed the following in comp.lang.python: On Thu, 04 Dec 2008 08:44:19 -0800, Matimus wrote: The point was that there is

Re: Guido's new method definition idea

2008-12-06 Thread r
Bad idea having two ways to do this. Pick one or the other! -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 3.0 final

2008-12-06 Thread Mensanator
On Dec 5, 12:29 pm, Hendrik van Rooyen [EMAIL PROTECTED] wrote: Ben Finney [EMAIL PROTECTED] wrote: I hereby recommend “pish and tosh” for use by anyone who wants to counter someone's point. It beats by a country furlong the invective that has become regrettably common here in recent months.

Re: Guido's new method definition idea

2008-12-06 Thread Tommy Grav
On Dec 6, 2008, at 11:42 AM, [EMAIL PROTECTED] wrote: class ThisIsAClass: def $some_method(arg1, arg2): $value = arg1 + $foo + $bar + $baz * arg2 ... I think my biggest problem with this is what got me off Perl. Add $, together with already used @ and maybe some other identifiers

Re: Learning Python now coming from Perl

2008-12-06 Thread Aahz
In article [EMAIL PROTECTED], Bertilo Wennergren [EMAIL PROTECTED] wrote: I don't suppose there is any introductory material out there that is based on Python 3000 and that is also geared at people with a Perl background? Too early for that I guess.. Honestly, the differences between 2.x and

operators as variables

2008-12-06 Thread macc_200
Hi, just starting programming and have an elementary question after playing around with lists but cannot find the answer with googling. I have a list of variables and I would like some of those variables to be integers and some to be operators so the list would look something like [5 * 4 - 4 +

Re: as keyword woes

2008-12-06 Thread MRAB
Mensanator wrote: On Dec 6, 8:16�am, Wolfgang Strobl [EMAIL PROTECTED] wrote: Dennis Lee Bieber [EMAIL PROTECTED]: On 05 Dec 2008 05:21:25 GMT, Steven D'Aprano [EMAIL PROTECTED] declaimed the following in comp.lang.python: On Thu, 04 Dec 2008 08:44:19 -0800, Matimus wrote: The point was

Re: RELEASED Python 3.0 final

2008-12-06 Thread MRAB
Mensanator wrote: On Dec 5, 12:29 pm, Hendrik van Rooyen [EMAIL PROTECTED] wrote: Ben Finney [EMAIL PROTECTED] wrote: I hereby recommend “pish and tosh” for use by anyone who wants to counter someone's point. It beats by a country furlong the invective that has become regrettably common here

Re: Guido's new method definition idea

2008-12-06 Thread Neal Becker
Daniel Fetchinson wrote: Hi folks, The story of the explicit self in method definitions has been discussed to death and we all know it will stay. However, Guido himself acknowledged that an alternative syntax makes perfect sense and having both (old and new) in a future version of python

Re: Guido's new method definition idea

2008-12-06 Thread News123
Daniel Fetchinson wrote: The proposal is to allow this: class C: def self.method( arg ): self.value = arg return self.value instead of this: class C: def method( self, arg ): self.value = arg return self.value Hmm, I'd give the proposal a

Re: Guido's new method definition idea

2008-12-06 Thread MRAB
Neal Becker wrote: Daniel Fetchinson wrote: Hi folks, The story of the explicit self in method definitions has been discussed to death and we all know it will stay. However, Guido himself acknowledged that an alternative syntax makes perfect sense and having both (old and new) in a future

Re: Learning Python now coming from Perl

2008-12-06 Thread News123
I fully agree with Roy's answer. COding small tasks is a good starting point. For quite some time you'll be of course less efficient than with your previous language, but that's part of the learning curve, isn't it. I guess you'll learn the syntax rather quickly. What's more painful is to learn

Re: Learning Python now coming from Perl

2008-12-06 Thread Roy Smith
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Aahz) wrote: In article [EMAIL PROTECTED], Bertilo Wennergren [EMAIL PROTECTED] wrote: I don't suppose there is any introductory material out there that is based on Python 3000 and that is also geared at people with a Perl background? Too

Re: Python calling COM compliant .dll

2008-12-06 Thread Gabriel Genellina
En Wed, 03 Dec 2008 16:20:27 -0200, David Shi [EMAIL PROTECTED] escribió: I am looking for a concise working example of Python script calling COM compliant .dll. The best source of information is Mark Hammond's book Python Programming in Win32. The sample chapters available are about

Re: operators as variables

2008-12-06 Thread Terry Reedy
macc_200 wrote: Hi, just starting programming and have an elementary question after playing around with lists but cannot find the answer with googling. I have a list of variables and I would like some of those variables to be integers and some to be operators so the list would look something

Re: Learning Python now coming from Perl

2008-12-06 Thread Martin P. Hellwig
News123 wrote: What's more painful is to learn which functianilty is in which library and which library exists. cut Yes and one mistake I still often find myself doing is, when confronted with a particular problem, that I write some helper code to deal with it. Of course later on I discover

Re: Learning Python now coming from Perl

2008-12-06 Thread Roy Smith
In article [EMAIL PROTECTED], Steven D'Aprano [EMAIL PROTECTED] wrote: On Sat, 06 Dec 2008 08:50:20 -0500, Roy Smith wrote: For your first project, pick something that's small enough that you think you could tackle it in under 50 lines of Perl. Is there anything which *can't* be

Re: Python 3.0 automatic decoding of UTF16

2008-12-06 Thread Mark Tolonen
Johannes Bauer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] John Machin schrieb: On Dec 6, 5:36 am, Johannes Bauer [EMAIL PROTECTED] wrote: So UTF-16 has an explicit EOF marker within the text? I cannot find one in original file, only some kind of starting sequence I suppose

Re: Profiling Python

2008-12-06 Thread Dieter Maurer
[EMAIL PROTECTED] writes on Wed, 3 Dec 2008 07:13:14 -0800 (PST): To clarify again, Is there some function like profile.PrintStats() which dynamically shows the stats before stopping the Profiler? Try to (deep) copy the profiler instance and than call PrintStats() on the copy. Of course, you

Re: as keyword woes

2008-12-06 Thread Warren DeLano
Date: Fri, 05 Dec 2008 22:22:38 -0800 From: Dennis Lee Bieber [EMAIL PROTECTED] Subject: Re: as keyword woes To: python-list@python.org Message-ID: [EMAIL PROTECTED] I'm still in the dark as to what type of data could even inspire the use of as as an object name... A collection

Re: python book for non technical absolute beginner

2008-12-06 Thread Pekka Klärck
2008/12/6 News123 [EMAIL PROTECTED]: No my question does anybody know a nice beginners book (or a learning CD or on line tutorial)? Ideally it shouldn't be too serious and have a lot of small nice mini-examples How to Think Like a Computer Scientist - Learning with Python is a good book for

Re: Rich Comparisons Gotcha

2008-12-06 Thread Terry Reedy
Rasmus Fogh wrote: Dear All, For the first time I have come across a Python feature that seems completely wrong. After the introduction of rich comparisons, equality comparison does not have to return a truth value, and may indeed return nothing at all and throw an error instead. As a result,

Re: Detaching e-mail attachments?

2008-12-06 Thread Terry Reedy
Ken D'Ambrosio wrote: Hi, all. I've done some poking around, and can find roughly two million different ways to attach attachments to an e-mail... but darn few to detach them. Any suggestions? I'm assuming I'm just missing looking in The Right Place, but thus-far, my Googling has been for

Re: as keyword woes

2008-12-06 Thread Terry Reedy
In my opinion, this thread is a crock of balony. Python *occasionally* adds keywords after giving a warning or requiring a future import in previous versions. In 2.2, one had to 'from __future__ import generators' to make a generator because doing so required the new 'yield' keyword. In

Re: as keyword woes

2008-12-06 Thread Carl Banks
On Dec 6, 1:38 pm, Warren DeLano [EMAIL PROTECTED] wrote: There, I assert that 'object.as(class_reference)' is the simplest and most elegant generalization of this widely-used convention.  Indeed, it is the only obvious concise answer, if you are limited to using methods for casting. I don't

Re: as keyword woes

2008-12-06 Thread Lie
On Dec 7, 2:38 am, Warren DeLano [EMAIL PROTECTED] wrote: Date: Fri, 05 Dec 2008 22:22:38 -0800 From: Dennis Lee Bieber [EMAIL PROTECTED] Subject: Re: as keyword woes To: [EMAIL PROTECTED] Message-ID: [EMAIL PROTECTED]    I'm still in the dark as to what type of data could even

Re: python book for non technical absolute beginner

2008-12-06 Thread Terry Reedy
News123 wrote: One of my 'non technical' friends complained about knowing nothing at all about programming (though using computers regularly for mails / web browsing / googling and downloading / cropping photos ) He wants to play a little with programming to stimulate parts of his otehrwise

Re: [Python-Dev] as keyword woes

2008-12-06 Thread Guido van Rossum
On Sat, Dec 6, 2008 at 11:38 AM, Warren DeLano [EMAIL PROTECTED] wrote: [...] There, I assert that 'object.as(class_reference)' is the simplest and most elegant generalization of this widely-used convention. Indeed, it is the only obvious concise answer, if you are limited to using methods

Re: Learning Python now coming from Perl

2008-12-06 Thread Rainy
On Dec 6, 5:00 am, Bertilo Wennergren [EMAIL PROTECTED] wrote: I'm planning to start learning Python now, using Python 3000. I have no previous Python skills, but I now Perl pretty well. I'm also well experienced with JavaScript. Any pointers and tips how I should go about getting into

Select, interrupted system call, log rotation?

2008-12-06 Thread Rainy
I got an interrupted system call exception in select and I don't know what could have caused it. Here's the error: select.select(inputs, [], [], 9) error: (4, 'Interrupted system call') Caught an exception, shutting down... It's py2.3, on mach architecture. I'm trying to figure out what

Re: Learning Python now coming from Perl

2008-12-06 Thread Carl Banks
On Dec 6, 12:30 pm, Roy Smith [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Aahz) wrote: In article [EMAIL PROTECTED], Bertilo Wennergren  [EMAIL PROTECTED] wrote: I don't suppose there is any introductory material out there that is based on Python 3000 and

Re: slow Python 3.0 write performance?

2008-12-06 Thread Terry Reedy
Christian Heimes wrote: Istvan Albert wrote: A previous poster suggested that in this case the slowdown is caused by the new io code being written in python rather than C. For text mode Python 3's write() method is slower than Python 2.x's method because all text is encoded. The slowdown is

Re: Guido's new method definition idea

2008-12-06 Thread Carl Banks
On Dec 6, 12:47 am, Patrick Mullen [EMAIL PROTECTED] wrote: Could I do something like this: def a.add(b): return a+b Outside of a class?  Of course then that makes you think you could do 5.add(6) or something crzy like that.  (I mean, you can do (5).__add__(6) but that's something else

Re: Guido's new method definition idea

2008-12-06 Thread Carl Banks
On Dec 6, 9:15 am, Russ P. [EMAIL PROTECTED] wrote: On Dec 6, 4:32 am, Andreas Waldenburger [EMAIL PROTECTED] wrote: On Sat, 6 Dec 2008 04:02:54 -0800 (PST) [EMAIL PROTECTED] wrote: class C:     def $method(arg):         $value = arg (Note there's no point after $, it's not

first time in the internet history a huge collection of funny pictures and videos over 10000 funny pics and videos download free on mobile format www.funreality.com

2008-12-06 Thread philips
first time in the internet history a huge collection of funny pictures and videos over 1 funny pics and videos download free on mobile format www.funreality.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido's new method definition idea

2008-12-06 Thread Carl Banks
On Dec 6, 9:12 am, Russ P. [EMAIL PROTECTED] wrote: On Dec 6, 1:02 am, Antoine De Groote [EMAIL PROTECTED] wrote: Allowing $ as a substitute for self wouldn't require this new syntax. class C:     def method($, arg):         $.value = arg I'm strongly against this. This looks ugly

Re: Guido's new method definition idea

2008-12-06 Thread Carl Banks
On Dec 5, 8:21 pm, Daniel Fetchinson [EMAIL PROTECTED] wrote: Hi folks, The story of the explicit self in method definitions has been discussed to death and we all know it will stay. However, Guido himself acknowledged that an alternative syntax makes perfect sense and having both (old and

Re: Can't get exclusive file lock when safely renaming a file

2008-12-06 Thread Jeffrey Straszheim
Steven D'Aprano wrote: I'm trying to safely rename a file without over-writing any existing files, and I've run into a problem with file locks. Here's a naive way of renaming without over-writing By default on a Linux filesystem, flock() gives you an _advisory_ lock. Other processes can touch

Re: Python 3.0 automatic decoding of UTF16

2008-12-06 Thread John Machin
On Dec 7, 6:20 am, Mark Tolonen [EMAIL PROTECTED] wrote: Johannes Bauer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] John Machin schrieb: On Dec 6, 5:36 am, Johannes Bauer [EMAIL PROTECTED] wrote: So UTF-16 has an explicit EOF marker within the text? I cannot find one in

  1   2   3   >