Re: [Python 2.6] print_function and unicode_literals cannot be used at the same time?

2008-10-26 Thread Gabriel Genellina
En Sun, 26 Oct 2008 12:13:08 -0200, Christian Heimes <[EMAIL PROTECTED]> escribió: ?? wrote: Any ideas? Code 1: from __future__ import print_function, unicode_literals import sys print(type('HELLO, WORLD!'), file=sys.stderr) You have to do each future import in a separate line: >>>

Re: Improving interpreter startup speed

2008-10-26 Thread Terry Reedy
David Cournapeau wrote: On Mon, Oct 27, 2008 at 10:52 AM, James Mills <[EMAIL PROTECTED]> wrote: On Mon, Oct 27, 2008 at 4:12 AM, Benjamin Kaplan +1 This thread is stupid and pointless. Even for a so-called cold startup 0.5s is fast enough! Not if the startup is the main cost for a command you

Re: Improving interpreter startup speed

2008-10-26 Thread James Mills
On Mon, Oct 27, 2008 at 3:15 PM, David Cournapeau <[EMAIL PROTECTED]> wrote: > Not if the startup is the main cost for a command you need to repeat many > times. Seriously if you have to spawn and kill python processes that many times for an initial cold startup and subsequent warm startups to be

Re: Improving interpreter startup speed

2008-10-26 Thread David Cournapeau
On Mon, Oct 27, 2008 at 10:52 AM, James Mills <[EMAIL PROTECTED]> wrote: > On Mon, Oct 27, 2008 at 4:12 AM, Benjamin Kaplan > +1 This thread is stupid and pointless. > Even for a so-called cold startup 0.5s is fast enough! Not if the startup is the main cost for a command you need to repeat many t

Re: capturing ESC, page up/down in Python

2008-10-26 Thread Terry Reedy
jordilin <[EMAIL PROTECTED]> wrote: Is there any way to capture the keyboard events ESC, page up (next page), page down (previous page) in Python?. I mean, how can I capture if user presses one of those keys in a terminal based application? I was thinking about pygame.key.get_pressed from the p

Re: Triple-quoted strings hath not the Python-nature

2008-10-26 Thread Mel
Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Steven D'Aprano > wrote: > >> I disagree. Triple-quoted strings are exactly the same as other strings: >> they capture *exactly* what you put in them ... > > But that conflicts with the use of whitespace for indentation rules. Other >

Re: Module python-magic on/for Windows - UPDATE: WORKING & HowTo!!!

2008-10-26 Thread Carl K
Michael Torrie wrote: > Carl K wrote: >> I need to convert pdf to png, which imagemagic convert does, I think by using >> ghostscript. a little over a year ago I tried with some imagemagic (there >> are >> at least 2 i think) and neither seemed close to working (for pdf that is.) >> any >> idea

Re: Module python-magic on/for Windows - UPDATE: WORKING & HowTo!!!

2008-10-26 Thread Michael Torrie
Carl K wrote: > I need to convert pdf to png, which imagemagic convert does, I think by using > ghostscript. a little over a year ago I tried with some imagemagic (there are > at least 2 i think) and neither seemed close to working (for pdf that is.) > any > idea if pdf conversion is working? p

Re: set/dict comp in Py2.6

2008-10-26 Thread Benjamin
On Oct 25, 3:13 am, [EMAIL PROTECTED] wrote: > I'd like to know why Python 2.6 doesn't have the syntax to create sets/ > dicts of Python 3.0, like: Because nobody bothered to backport it. > > {x*x for x in xrange(10)} > {x:x*x for x in xrange(10)} > > Bye, > bearophile -- http://mail.python.org/m

Re: set/dict comp in Py2.6

2008-10-26 Thread Benjamin
On Oct 25, 3:13 am, [EMAIL PROTECTED] wrote: > I'd like to know why Python 2.6 doesn't have the syntax to create sets/ > dicts of Python 3.0, like: Because nobody bothered to backport it. > > {x*x for x in xrange(10)} > {x:x*x for x in xrange(10)} > > Bye, > bearophile -- http://mail.python.org/m

