Re: deleting a method

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

Code coverage to Python code

2009-01-04 Thread Hussein B
Hey, What is the best code coverage tool available for Python? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Using PythonPath under Windows Vista.

2009-01-04 Thread Morgul Banner Bearer
Hi Everybody, I was using the O'Reilly book from 1999 to look into Python and ran into a problem with the use of Pythonpath. I have Python installed under c:\python26. I have the module Brian.py that i want to run installed under c \python26\work In Windows Vista, I have set an environment

Re: Using PythonPath under Windows Vista.

2009-01-04 Thread Steve Holden
Morgul Banner Bearer wrote: Hi Everybody, I was using the O'Reilly book from 1999 to look into Python and ran into a problem with the use of Pythonpath. I have Python installed under c:\python26. I have the module Brian.py that i want to run installed under c \python26\work In

Which SOAP module?

2009-01-04 Thread Roy Smith
I'm starting to play with SOAP. The zeroth question that needs answering is, Which SOAP module should I use? There seem to be a number of different ones to pick from. Any suggestions? -- http://mail.python.org/mailman/listinfo/python-list

Re: Using PythonPath under Windows Vista.

2009-01-04 Thread Francesco Bochicchio
On Sun, 04 Jan 2009 04:56:51 -0800, Morgul Banner Bearer wrote: Hi Everybody, ... The behaviour of the program is as follows : In a Dos Box, the program executes nicely when i type : c\python26python c:\python26\work\brian.py. Now i understand that- because I set the Pythonpath- the

Re: Which SOAP module?

2009-01-04 Thread Ralf Schoenian
Roy Smith wrote: I'm starting to play with SOAP. The zeroth question that needs answering is, Which SOAP module should I use? There seem to be a number of different ones to pick from. Any suggestions? It depends on whether you want to write a client or a server application. If you only

Re: why cannot assign to function call

2009-01-04 Thread Hendrik van Rooyen
Aaron Brady ca...@gmail.com wrote: No; tuples are composite. If I flip one bit in a byte somewhere, is it the same byte? Yes and No and No and Others: Yes it is the byte at the same somewhere in memory. No it is not the same as it was a moment ago, because the bit has flipped. No it is one of

Re: Which SOAP module?

2009-01-04 Thread Stefan Behnel
Ralf Schoenian wrote: Roy Smith wrote: I'm starting to play with SOAP. The zeroth question that needs answering is, Which SOAP module should I use? There seem to be a number of different ones to pick from. Any suggestions? for the server I think you have to rely on the ZSI

Re: Which SOAP module?

2009-01-04 Thread Pierre Hanser
Ralf Schoenian a écrit : Roy Smith wrote: I'm starting to play with SOAP. The zeroth question that needs answering is, Which SOAP module should I use? There seem to be a number of different ones to pick from. Any suggestions? It depends on whether you want to write a client or a server

Re: deleting a method

2009-01-04 Thread Steve Holden
Manish Sinha wrote: Filip Gruszczyński wrote: I am trying to delete a method from a class. It's easy to delete other attributes, but when I try: class A: ... def foo(): ... pass ... a = A() del a.foo I get Traceback (most recent call last):

some question about python2.6 and python3k

2009-01-04 Thread Michael Yang
Hi,guys i am a new guy for python world,i have some question want to ask 1.should i learn about python2.6 or python3k?i heard of it has some difference from them 2.Do python3k has some good web framework(like web.py)? Thanks ! -- http://mail.python.org/mailman/listinfo/python-list

TKinter and multiprocessing in GNU/Linux/X

2009-01-04 Thread Weeble
I'm using the multiprocessing module in Python 2.6 to run a pygame application. When errors occur, I create a new Process with the multiprocessing module and have it display a TKinter dialog. The pygame application can carry on happily without waiting for the dialog. This works fine on Windows.

Re: Ideas to optimize this getitem/eval call?

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

Re: math module for Decimals

2009-01-04 Thread Mark Dickinson
On Jan 4, 9:52 am, alex goretoy aleksandr.gore...@gmail.com wrote: Also, another reason why I'm posting to this thread. I noticed some error/typo in line 683 of decimal.py located on public svn repo. This is what is looks like.         sign = 0 if _math.copysign(1.0, f) == 1.0 else 1 This

Re: Using PythonPath under Windows Vista.

2009-01-04 Thread Steve Holden
Francesco Bochicchio wrote: [...] AFAIK, PYTHONPATH only works for the imported modules. For the main module, you have to do give the full path. OR you could try out the new flag -m, which allows to run directly a module from the standard library and - I guess - also user modules if

Re: Using PythonPath under Windows Vista.

2009-01-04 Thread Andrew Lewis
In Windows Vista, I have set an environment variable Pythonpath equal to c:\python26\work (by using the My computer, Properties, Advanced, Environment Variables. I always thought pythonpath was only for imports, try adding the location to the regular path variable. Andrew --

Re: some question about python2.6 and python3k

2009-01-04 Thread Ken Seehart
Michael Yang wrote: Hi,guys i am a new guy for python world,i have some question want to ask 1.should i learn about python2.6 or python3k?i heard of it has some difference from them . I think you should go directly to 3K to save your self the extra work of learning the differences. The

IDLE spinning beach ball on OS X 10.3.9 Panther

2009-01-04 Thread kleefaj
Greetings. I want to run IDLE on my iBook running Mac OS X 10.3.9 (Panther). Per the instructions on Python on the Macintosh [1], I downloaded and installed TclTkAqua [2], then downloaded and installed Universal- MacPython-2.4.3 [3]. Python launches in Terminal. The version shown is 2.4.3.

Re: Noob question: Is all this typecasting normal?

2009-01-04 Thread alex goretoy
My gmail did that. FYI, it wasn't intentional. А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я Paula Poundstone - I don't have a bank account because I don't know my mother's maiden name. On Sun, Jan 4, 2009 at

How to declare python ints in C extensions?

2009-01-04 Thread Tony Houghton
I want to write python wrappers for the Linux DVB API. The underlying structures and constants may change from time to time, and some of the constants are generated from macros, so I think it would be better to write the module in C rather than just copying the constants into pure python code and

Re: Which SOAP module?

2009-01-04 Thread Roy Smith
On Jan 4, 10:41 am, Ralf Schoenian r...@schoenian-online.de wrote: It depends on whether you want to write a client or a server application. At least for now, I'm only interesting in clients. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to declare python ints in C extensions?

2009-01-04 Thread Saju Pillai
Tony Houghton wrote: I want to write python wrappers for the Linux DVB API. The underlying structures and constants may change from time to time, and some of the constants are generated from macros, so I think it would be better to write the module in C rather than just copying the constants

Re: How to declare python ints in C extensions?

2009-01-04 Thread Philip Semanchuk
On Jan 4, 2009, at 1:20 PM, Tony Houghton wrote: I want to write python wrappers for the Linux DVB API. The underlying structures and constants may change from time to time, and some of the constants are generated from macros, so I think it would be better to write the module in C rather than

Re: Memoizing and WeakValueDictionary

2009-01-04 Thread hsoft
On Jan 4, 5:55 am, Paul McGuire pt...@austin.rr.com wrote: Just wanted to share some experience I had in doing some memory and performance tuning of a graphics script.  I've been running some long- running scripts on high-resolution images, and added memoizing to optimize/minimize object

Re: Code coverage to Python code

2009-01-04 Thread skip
Hussein What is the best code coverage tool available for Python? Probably Ned Batchelders coverage.py. There is a trace.py module which comes with Python as well. -- Skip Montanaro - s...@pobox.com - http://smontanaro.dyndns.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Take the first n items of an iterator

2009-01-04 Thread Marc 'BlackJack' Rintsch
On Sun, 04 Jan 2009 10:55:17 +, Steven D'Aprano wrote: I thought there was an iterator in itertools for taking the first n items of an iterator, then halting, but I can't find it. Did I imagine such a tool, or am I missing something? `itertools.islice()` Ciao, Marc 'BlackJack'

Re: some question about python2.6 and python3k

2009-01-04 Thread Bruno Desthuilliers
Ken Seehart a écrit : Michael Yang wrote: Hi,guys i am a new guy for python world,i have some question want to ask 1.should i learn about python2.6 or python3k?i heard of it has some difference from them . I think you should go directly to 3K to save your self the extra work of learning

Re: IDLE spinning beach ball on OS X 10.3.9 Panther

2009-01-04 Thread Tommy Nordgren
On Jan 4, 2009, at 7:14 PM, kleefaj wrote: Greetings. I want to run IDLE on my iBook running Mac OS X 10.3.9 (Panther). Per the instructions on Python on the Macintosh [1], I downloaded and installed TclTkAqua [2], then downloaded and installed Universal- MacPython-2.4.3 [3]. Python

Re: math module for Decimals

2009-01-04 Thread alex goretoy
No, I know there's a typo because python told me there is. If you have svn repo locally. then cd into Lib/ and run python decimal.py It will tell you line 683 has syntax error, please see below. haha python-svn # python Lib/decimal.py File Lib/decimal.py, line 683 sign = 0 if

Re: deleting a method

2009-01-04 Thread Filip Gruszczyński
To answer the second question: since 'foo' is an attribute of the class 'A', you can delete the attribute from the class. class A(object): ... def foo(self): ... pass ... a = A() 'foo' in dir(a) True del A.foo 'foo' in dir(a) False

Re: some question about python2.6 and python3k

2009-01-04 Thread Benjamin Kaplan
On Sun, Jan 4, 2009 at 12:14 PM, Michael Yang michael.p.y...@gmail.comwrote: Hi,guys i am a new guy for python world,i have some question want to ask 1.should i learn about python2.6 or python3k?i heard of it has some difference from them If you don't have to worry about external

Python training in Colorado, January 27-30

2009-01-04 Thread Mark Lutz
Python author and trainer Mark Lutz will be teaching a 4-day Python class on January 27-30, in Longmont, Colorado. This is a public training session open to individual enrollments, and covers the same topics and hands-on lab work as the onsite sessions that Mark teaches. The class provides an

Re: math module for Decimals

2009-01-04 Thread Mark Dickinson
On Jan 4, 10:38 am, alex goretoy aleksandr.gore...@gmail.com wrote: haha python-svn # python Lib/decimal.py   File Lib/decimal.py, line 683     sign = 0 if _math.copysign(1.0, f) == 1.0 else 1               ^ SyntaxError: invalid syntax Although, It may be only because I ran it through

Re: Testing if an index is in a slice

2009-01-04 Thread Steven D'Aprano
On Sat, 03 Jan 2009 14:53:12 -0800, Bryan Olson wrote about testing whether or not an index is in a slice: I'm leaning towards mmanns' idea that this should be built in. What's the use-case for it? Handling all the cases is remarkably tricky. Here's a verbose version, with a little

Re: deleting a method

2009-01-04 Thread Ben Finney
Filip Gruszczyński grusz...@gmail.com writes: Thanks, now I see, what happens, but don't exactly know why. Could you point me to some good explanation how object creation is performed in Python? Rather than “how object creation is performed”, I would recommend you get a better handle on how

RE: How to find the beginning of last line of a big text file ?

2009-01-04 Thread Barak, Ron
Hi Tim, Thanks for the solution (and effort), and for teaching me some interesting new tricks. Happy 2009! Ron. -Original Message- From: Tim Chase [mailto:python.l...@tim.thechases.com] Sent: Thursday, January 01, 2009 20:04 To: Sebastian Bassi Cc: python-list@python.org Subject: Re:

pep-8 vs. external interfaces?

2009-01-04 Thread Roy Smith
I'm building a Python language wrapper to an network protocol which traditionally uses camelCase function names. I'm trying to make the new code pep-8 compliant, which means function names should be written this_way() instead of thisWay(). I've got a couple of choices open to me. I could

Re: why cannot assign to function call

2009-01-04 Thread Steve Holden
Wolfgang Strobl wrote: Derek Martin c...@pizzashack.org: It took me about a half a second to grasp the named bins concept -- i.e. as soon as I was finished reading the words that explained it I understood it, so I'd say that based on your half-hour number, Python's model is substantially

Re: math module for Decimals

2009-01-04 Thread alex goretoy
I've been watching this thread for couple days now. I followed the bug report and all that stuff. It's very interesting to me how you guys talk about this stuff. I like it alot. I a new guy to python, just fyi. I'm one of my current projects I'm using Decimal as well and I think it be a huge pain

Re: Take the first n items of an iterator

2009-01-04 Thread Steven D'Aprano
On Sun, 04 Jan 2009 11:10:05 +, Marc 'BlackJack' Rintsch wrote: On Sun, 04 Jan 2009 10:55:17 +, Steven D'Aprano wrote: I thought there was an iterator in itertools for taking the first n items of an iterator, then halting, but I can't find it. Did I imagine such a tool, or am I

Re: deleting a method

2009-01-04 Thread alex goretoy
HAHAHAHA, I like your sig Ben. So much that I blogged about it. starnixalpha.blogspot.com Oh yeah, and the info on this thread was helpful. Thanks, -A А-Б-В-Г-Д-Е-Ё-Ж-З-И-Й-К-Л-М-Н-О-П-Р-С-Т-У-Ф-Х-Ц-Ч-Ш-Щ-Ъ-Ы-Ь-Э-Ю-Я а-б-в-г-д-е-ё-ж-з-и-й-к-л-м-н-о-п-р-с-т-у-ф-х-ц-ч-ш-щ-ъ-ы-ь-э-ю-я On Sun,

Re: How to declare python ints in C extensions?

2009-01-04 Thread Christian Heimes
Philip Semanchuk schrieb: This works for me: PyModule_AddIntConstant(module, O_CREAT, O_CREAT); I've had to learn a lot about writing extensions from looking at the Python source code. Lots of valuable tricks to be learned there. This trick makes it even easier: #ifndef

Re: Python training in Colorado, January 27-30

2009-01-04 Thread alex goretoy
I'd be interested in attending if you make it to Tulsa,OK. Are your courses only in Colorado? -Alex Goretoy http://www.alexgoretoy.com On Sun, Jan 4, 2009 at 7:29 PM, Mark Lutz l...@rmi.net wrote: Python author and trainer Mark Lutz will be teaching a 4-day Python class on January 27-30, in

Memory debugging tool for Python/C API?

2009-01-04 Thread Robert Latest
Hello, extending Python in C ist just the coolest thing since sliced bread (and I'm particularly happy because I really had started to miss C when I did more and more things in Python). I've got one question though. Tha C/API documentation is not quite clear (to me, anyway) on what happens

Python3

2009-01-04 Thread alexus
I wanted to try out new Python 3 on my system, so I did make fullinstall and now as promised it broke every single program there is that runs on my system that depends on Python. is there a way to undo that? I've tried re-installing Python 2, yet that didn't help me at all. --

Package / Module Hierarchy question

2009-01-04 Thread Torsten Mohr
Hi, in a package i use these files: module (dir) __init__.py submodule __init__.py qwe.py qwe.py defines a class that derives from a class defined in submodule (and by that in submodule/__init__.py. Is it possible somehow to write in qwe.py to import submodule (though

Re: Python3

2009-01-04 Thread skip
alexus I wanted to try out new Python 3 on my system, so I did make alexus fullinstall and now as promised it broke every single program alexus there is that runs on my system that depends on Python. alexus is there a way to undo that? I've tried re-installing Python 2,

SSL certificate parsing?

2009-01-04 Thread Taras Ivashchenko
Hello, list! I use pyopenssl [0] for checking SSL certificates. And one of such checks is if given certificate is self-signed. I can do it using values of X509v3 extensions: the subject key identifier and the authority key id: X509v3 Subject Key Identifier:

Re: Python3

2009-01-04 Thread alexus
On Jan 4, 4:23 pm, s...@pobox.com wrote:     alexus I wanted to try out new Python 3 on my system, so I did make     alexus fullinstall and now as promised it broke every single program     alexus there is that runs on my system that depends on Python.     alexus is there a way to undo that?

Re: Python3

2009-01-04 Thread skip
alexus enviroment: FreeBSD j.jothost.com 7.0-RELEASE-p7 FreeBSD 7.0-RELEASE- alexus p7 #6: Wed Dec 24 15:58:06 EST 2008 ale...@j.jothost.com:/usr/obj/ alexus usr/src/sys/GENERIC i386 alexus I installed both of Python 2 and Python 3 via source code alexus (compile them

Re: Package / Module Hierarchy question

2009-01-04 Thread alex goretoy
You might try this in qwe.py import os,sys sys.path.append(os.getcwd()+../) This will allow you to then import modules from module(dir). Hope this helps. OTOH, there maybe a better solution. -Alex Goretoy http://www.alexgoretoy.com On Sun, Jan 4, 2009 at 9:10 PM, Torsten Mohr

Re: Python3

2009-01-04 Thread alexus
On Jan 4, 4:46 pm, s...@pobox.com wrote:     alexus enviroment: FreeBSD j.jothost.com 7.0-RELEASE-p7 FreeBSD 7.0-RELEASE-     alexus p7 #6: Wed Dec 24 15:58:06 EST 2008     ale...@j.jothost.com:/usr/obj/     alexus usr/src/sys/GENERIC  i386     alexus I installed both of Python 2 and

Re: Code coverage to Python code

2009-01-04 Thread Robert Kern
Hussein B wrote: Hey, What is the best code coverage tool available for Python? I like Titus Brown's figleaf. http://darcs.idyll.org/~t/projects/figleaf/doc/ -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad

Re: greenlets and how they can be used

2009-01-04 Thread James Mills
On Sun, Jan 4, 2009 at 4:52 AM, Benjamin Walkenhorst kry...@gmx.net wrote: Back when I was still using Perl, there was - and still is, I guess - a really nice framework called POE, that allowed you to write event-driven state machines in a really easy and pleasant way. Under POE, EVERYTHING

Re: Memory debugging tool for Python/C API?

2009-01-04 Thread Martin v. Löwis
This works, but I'm not sure if PyString...() really makes a new copy of the data (ellowing me to use free()) See the documentation: http://docs.python.org/c-api/string.html#PyString_FromString # Return a new string object with a *copy* of the string v as value Another example (all on the C

[ANN] TZMud 0.8

2009-01-04 Thread Lee Harr
TZMud is a Python MUD server. http://tzmud.googlecode.com/ A MUD is a text-based virtual environment accessed via telnet, or with a specialised MUD client. TZMud development is still in early stages, focusing on API and server stability. TZMud uses several high-quality Python libraries to

Re: How to declare python ints in C extensions?

2009-01-04 Thread Tony Houghton
On Sun, 04 Jan 2009 21:05:14 +0100 Christian Heimes li...@cheimes.de wrote: Philip Semanchuk schrieb: This works for me: PyModule_AddIntConstant(module, O_CREAT, O_CREAT); I've had to learn a lot about writing extensions from looking at the Python source code. Lots of valuable

Re: Testing if an index is in a slice

2009-01-04 Thread Bryan Olson
Steven D'Aprano wrote: Here's a less verbose version which passes your test cases: def inslice(index, slc, len): Return True if index would be part of slice slc of a sequence of length len, otherwise return False. start, stop, stride = slc.indices(len) if stride 0:

structuring a package?

2009-01-04 Thread Torsten Mohr
Hi, i have a question on how to structure a package best, would be great if anybody could give me some hint on this: Assuming i have a base class GraphicObject and derived from that some classes like Square, Circle, ... It looks natural to me to write in a code that uses the package: import

Re: structuring a package?

2009-01-04 Thread James Mills
On Mon, Jan 5, 2009 at 10:17 AM, Torsten Mohr tm...@s.netic.de wrote: It looks natural to me to write in a code that uses the package: import graphic import graphic.square import graphic.circle That way i'd have to structure the code like this: graphic/ __init__,py (GraphicObject)

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

2009-01-04 Thread Scott David Daniels
imageguy wrote: On Jan 2, 7:33 pm, John Machin sjmac...@lexicon.net wrote: For some very strange definition of works Well that's embarrassing ... you are correct. I need to convert from 'bgr' to 'rgb' If that is the only issue: import Image p = Image.open('~/VPython.png')

Re: pep-8 vs. external interfaces?

2009-01-04 Thread Carl Banks
On Jan 4, 1:47 pm, Roy Smith r...@panix.com wrote: Or, I could draw a line in the sand and say, If it's a protocol primitive, it stays as written.  Otherwise, it's pep-8.  That's a little uglier because it's not always obvious to the user exactly which names are protocol primitives and which

Re: why cannot assign to function call

2009-01-04 Thread Derek Martin
On Sat, Jan 03, 2009 at 10:15:51AM +, Marc 'BlackJack' Rintsch wrote: On Fri, 02 Jan 2009 04:39:15 -0600, Derek Martin wrote: On Tue, Dec 30, 2008 at 02:21:29PM +, John O'Hagan wrote: What the Python community often overlooks, when this discussion again rears its ugly head (as it

Re: why cannot assign to function call

2009-01-04 Thread Derek Martin
On Sat, Jan 03, 2009 at 11:38:46AM -0600, Grant Edwards wrote: Or are they also BIZARRE!? One presumes that Mr. Martin finds anything different from his first computer language to be BIZARRE. He should try out Prolog or something genuinely different. One's presumption would be mistaken.

Windows Python install vs. MSI extract question

2009-01-04 Thread cjl
OK -- this might be a strange question. If I do a 'full' install of Python on Windows XP, the result is a directory 'C:\Python25'. Depending on whether I install for all users or just me, the 'python25.dll' might end up in 'C:\Python25', or in the Windows system directory. If I copy python25.dll

Re: Code coverage to Python code

2009-01-04 Thread Roy Smith
In article mailman.6574.1231108877.3487.python-l...@python.org, Robert Kern robert.k...@gmail.com wrote: Hussein B wrote: Hey, What is the best code coverage tool available for Python? I like Titus Brown's figleaf. http://darcs.idyll.org/~t/projects/figleaf/doc/ I was playing with

Re: why cannot assign to function call

2009-01-04 Thread Steve Holden
Derek Martin wrote: On Sat, Jan 03, 2009 at 10:15:51AM +, Marc 'BlackJack' Rintsch wrote: On Fri, 02 Jan 2009 04:39:15 -0600, Derek Martin wrote: On Tue, Dec 30, 2008 at 02:21:29PM +, John O'Hagan wrote: What the Python community often overlooks, when this discussion again rears its

Re: Code coverage to Python code

2009-01-04 Thread David Stanek
On Sun, Jan 4, 2009 at 9:26 PM, Roy Smith r...@panix.com wrote: In article mailman.6574.1231108877.3487.python-l...@python.org, Robert Kern robert.k...@gmail.com wrote: Hussein B wrote: Hey, What is the best code coverage tool available for Python? I like Titus Brown's figleaf.

Re: Code coverage to Python code

2009-01-04 Thread James Mills
On Sun, Jan 4, 2009 at 9:35 PM, Hussein B hubaghd...@gmail.com wrote: What is the best code coverage tool available for Python? I like ot use nose with it's coverage plugin. easy_install nose easy_install co And I use the following in my top-level Makefile tests: @nosetests \

Re: Noob question: Is all this typecasting normal?

2009-01-04 Thread sprad
On Jan 3, 6:41 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: The OP comes from a Perl background, which AFAIK allows you to concat numbers to strings and add strings to numbers. That's probably the (mis) feature he was hoping Python had. That's correct -- and that's been one

Re: why cannot assign to function call

2009-01-04 Thread Grant Edwards
On 2009-01-05, Derek Martin c...@pizzashack.org wrote: On Sat, Jan 03, 2009 at 11:38:46AM -0600, Grant Edwards wrote: Or are they also BIZARRE!? One presumes that Mr. Martin finds anything different from his first computer language to be BIZARRE. He should try out Prolog or something

Re: Noob question: Is all this typecasting normal?

2009-01-04 Thread Roy Smith
In article cc87ebf5-5ce1-4fb5-bb2d-cd4bc2426...@q36g2000vbn.googlegroups.com, sprad jsp...@gmail.com wrote: On Jan 3, 6:41 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: The OP comes from a Perl background, which AFAIK allows you to concat numbers to strings and add

Re: Noob question: Is all this typecasting normal?

2009-01-04 Thread James Mills
On Mon, Jan 5, 2009 at 1:47 PM, sprad jsp...@gmail.com wrote: On Jan 3, 6:41 pm, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: The OP comes from a Perl background, which AFAIK allows you to concat numbers to strings and add strings to numbers. That's probably the (mis) feature

Re: why cannot assign to function call

2009-01-04 Thread Derek Martin
On Sun, Jan 04, 2009 at 09:30:20PM -0500, Steve Holden wrote: I'm going to go out on a limb and assert that there's NO POSSIBLE WAY a student could intuit Python's variable assignment behavior, having never been exposed to that same behavior prior. It needs to be taught. As does

Re: why cannot assign to function call

2009-01-04 Thread Derek Martin
On Sun, Jan 04, 2009 at 09:56:33PM -0600, Grant Edwards wrote: On 2009-01-05, Derek Martin c...@pizzashack.org wrote: On Sat, Jan 03, 2009 at 11:38:46AM -0600, Grant Edwards wrote: One presumes that Mr. Martin finds anything different from his first computer language to be BIZARRE. He

Re: why cannot assign to function call

2009-01-04 Thread Derek Martin
Forgive my indulgence, I find this rather academic discussion kind of interesting, as it turns out. On Sun, Jan 04, 2009 at 10:55:09PM -0600, Derek Martin wrote: You can't argue that one semantic or another is more intuitive without offering evidence. I think I have though, not that it

threading a 10 lines out of a file

2009-01-04 Thread alex goretoy
Hello All, I have a question. I'm not sure exactly as how to explain it in any other way then the way I will explain it. So I'm sorry if it's hard to understand exactly what it is I'm trying to do. Maybe not. Anyway. Here goes. Lets say I have a file that looks like this. id,name,desc,test

Re: why cannot assign to function call

2009-01-04 Thread Grant Edwards
On 2009-01-05, Derek Martin c...@pizzashack.org wrote: I'm sorry, but I really don't see how Python's assignment model could be considered bizarre by anybody who's familiar with more than one or two languages. And... what if one wasn't? The OP of this thread clearly didn't understand...

[email/quoprimime.py] AttributeError: 'tuple' object has no attribute 'lstrip'

2009-01-04 Thread Gilles Ganault
Hello I successfully use the email package to send e-mail from Python scripts, but this script fails when I fetch addresses from an SQLite database where data is Unicode-encoded: == from email.MIMEText import MIMEText import smtplib,sys import apsw

Re: threading a 10 lines out of a file

2009-01-04 Thread alex goretoy
I've found a great example on how to do threads. It compares a ping program in regular for loop and with threaded for loop. The link is below if anyone is interested. http://www.wellho.net/solutions/python-python-threads-a-first-example.html I hope my eagerness to post doesn't annoy anyone. I

Re: [email/quoprimime.py] AttributeError: 'tuple' object has no attribute 'lstrip'

2009-01-04 Thread Chris Rebert
On Sun, Jan 4, 2009 at 11:15 PM, Gilles Ganault nos...@nospam.com wrote: Hello I successfully use the email package to send e-mail from Python scripts, but this script fails when I fetch addresses from an SQLite database where data is Unicode-encoded: == from email.MIMEText

Re: why cannot assign to function call

2009-01-04 Thread Steven D'Aprano
On Mon, 05 Jan 2009 01:13:48 -0600, Grant Edwards wrote: On 2009-01-05, Derek Martin c...@pizzashack.org wrote: I'm sorry, but I really don't see how Python's assignment model could be considered bizarre by anybody who's familiar with more than one or two languages. And... what if one

[issue4825] TypeError with complex.real() and complex.imag()

2009-01-04 Thread Georg Brandl
Changes by Georg Brandl ge...@python.org: -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4825 ___

[issue4811] invalid reST markup in several documents

2009-01-04 Thread Gabriel Genellina
Changes by Gabriel Genellina gagsl-...@yahoo.com.ar: Added file: http://bugs.python.org/file12579/suspicious.rar ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4811 ___

[issue4753] Faster opcode dispatch on gcc

2009-01-04 Thread Paolo 'Blaisorblade' Giarrusso
Paolo 'Blaisorblade' Giarrusso p.giarru...@gmail.com added the comment: @Alexandre: So, can you try dropping the switch altogether, using always computed goto and seeing how does the resulting code get compiled? Removing the switch won't be possible unless we change the semantic

[issue4753] Faster opcode dispatch on gcc

2009-01-04 Thread Paolo 'Blaisorblade' Giarrusso
Paolo 'Blaisorblade' Giarrusso p.giarru...@gmail.com added the comment: @Skip: if one decides to generate binary code, there is no need to use switches. Inline threading (also known as code copying in some research papers) is what you are probably looking for:

[issue4832] idle filename extension

2009-01-04 Thread Pavel Kosina
New submission from Pavel Kosina g...@post.cz: There should not be necessity to write filename *with extension* at the saving dialog. It should be enough, at least on Windows, to put there just hello and get hello.py. It is really complication especially for beginners. If they, as they are used

[issue4831] exec() behavior - revisited

2009-01-04 Thread David M. Beazley
David M. Beazley beaz...@users.sourceforge.net added the comment: One further followup just to make sure I'm clear. Is it always safe to pass the result of locals() into exec and extract the result as shown in my example? Since I'm writing about this in a book, I just want to make

[issue4506] 3.0 make test failures on Solaris 10

2009-01-04 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: autoconf checks for isinf and isnan fixed in r68299. I also added a check for isfinite, which should really be used in preference to finite: isfinite is standard in C99, while finite doesn't seem to be part of any standard.

[issue4826] exec() docstring bug about file objects

2009-01-04 Thread Benjamin Peterson
Benjamin Peterson benja...@python.org added the comment: Thanks! Fixed in r68301. -- nosy: +benjamin.peterson resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4826

[issue4830] regrtest.py -u largefile test_io fails on OS X 10.5.6

2009-01-04 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Well, you must indeed use the newly built python, that is ./python -m test.regrtest [any arguments]. Out of curiosity, why did you specifically run test_io? Any problem on your platform? -- nosy: +pitrou resolution: - invalid status:

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2009-01-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file10527/DigiLink_esig_logo.jpg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1628484 ___

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2009-01-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file10525/DigiLink_esig_logo.jpg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1628484 ___

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2009-01-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file10526/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1628484 ___

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2009-01-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file10524/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1628484 ___

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2009-01-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file10033/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1628484 ___

[issue1628484] Python 2.5 64 bit compile fails on Solaris 10/gcc 4.1.1

2009-01-04 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file10031/unnamed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1628484 ___

[issue3959] Add Google's ipaddr.py to the stdlib

2009-01-04 Thread David Moss
David Moss drk...@gmail.com added the comment: David, in the event of netaddr's complete or partial inclusion, are you +1 with this and the maintenance of an ip/net library in Python? Yes, I would be very happy to help with this. If there's going to be lots of discussion, perhaps it

[issue4828] patch suggestion for webbrowser

2009-01-04 Thread Yinon Ehrlich
Changes by Yinon Ehrlich yino...@users.sourceforge.net: -- components: Library (Lib) files: webbrowser.patch keywords: patch nosy: Yinon severity: normal status: open title: patch suggestion for webbrowser versions: Python 2.6 Added file:

  1   2   >