Re: 2.6, 3.0, and truly independent intepreters

2008-10-26 Thread James Mills
On Mon, Oct 27, 2008 at 12:03 PM, Andy O'Meara <[EMAIL PROTECTED]> wrote: > I think we miscommunicated there--I'm actually agreeing with you. I > was trying to make the same point you were: that intricate and/or > large structures are meant to be passed around by a top-level pointer, > not using a

Re: 2.6, 3.0, and truly independent intepreters

2008-10-26 Thread Andy O'Meara
> > And in the case of hundreds of megs of data > > ... and I would be surprised at someone that would embed hundreds of > megs of data into an object such that it had to be serialized... seems > like the proper design is to point at the data, or a subset of it, in a > big buffer.  Then data tran

Re: Improving interpreter startup speed

2008-10-26 Thread James Mills
On Mon, Oct 27, 2008 at 3:45 AM, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > Pedro was talking about cold startup time: > > $ sudo sh -c "echo 3 > /proc/sys/vm/drop_caches" > $ time python -c "pass" > > real0m0.627s > user0m0.016s > sys 0m0.008s $ sudo sh -c "echo 3 > /proc/sys/vm/dro

Re: Immutable object thread-safety

2008-10-26 Thread Alcari The Mad
Laszlo Nagy wrote: > >> Also, the other question is the operation st = 'ThreadBWasHere' is >> atomic? > I think this is the same question. And I believe it is not atomic, > because it is actually rebinding a name. Consider this: > > a,b = b,a > > This will rebind both a and b. In order to be co

Re: Improving interpreter startup speed

2008-10-26 Thread James Mills
On Mon, Oct 27, 2008 at 4:12 AM, Benjamin Kaplan <[EMAIL PROTECTED]> wrote: > You must be in a real big hurry if half a second matters that much to you. > Maybe if it took 5 seconds for the interpreter to start up, I could > understand having a problem with the start up time. +1 This thread is stu

Re: 2.6, 3.0, and truly independent intepreters

2008-10-26 Thread Andy O'Meara
On Oct 24, 9:52 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >> A c-level module, on the other hand, can sidestep/release > >> the GIL at will, and go on it's merry way and process away. > > > ...Unless part of the C module execution involves the need do CPU- > > bound work on another thread

Re: Porting VB apps to Python for Window / Linux use

2008-10-26 Thread Ben Finney
Lawrence D'Oliveiro <[EMAIL PROTECTED]> writes: > Software has no market value. Business models that try to assign it > one are doomed to fight an uphill battle against market forces. +1 QOTW. -- \ “Yesterday I told a chicken to cross the road. It said, ‘What | `\

Re: Immutable object thread-safety

2008-10-26 Thread Alcari The Mad
k3xji wrote: > Hi all, > > This will probably be a long question/short answer, sorry, but I have > wandered net about the subject and really feel cannot find just enough > information.I want to ask my question by giving an example to > explicitly express my understanding which may be also wrong: >

v4l module

2008-10-26 Thread Carl K
I am looking for a v4l (either version 1 or 2) module. I tried to use ctypes with ghostscript and failed. I have a feeling trying to use it with kernel modules would be even harder, so not exactly what "I" want to do. I just tried http://antonym.org/libfg and it segfaulted. (bugs reported) I f

Re: 2.6, 3.0, and truly independent intepreters

2008-10-26 Thread Andy O'Meara
Grrr... I posted a ton of lengthy replies to you and other recent posts here using Google and none of them made it, argh. Poof. There's nothing that fires more up more than lost work, so I'll have to revert short and simple answers for the time being. Argh, damn. On Oct 25, 1:26 am, greg <[EMA

String manipulation using RE

2008-10-26 Thread aditya shukla
Hello folks, i have a string eg "(((A:1,B:1):3,C:3):4,((E:1,F:1):2,D:2):4)" now i have to convert this string to "(((A:1,B:1):2,C:3):1,((E:1,F:1):1,D:2):2)" So i used the logic eg. taking the substring "1):3" and converting it to "1):2"(3-1=2) so on for all the similar substrings.But i am not a

Re: capturing ESC, page up/down in Python

2008-10-26 Thread Tim Roberts
jordilin <[EMAIL PROTECTED]> wrote: > >Is there any way to capture the keyboard events ESC, page up (next >page), page down (previous page) in Python?. I mean, how can I capture >if user presses one of those keys in a terminal based application? I >was thinking about pygame.key.get_pressed from the

Best Unit Testing framework for Linux system administration scripting?

2008-10-26 Thread Bryan Berry
I manage a team of 5 linux sysadmins and I am trying to transition us from lengthy, mostly unreadable shell scripts to python scripting. After a few tutorials, I have been infected with the unit testing bug. Our scripts create custom versions of Fedora Core, build and deploy web software, and tes

IDLE stopped working

2008-10-26 Thread brianrpsgt1
OSX 10.5.5 Python 2.5.1 I started up IDLE today and the bottom of the window was off of the screen. I could not find a way to resize it. I closed all apps and rebooted. After rebooting, IDLE will not start. Below is the Traceback: Traceback (most recent call last): File "/Library/Frameworks

Re: Improving interpreter startup speed

2008-10-26 Thread James Mills
On Sun, Oct 26, 2008 at 11:19 PM, Pedro Borges <[EMAIL PROTECTED]> wrote: > The scripts i need to run but be executed with no apparent delay specially > when the text transforms are simple. That makes no sense whatsoever! If you are performing data conversion with Python, interpreter startup time

Re: Urllib vs. FireFox

2008-10-26 Thread Tim Roberts
Lie Ryan <[EMAIL PROTECTED]> wrote: > >Cookies? Yes, please. I'll take two. Chocolate chip. With milk. -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

IDLE stopped working

2008-10-26 Thread brianrpsgt1
Using OS X 10.5.5 Python 2.5.1 IDLE was working, then all of a sudden, the window size went off of the screen could not resize it. I closed IDLE and rebooted and now IDLE will not start. Below is the Traceback Traceback (most recent call last): File "/Library/Frameworks/Python.framework/V

Re: Porting VB apps to Python for Window / Linux use

2008-10-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Stef Mientki wrote: > ... although I realize closed source is not completely possibly in Python, > but that's no problem if the program is large/complex enough compared to > it's market value ;-) Software has no market value. Business models that try to assign it o

Re: Type feedback tool?

2008-10-26 Thread Scott David Daniels
Martin Vilcans wrote: Hi list, I'm wondering if there's a tool that can analyze a Python program while it runs, and generate a database with the types of arguments and return values for each function. In a way it is like a profiler, that instead of measuring how often functions are called and ho

Re: Interface to Matlab

2008-10-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Daniel wrote: > On Oct 17, 2:26 pm, Lawrence D'Oliveiro <[EMAIL PROTECTED] > central.gen.new_zealand> wrote: >> >> In message >> <[EMAIL PROTECTED]>, >> Daniel wrote: >> >>> Also, I think that Matlab's perferred language is Java. >> >> It has its own built-in langua

Re: Triple-quoted strings hath not the Python-nature

2008-10-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Robert Lehmann wrote: > I would feel greatly offended if I had to indent all *raw* data. You mean raw strings? -- http://mail.python.org/mailman/listinfo/python-list

Re: Triple-quoted strings hath not the Python-nature

2008-10-26 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Steven D'Aprano wrote: > I disagree. Triple-quoted strings are exactly the same as other strings: > they capture *exactly* what you put in them ... But that conflicts with the use of whitespace for indentation rules. Other languages are freeform, and have strings t

Re: Immutable object thread-safety

2008-10-26 Thread Laszlo Nagy
This will rebind both a and b. In order to be correct, it MUST happen in two phases: first calculate the right side, then do the rebind to the names on the left side. "rebind to the names" -> "rebind the names found on the left side, to the objects calculated from the expressions on the righ

Re: Web crawler on python

2008-10-26 Thread James Mills
On Mon, Oct 27, 2008 at 6:54 AM, sonich <[EMAIL PROTECTED]> wrote: > I need simple web crawler, > I found Ruya, but it's seems not currently maintained. > Does anybody know good web crawler on python or with python interface? Simple, but it works. Extend it all you like. http://hg.softcircuit.co

Re: Immutable object thread-safety

2008-10-26 Thread Laszlo Nagy
Also, the other question is the operation st = 'ThreadBWasHere' is atomic? I think this is the same question. And I believe it is not atomic, because it is actually rebinding a name. Consider this: a,b = b,a This will rebind both a and b. In order to be correct, it MUST happen in two phase

Re: Improving interpreter startup speed

2008-10-26 Thread Terry Reedy
Benjamin Kaplan wrote: I disagree. The extra time Python takes to start makes it unsuitable for many uses. For example, if you write a simple text editor then Pythons longer startup time might be to much. You must be in a real big hurry if half a second matters that much to you. M

capturing ESC, page up/down in Python

2008-10-26 Thread jordilin
Is there any way to capture the keyboard events ESC, page up (next page), page down (previous page) in Python?. I mean, how can I capture if user presses one of those keys in a terminal based application? I was thinking about pygame.key.get_pressed from the pygame module, but I don't feel really ha

Re: Question about scope

2008-10-26 Thread Bruno Desthuilliers
Lawrence D'Oliveiro a écrit : In message <[EMAIL PROTECTED]>, Steven D'Aprano wrote: Why is it a class attribute instead of an instance attribute? Singleton class. Possibly, yes (and I believe it is the case, but...). Or the OP doesnt have a good enough understanding of Python's object mod

Re: Module python-magic on/for Windows - UPDATE: WORKING & HowTo!!!

2008-10-26 Thread Carl K
Larry Hale wrote: > Thank you, again, Michael, for all your help many months ago. > > I *FINALLY* got a HowTo done up; please see > http://wiki.python.org/moin/HowTo/FileMagic > > I've also emailed Mr. Hupp to see if he'll re-post the SWIG version; > he's working on a newer binding (forget... ct

Re: Web crawler on python

2008-10-26 Thread Mr . SpOOn
On Sun, Oct 26, 2008 at 9:54 PM, sonich <[EMAIL PROTECTED]> wrote: > I need simple web crawler, > I found Ruya, but it's seems not currently maintained. > Does anybody know good web crawler on python or with python interface? What about BeautifulSoup? http://www.crummy.com/software/BeautifulSoup/

Immutable object thread-safety

2008-10-26 Thread k3xji
Hi all, This will probably be a long question/short answer, sorry, but I have wandered net about the subject and really feel cannot find just enough information.I want to ask my question by giving an example to explicitly express my understanding which may be also wrong: So, let's have a string i

Web crawler on python

2008-10-26 Thread sonich
I need simple web crawler, I found Ruya, but it's seems not currently maintained. Does anybody know good web crawler on python or with python interface? -- http://mail.python.org/mailman/listinfo/python-list

Module python-magic on/for Windows - UPDATE: WORKING & HowTo!!!

2008-10-26 Thread Larry Hale
Thank you, again, Michael, for all your help many months ago. I *FINALLY* got a HowTo done up; please see http://wiki.python.org/moin/HowTo/FileMagic I've also emailed Mr. Hupp to see if he'll re-post the SWIG version; he's working on a newer binding (forget... ctypes??) and once that one's work

Module python-magic on/for Windows - UPDATE: WORKING & HowTo!!!

2008-10-26 Thread Larry Hale
Thank you, again, Michael, for all your help many months ago. I *FINALLY* got a HowTo done up; please see http://wiki.python.org/moin/HowTo/FileMagic I've also emailed Mr. Hupp to see if he'll re-post the SWIG version; he's working on a newer binding (forget... ctypes??) and once that one's work

Immutable object thread-safety

2008-10-26 Thread k3xji
Hi all, This will probably be a long question/short answer, sorry, but I have wandered net about the subject and really feel cannot find just enough information.I want to ask my question by giving an example to explicitly express my understanding which may be also wrong: So, let's have a string i

Tix/TCL Problem (I Think)

2008-10-26 Thread Steve Phillips
Hi All, Wondering if you can tell me what I am missing. I am trying to move some projects over to the Linux side and Tix is giving me a fit. Here's what I get when I try to do something in Ubuntu relating to Tix. (Python 2.5) >>> import Tix >>> tk = Tix.Tk() Traceback (most recent call last):

Re: Improving interpreter startup speed

2008-10-26 Thread Benjamin Kaplan
On Sun, Oct 26, 2008 at 1:45 PM, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > 2008/10/26 James Mills <[EMAIL PROTECTED]>: > > On Sun, Oct 26, 2008 at 11:23 AM, BJörn Lindqvist <[EMAIL PROTECTED]> > wrote: > >> How are you getting those numbers? 330 μs is still pretty fast, isn't > >> it? :) Most d

Iowa Python User's Group Meeting Next Week!

2008-10-26 Thread Mike Driscoll
Hi, The next Iowa Python Users Group (AKA Pyowa) is nearly upon us. We will be meeting November 3rd, from 7-9 p.m. at the following location: Marshall County Sheriff's Office 2369 Jessup Ave Marshalltown, IA 50158 At this meeting, we will be having a Crash Course of sorts for all the new program

Re: Improving interpreter startup speed

2008-10-26 Thread BJörn Lindqvist
2008/10/26 James Mills <[EMAIL PROTECTED]>: > On Sun, Oct 26, 2008 at 11:23 AM, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: >> How are you getting those numbers? 330 μs is still pretty fast, isn't >> it? :) Most disks have a seek time of 10-20 ms so it seem implausible >> to me that Ruby would be ab

Re: XML-RPC

2008-10-26 Thread Stefan Behnel
asit wrote: > what is XML-RPC System Doesn't Wikipedia tell you that? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Exact match with regular expression

2008-10-26 Thread Lie Ryan
On Sun, 26 Oct 2008 17:51:29 +0100, Mr.SpOOn wrote: > Hi, > I'd like to use regular expressions to parse a string and accept only > valid strings. What I mean is the possibility to check if the whole > string matches the regex. > > So if I have: > p = re.compile('a*b*') > > I can match thi

Re: Exact match with regular expression

2008-10-26 Thread Rob Williscroft
Mr.SpOOn wrote in news:mailman.3069.1225039892.3487.python- [EMAIL PROTECTED] in comp.lang.python: > Hi, > I'd like to use regular expressions to parse a string and accept only > valid strings. What I mean is the possibility to check if the whole > string matches the regex. > > So if I have: > >

XML-RPC

2008-10-26 Thread asit
what is XML-RPC System -- http://mail.python.org/mailman/listinfo/python-list

Exact match with regular expression

2008-10-26 Thread Mr . SpOOn
Hi, I'd like to use regular expressions to parse a string and accept only valid strings. What I mean is the possibility to check if the whole string matches the regex. So if I have: >>> p = re.compile('a*b*') I can match this: 'aabbb' >>> m = p.match('aabbb') >>> m.group() 'aabbb'

Re: Error when creating class

2008-10-26 Thread Diez B. Roggisch
flaviostz schrieb: Hi, I wrote this small program: class Simples: def minha_func (valor1, valor2): return valor1 - valor2 mf = Simples() x = mf.minha_func(2, 3) print x But when I try execute it, python interpreter gives me this error: Traceback (most recent call last):

Re: Error when creating class

2008-10-26 Thread Walter Cruz
You forgot the self in minha_func. -- []' - Walter waltercruz.com -- http://mail.python.org/mailman/listinfo/python-list

Error when creating class

2008-10-26 Thread flaviostz
Hi, I wrote this small program: class Simples: def minha_func (valor1, valor2): return valor1 - valor2 mf = Simples() x = mf.minha_func(2, 3) print x But when I try execute it, python interpreter gives me this error: >>> Traceback (most recent call last): File "/tmp/py91849

Re: SendKeys-0.3.win32-py2.1.exe

2008-10-26 Thread Thorsten Kampe
* Jesse (Sat, 25 Oct 2008 14:33:52 -0700 (PDT)) > cant seem to install this, using python 2.6, any known errors that > wont let me select the python installation to use, just opens a blank > dialog and wont let me continue..do i need to downgrade python?? Well, you could. But honestly, this is mor

Re: [Python 2.6] print_function and unicode_literals cannot be used at the same time?

2008-10-26 Thread Christian Heimes
?? wrote: Any ideas? Code 1: from __future__ import print_function, unicode_literals import sys print(type('HELLO, WORLD!'), file=sys.stderr) You have to do each future import in a separate line: >>> from __future__ import unicode_literals >>> from __future__ import print_function >>> pr

Re: Improving interpreter startup speed

2008-10-26 Thread Paul Rubin
Pedro Borges <[EMAIL PROTECTED]> writes: > The scripts i need to run but be executed with no apparent delay > specially when the text transforms are simple. Basically you should keep the interpreter running and the script in memory in that case. -- http://mail.python.org/mailman/listinfo/python-li

[Python 2.6] print_function and unicode_literals cannot be used at the same time?

2008-10-26 Thread 周济是母老鼠
Any ideas? Code 1: from __future__ import print_function, unicode_literals import sys print(type('HELLO, WORLD!'), file=sys.stderr) Result 1: Code 2: from __future__ import unicode_literals, print_function import sys print(type('HELLO, WORLD!'), file=sys.stderr) Result 2: File "tmp.py",

Proxy authentication in common libraries

2008-10-26 Thread Sahasranaman
Hi I am behind a proxy server that needs proxy authentication. There are a lot of libraries that come without proxy support. The function below, which is part of the python-twitter library does HTTP Authentication, and I can't figure out how to do this with a ProxyBasicAuthHandler object. I'm pas

Pydev 1.3.23 Released

2008-10-26 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.3.23 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions: --

Re: Improving interpreter startup speed

2008-10-26 Thread Pedro Borges
The scripts i need to run but be executed with no apparent delay specially when the text transforms are simple. On Oct 26, 2008, at 11:13 AM, James Mills wrote: On Sun, Oct 26, 2008 at 11:23 AM, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: How are you getting those numbers? 330 μs is still pr

Re: Global dictionary or class variables

2008-10-26 Thread Arnaud Delobelle
On Oct 24, 8:44 pm, Mr.SpOOn <[EMAIL PROTECTED]> wrote: > Hi, > in an application I have to use some variables with fixed valuse. > > For example, I'm working with musical notes, so I have a global > dictionary like this: > > natural_notes = {'C': 0, 'D': 2, 'E': 4 } > > This actually works fin

Re: tkinter question

2008-10-26 Thread Chuckk Hubbard
Hello. How about this? I changed the if statements so the coordinates are always updated, but only changed if within the right limits, otherwise updated to the existing value. Now if you drag outside the limits of one dimension, it still moves in the other dimension. Not sure if that's what you

Type feedback tool?

2008-10-26 Thread Martin Vilcans
Hi list, I'm wondering if there's a tool that can analyze a Python program while it runs, and generate a database with the types of arguments and return values for each function. In a way it is like a profiler, that instead of measuring how often functions are called and how long time it takes, it

Re: Ordering python sets

2008-10-26 Thread Lie Ryan
On Sat, 25 Oct 2008 21:50:36 -0400, Terry Reedy wrote: > Lie Ryan wrote: >> On Sat, 25 Oct 2008 18:20:46 -0400, Terry Reedy wrote: > Then why do you object to current > mylist = linkedlist(data) > and request the harder to write and implement > mylist = list(data, implementation = 'lin

using paramiko problem? please help me

2008-10-26 Thread sa6113
I want to connect to a Windows machine in my network , using ssh, I use paramiko but I have problem in authentication, would you please help me? 1- I have installed freeSSHD in server machine? Is it necessery ? or may I have to install another program? 2- I have entered server's Ip insted of hos

Re: Ordering python sets

2008-10-26 Thread Lie Ryan
On Sun, 26 Oct 2008 00:53:18 +, Steven D'Aprano wrote: [...] > And how do you find an arbitrary object's creation point without > searching the project's source code? How is it better using the current way? Asking the .implementation field isn't much harder than asking the type (), and is much

Re: Why can't I assign a class method to a variable?

2008-10-26 Thread James Mills
On Thu, Oct 23, 2008 at 2:34 AM, ed <[EMAIL PROTECTED]> wrote: > I'm trying to make a shortcut by doing this: > > t = Globals.ThisClass.ThisMethod > > Calling t results in an unbound method error. > > Is it possible to do what I want? I call this method in hundreds of > locations and I'm trying to

Re: How can I handle the char immediately after its input, without waiting an endline?

2008-10-26 Thread Lie Ryan
On Sun, 26 Oct 2008 09:23:41 +, Duncan Booth wrote: > Lie Ryan <[EMAIL PROTECTED]> wrote: > >> And as far as I know, it is impossible to implement a "press any key" >> feature with python in a simple way (as it should be). > > "press any key" is a misfeature at the best of times. Quite apart

Re: Why can't I assign a class method to a variable?

2008-10-26 Thread Lie Ryan
On Wed, 22 Oct 2008 12:34:26 -0400, ed wrote: > I'm trying to make a shortcut by doing this: > > t = Globals.ThisClass.ThisMethod > > Calling t results in an unbound method error. > > Is it possible to do what I want? I call this method in hundreds of > locations and I'm trying to cut down on

Re: Improving interpreter startup speed

2008-10-26 Thread James Mills
On Sun, Oct 26, 2008 at 11:23 AM, BJörn Lindqvist <[EMAIL PROTECTED]> wrote: > How are you getting those numbers? 330 μs is still pretty fast, isn't > it? :) Most disks have a seek time of 10-20 ms so it seem implausible > to me that Ruby would be able to cold start in 47 ms. $ time python -c "pas

Re:: 2.6, 3.0, and truly independent intepreters

2008-10-26 Thread Hendrik van Rooyen
"Andy O'Meara" Wrote: >Um... So let's say you have a opaque object ref from the OS that >represents hundreds of megs of data (e.g. memory-resident video). How >do you get that back to the parent process without serialization and >IPC? What should really happen is just use the same address spac

Re: 2.6, 3.0, and truly independent intepreters

2008-10-26 Thread Martin v. Löwis
>>> As far as I can tell, it seems >>> CPython's current state can't CPU bound parallelization in the same >>> address space. >> That's not true. >> > > Um... So let's say you have a opaque object ref from the OS that > represents hundreds of megs of data (e.g. memory-resident video). How > do y

Re: How can I handle the char immediately after its input, without waiting an endline?

2008-10-26 Thread Duncan Booth
Lie Ryan <[EMAIL PROTECTED]> wrote: > And as far as I know, it is impossible to implement a "press any key" > feature with python in a simple way (as it should be). "press any key" is a misfeature at the best of times. Quite apart from the people who can't find the key with 'any' written on it

Re: @property decorator doesn't raise exceptions

2008-10-26 Thread Duncan Booth
Rafe <[EMAIL PROTECTED]> wrote: > Peter Oten pointed me in the right direction. I tried to reply to his > post 2 times and in spite of GoogleGroups reporting the post was > successful, it never showed up. This is the third variant on your message that has shown up in the newsgroup. Please be aw

Re: dictionary

2008-10-26 Thread Bob Martin
in 86949 20081024 205720 "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: >Steven D'Aprano wrote: > >>On Fri, 24 Oct 2008 14:53:19 +, Peter Pearson wrote: >> >>> On 24 Oct 2008 13:17:45 GMT, Steven D'Aprano wrote: What are programmers coming to these days? When I was their age, we >>>

Re: Ordering python sets

2008-10-26 Thread Marc 'BlackJack' Rintsch
On Sat, 25 Oct 2008 21:53:10 +, Lie Ryan wrote: > Oh no, the two dict implementation would work _exactly_ the same from > the outside, they are transparently interchangeable. Only the > performance characteristic differs because of the different > implementation. They are not 100% interchange