Re: Choosing a Metaclass?

2008-02-21 Thread Steve Holden
Jeff McNeil wrote: Hi list, Hopefully a quick metaclass question. In the following example, MyMeta is a metaclass that does not inherit directly from type: #!/usr/bin/python class MyMeta(object): def __new__(cls, name, bases, vars): print MyMeta.__new__ called for %s %

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread Paul Boddie
On 21 Feb, 19:22, Nicola Musatti [EMAIL PROTECTED] wrote: On Feb 21, 6:31 pm, Paul Boddie [EMAIL PROTECTED] wrote: [...] The main reason why C++ has declined in usage is because almost everything of practical value is optional. The main reason why C++ has declined in usage is because it

Re: Help on help()

2008-02-21 Thread Martin v. Löwis
If I do: import my_module help(my_module) I'd like to see ONLY help on my_module, NOT help on all the functions inherited from the various parent classes . . . I would do print my_module.__doc__ HTH, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: how can i profile every line of code

2008-02-21 Thread Tim Lesher
On Feb 21, 10:06 am, scsoce [EMAIL PROTECTED] wrote: I want to profile a function which has some lines of statement. It seem that profile module only report function's stats instead of every line of code, how can i profile every line of code? thanks. Use the hotshot profiler, and when

how to flush child_stdin

2008-02-21 Thread [EMAIL PROTECTED]
I'm opening up a subprocess like this where slave.py is a text based app that receives commands and responds with output: r, w, e = popen2.popen3('python slave.py') I need to send slave.py a command and see the output, so I'll do something like: w.write(command here) then i'll try this:

Re: can't set attributes of built-in/extension type

2008-02-21 Thread Steve Holden
Neal Becker wrote: 7stud wrote: On Feb 21, 11:19 am, Neal Becker [EMAIL PROTECTED] wrote: I'm working on a simple extension. Following the classic 'noddy' example. In [15]: cmplx_int32 Out[15]: type 'numpy.cmplx_int32' Now I want to add an attribute to this type. More precisely, I

Re: how can i profile every line of code

2008-02-21 Thread Tim Lesher
On Feb 21, 3:27 pm, Tim Lesher [EMAIL PROTECTED] wrote: On Feb 21, 10:06 am, scsoce [EMAIL PROTECTED] wrote: I want to profile a function which has some lines of statement. It seem that profile module only report function's stats instead of every line of code, how can i profile every line

Inserting NULL values with pymssql

2008-02-21 Thread Jayson Barley
I am attempting to insert NULL values into a database. I have tried to do this in multiple ways without any success, see below, and haven't been able to find anything through Google to help out. I am hoping that I am just overlooking something or that it is a rookie mistake. Below is a test I came

Re: Adding Priority Scheduling feature to the subprocess

2008-02-21 Thread TimeHorse
On Feb 21, 1:17 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote:         Why imagine... AmigaOS ran -128..+127 (though in practice, one never went above +20 as the most time critical system processes ran at that level; User programs ran at 0, the Workbench [desktop] ran at +1... I think file

Re: packing things back to regular expression

2008-02-21 Thread Paul McGuire
On Feb 20, 6:29 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Wed, 20 Feb 2008 11:36:20 -0800, Amit Gupta wrote: Before I read the message: I screwed up. Let me write again x = re.compile(CL(?Pname1[a-z]+)) # group name name1 is attached to the match of lowercase

Re: Linux/Python Issues

2008-02-21 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: As a solution to the problem of wanting a program on my computer, it sucks. On Windows I'll DL an install package, accept a license agreement, click Next a few times (no, I can't make a cup of coffee because the minute I step away the Wizard will ask a question), ...

Return value of an assignment statement?

2008-02-21 Thread mrstephengross
Hi all. In C, an assignment statement returns the value assigned. For instance: int x int y = (x = 3) In the above example, (x=3) returns 3, which is assigned to y. In python, as far as I can tell, assignment statements don't return anything: y = (x = 3) The above example generates a

RE: Inserting NULL values with pymssql

2008-02-21 Thread Jayson Barley
I also forgot to mention that this... import pymssql TestDB = pymssql.connect(host='Test',user='test',password='test',database='test') cursor = TestDB.cursor() query = INSERT INTO test.dbo.test (test) VALUES ('%s'); cursor.execute(query,(None)) works. While import pymssql TestDB =

Re: Return value of an assignment statement?

2008-02-21 Thread John Henry
On Feb 21, 1:43 pm, mrstephengross [EMAIL PROTECTED] wrote: Hi all. In C, an assignment statement returns the value assigned. For instance: int x int y = (x = 3) In the above example, (x=3) returns 3, which is assigned to y. In python, as far as I can tell, assignment statements don't

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
mrstephengross wrote: Hi all. In C, an assignment statement returns the value assigned. For instance: int x int y = (x = 3) In the above example, (x=3) returns 3, which is assigned to y. In python, as far as I can tell, assignment statements don't return anything: y = (x = 3)

Re: Return value of an assignment statement?

2008-02-21 Thread 7stud
On Feb 21, 2:43 pm, mrstephengross [EMAIL PROTECTED] wrote: Hi all. In C, an assignment statement returns the value assigned. For instance:   int x   int y = (x = 3) In the above example, (x=3) returns 3, which is assigned to y. In python, as far as I can tell, assignment statements don't

Re: Return value of an assignment statement?

2008-02-21 Thread John Henry
On Feb 21, 1:48 pm, John Henry [EMAIL PROTECTED] wrote: On Feb 21, 1:43 pm, mrstephengross [EMAIL PROTECTED] wrote: Hi all. In C, an assignment statement returns the value assigned. For instance: int x int y = (x = 3) In the above example, (x=3) returns 3, which is assigned to

Re: Return value of an assignment statement?

2008-02-21 Thread mrstephengross
What you can't do (that I really miss) is have a tree of assign-and-test expressions: import re pat = re.compile('some pattern') if m = pat.match(some_string): do_something(m) Yep, this is exactly what I am (was) trying to do. Oh well Any clever ideas

Re: python-ldap for plone 3 (python 2.4.4)

2008-02-21 Thread Michael Ströder
Erol Robaina Cepero wrote: On 19/02/2008 at 07:12 p.m. Michael Ströder wrote: Erol Robaina Cepero wrote: I need download python-ldap for my plone 3.0.5 that use python 2.4.4. Do you know where I can find it? http://python-ldap.sourceforge.net/download.shtml There I found the version

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
John Henry wrote: On Feb 21, 1:48 pm, John Henry [EMAIL PROTECTED] wrote: On Feb 21, 1:43 pm, mrstephengross [EMAIL PROTECTED] wrote: Hi all. In C, an assignment statement returns the value assigned. For instance: int x int y = (x = 3) In the above example, (x=3) returns 3, which is

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread John Nagle
Paul Boddie wrote: On 21 Feb, 19:22, Nicola Musatti [EMAIL PROTECTED] wrote: On Feb 21, 6:31 pm, Paul Boddie [EMAIL PROTECTED] wrote: [...] The main reason why C++ has declined in usage is because almost everything of practical value is optional. The main reason why C++ has declined in

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
mrstephengross wrote: What you can't do (that I really miss) is have a tree of assign-and-test expressions: import re pat = re.compile('some pattern') if m = pat.match(some_string): do_something(m) Yep, this is exactly what I am (was) trying to do. Oh

Re: Return value of an assignment statement?

2008-02-21 Thread John Henry
On Feb 21, 2:06 pm, Jeff Schwab [EMAIL PROTECTED] wrote: John Henry wrote: On Feb 21, 1:48 pm, John Henry [EMAIL PROTECTED] wrote: On Feb 21, 1:43 pm, mrstephengross [EMAIL PROTECTED] wrote: Hi all. In C, an assignment statement returns the value assigned. For instance: int x int

Re: Globals or objects?

2008-02-21 Thread Steven D'Aprano
On Thu, 21 Feb 2008 16:37:56 +, tinnews wrote: Aahz [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: Aahz [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: I had a global variable holding a count. One source Google

Re: Return value of an assignment statement?

2008-02-21 Thread Martin v. Löwis
Hi all. In C, an assignment statement returns the value assigned. No. C doesn't have an assignment statement. Instead, in C, assignment is an expression (just like a binary operation or a function call); that expression evaluates to the value assigned (i.e. the result is the value, the

OT: Ideas for a first course using Python

2008-02-21 Thread ishwar . rattan
Sorry to butt in but I am shopping for some ideas. I am interested in putting together a programming course for non- programmers (outside the computer science domain) based on Pyhton. I envision the course similar to ones that used old-Basic interpreter. Any one out there has such a course

Re: Return value of an assignment statement?

2008-02-21 Thread Terry Reedy
Jeff Schwab [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | That's the same behavior I would expect in C, on the grounds that C | What I found confusing at first was | that the same variable will either directly store or merely refer to an | object, depending on the type of the

Re: exec and closures

2008-02-21 Thread alitosis
On Feb 22, 3:18 am, Peter Otten [EMAIL PROTECTED] wrote: Alejandro Dubrovsky wrote: def autoassign(_init_): import inspect import functools argnames, _, _, defaults = inspect.getargspec(_init_) argnames = argnames[1:] indentation = ''

Re: Tkinter OSX and lift

2008-02-21 Thread Miki
Hello Kevin, Lift (which calls the Tk command raise) doesn't work this way, at least not under Aqua. If your application has focus, lift will raise the widget being called to the top of the stacking order. However, it will not make the application frontmost. To do this you'd have to use

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread Carl Banks
On Feb 21, 1:22 pm, Nicola Musatti [EMAIL PROTECTED] wrote: There are other downsides to garbage collection, as the fact that it makes it harder to implement the Resource Acquisition Is Initialization idiom, due to the lack of deterministic destruction. That's not a downside: it's at least a

Re: Return value of an assignment statement?

2008-02-21 Thread [EMAIL PROTECTED]
On 21 fév, 23:19, John Henry [EMAIL PROTECTED] wrote: On Feb 21, 2:06 pm, Jeff Schwab [EMAIL PROTECTED] wrote: John Henry wrote: On Feb 21, 1:48 pm, John Henry [EMAIL PROTECTED] wrote: On Feb 21, 1:43 pm, mrstephengross [EMAIL PROTECTED] wrote: Hi all. In C, an assignment statement

Web Development Project

2008-02-21 Thread john_sm3853
Hey guys, I am interested in knowing, what new Web Development projects you are doing, curious to know, what data base you use, and if you are using Linux or Windows platform. Also, will like to know, if there are any alternatives to Adobe products, that you may be using -- View this message in

Re: Return value of an assignment statement?

2008-02-21 Thread [EMAIL PROTECTED]
What you can't do (that I really miss) is have a tree of assign-and-test expressions: import re pat = re.compile('some pattern') if m = pat.match(some_string): do_something(m) else if m = pat.match(other_string): do_other_thing(m)

Re: Inserting NULL values with pymssql

2008-02-21 Thread Steve Holden
Jayson Barley wrote: I am attempting to insert NULL values into a database. I have tried to do this in multiple ways without any success, see below, and haven't been able to find anything through Google to help out. I am hoping that I am just overlooking something or that it is a rookie

Re: Linux/Python Issues

2008-02-21 Thread [EMAIL PROTECTED]
On 21 fév, 13:57, Paul Boddie [EMAIL PROTECTED] wrote: On 21 Feb, 13:04, [EMAIL PROTECTED] wrote: OT digression=gentoo advocacy re DLing source As a solution to the problem of wanting a program on my computer, it sucks. It doesn't suck if you're just installing one program, but if there

Re: Return value of an assignment statement?

2008-02-21 Thread [EMAIL PROTECTED]
On 21 fév, 23:06, Jeff Schwab [EMAIL PROTECTED] wrote: John Henry wrote: On Feb 21, 1:48 pm, John Henry [EMAIL PROTECTED] wrote: On Feb 21, 1:43 pm, mrstephengross [EMAIL PROTECTED] wrote: Hi all. In C, an assignment statement returns the value assigned. For instance: int x int y

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: On 21 fév, 23:19, John Henry [EMAIL PROTECTED] wrote: On Feb 21, 2:06 pm, Jeff Schwab [EMAIL PROTECTED] wrote: John Henry wrote: On Feb 21, 1:48 pm, John Henry [EMAIL PROTECTED] wrote: On Feb 21, 1:43 pm, mrstephengross [EMAIL PROTECTED] wrote: Hi all. In C, an

Re: Web Development Project

2008-02-21 Thread Preston Landers
john_sm3853([EMAIL PROTECTED])@2008.02.21 15:34:44 -0800: Hey guys, I am interested in knowing, what new Web Development projects you are doing, curious to know, what data base you use, and if you are using Linux or Windows platform. IMHO the best platform right now is: Apache 2 on Linux

Re: Return value of an assignment statement?

2008-02-21 Thread Steve Holden
Jeff Schwab wrote: [EMAIL PROTECTED] wrote: [...] Now there's no reason to feel nervous about this. All you have to remember is that Python never copy anything unless explicitely asked for. It's not that simple. After a statement like: a = b Whether a and b denote the same

Re: Return value of an assignment statement?

2008-02-21 Thread Steve Holden
mrstephengross wrote: What you can't do (that I really miss) is have a tree of assign-and-test expressions: import re pat = re.compile('some pattern') if m = pat.match(some_string): do_something(m) Yep, this is exactly what I am (was) trying to do. Oh

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread Jeff Schwab
Carl Banks wrote: On Feb 21, 1:22 pm, Nicola Musatti [EMAIL PROTECTED] wrote: There are other downsides to garbage collection, as the fact that it makes it harder to implement the Resource Acquisition Is Initialization idiom, due to the lack of deterministic destruction. That's not a

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
Terry Reedy wrote: Jeff Schwab [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | That's the same behavior I would expect in C, on the grounds that C | What I found confusing at first was | that the same variable will either directly store or merely refer to an | object,

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
[EMAIL PROTECTED] wrote: On 21 fév, 23:06, Jeff Schwab [EMAIL PROTECTED] wrote: John Henry wrote: On Feb 21, 1:48 pm, John Henry [EMAIL PROTECTED] wrote: On Feb 21, 1:43 pm, mrstephengross [EMAIL PROTECTED] wrote: Hi all. In C, an assignment statement returns the value assigned. For

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
Steve Holden wrote: Jeff Schwab wrote: [EMAIL PROTECTED] wrote: [...] Now there's no reason to feel nervous about this. All you have to remember is that Python never copy anything unless explicitely asked for. It's not that simple. After a statement like: a = b Whether a and b

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
Steve Holden wrote: mrstephengross wrote: What you can't do (that I really miss) is have a tree of assign-and-test expressions: import re pat = re.compile('some pattern') if m = pat.match(some_string): do_something(m) Yep, this is exactly what I am

Re: can't set attributes of built-in/extension type

2008-02-21 Thread Neal Becker
Steve Holden wrote: Neal Becker wrote: 7stud wrote: On Feb 21, 11:19 am, Neal Becker [EMAIL PROTECTED] wrote: I'm working on a simple extension. Following the classic 'noddy' example. In [15]: cmplx_int32 Out[15]: type 'numpy.cmplx_int32' Now I want to add an attribute to this type.

Re: ANN: Phatch = PHoto bATCH processor and renamer based on PIL

2008-02-21 Thread Mike Driscoll
On Feb 20, 4:19 am, Stani [EMAIL PROTECTED] wrote: Fred Pacquier xnews2 at fredp.lautre.net writes: Steve Holden steve at holdenweb.com said : Perhaps you could put a link to the source on the Windows instalL page? I don't mind being a second-class citizen, but it's annoying to have

Re: can't set attributes of built-in/extension type

2008-02-21 Thread Steve Holden
Neal Becker wrote: Steve Holden wrote: Neal Becker wrote: 7stud wrote: On Feb 21, 11:19 am, Neal Becker [EMAIL PROTECTED] wrote: I'm working on a simple extension. Following the classic 'noddy' example. In [15]: cmplx_int32 Out[15]: type 'numpy.cmplx_int32' Now I want to add an

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread Paul Rubin
John Nagle [EMAIL PROTECTED] writes: This has nothing to do with language efficiency or whether the language is interpreted. Of the languages listed with both hiding and safety, Ada and Modula 3 are always compiled to hard machine code, and Java can be. (GCC offers that option.) But

Re: Python on Windows Help

2008-02-21 Thread Mike Driscoll
On Feb 21, 10:09 am, [EMAIL PROTECTED] wrote: I've written the following script based on information I have found on the web. The purpose of the script is to start an HTTP listener on the machine it's running on that will give status on a particular service running on that system. I've tried

Re: can't set attributes of built-in/extension type

2008-02-21 Thread Neal Becker
Steve Holden wrote: Neal Becker wrote: Steve Holden wrote: Neal Becker wrote: 7stud wrote: On Feb 21, 11:19 am, Neal Becker [EMAIL PROTECTED] wrote: I'm working on a simple extension. Following the classic 'noddy' example. In [15]: cmplx_int32 Out[15]: type 'numpy.cmplx_int32' Now

Re: flattening a dict

2008-02-21 Thread Benjamin
On Feb 17, 6:18 am, Terry Jones [EMAIL PROTECTED] wrote: Hi Arnaud Benjamin Here's a version that's a bit more general. It handles keys whose values are empty dicts (assigning None to the value in the result), and also dict keys that are not strings (see the test data below). It's also less

Re: OT: Ideas for a first course using Python

2008-02-21 Thread André
On Feb 21, 6:48 pm, [EMAIL PROTECTED] wrote: Sorry to butt in but I am shopping for some ideas. I am interested in putting together a programming course for non- programmers (outside the computer science domain) based on Pyhton. I envision the course similar to ones that used old-Basic

Re: OT: Ideas for a first course using Python

2008-02-21 Thread Mike Driscoll
On Feb 21, 4:48 pm, [EMAIL PROTECTED] wrote: Sorry to butt in but I am shopping for some ideas. I am interested in putting together a programming course for non- programmers (outside the computer science domain) based on Pyhton. I envision the course similar to ones that used old-Basic

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread Carl Banks
On Feb 21, 7:17 pm, Jeff Schwab [EMAIL PROTECTED] wrote: Carl Banks wrote: On Feb 21, 1:22 pm, Nicola Musatti [EMAIL PROTECTED] wrote: There are other downsides to garbage collection, as the fact that it makes it harder to implement the Resource Acquisition Is Initialization idiom, due to

Re: KeyboardInterrupt should not kill subprocess

2008-02-21 Thread Donn Cave
In article [EMAIL PROTECTED], Michael Goerz [EMAIL PROTECTED] wrote: But as it seems, a keyboard interrupt will automatically pass down to the subprocesses, causing them to abort. Is there a way that I can prevent the subprocesses from being canceled by a keyboard interrupt? You might

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread Carl Banks
On Feb 21, 11:17 am, Reedick, Andrew [EMAIL PROTECTED] wrote: So I wouldn't be quick to dismiss the notion that Java/C#/C++ are more newbie-safe than Python. =/ FWIW, when I posted my comment about C++, I was mocking the article writer's notion that it was static typing and compile-time

Re: Return value of an assignment statement?

2008-02-21 Thread George Sakkis
On Feb 21, 7:21 pm, Jeff Schwab [EMAIL PROTECTED] wrote: Steve Holden wrote: Jeff Schwab wrote: [EMAIL PROTECTED] wrote: [...] Now there's no reason to feel nervous about this. All you have to remember is that Python never copy anything unless explicitely asked for. It's not that

Is there a open souce IDE writen by C( C++) or partly writen by C( C++)?

2008-02-21 Thread zaley
Is there a open souce IDE writen by C( C++) or partly writen by C( C+ +)? -- http://mail.python.org/mailman/listinfo/python-list

Re: flattening a dict

2008-02-21 Thread George Sakkis
On Feb 21, 8:04 pm, Benjamin [EMAIL PROTECTED] wrote: On Feb 17, 6:18 am, Terry Jones [EMAIL PROTECTED] wrote: Hi Arnaud Benjamin Here's a version that's a bit more general. It handles keys whose values are empty dicts (assigning None to the value in the result), and also dict keys

Re: Handling locked db tables...

2008-02-21 Thread John Nagle
breal wrote: Thanks for the reply. I understand that this is normal locking behavior. What I am looking for is a standard method to either loop the query until the table is unlocked, or put the query into some sort of queue. Basically my queries work like this. Request comes in PART

Interactive apps with Python

2008-02-21 Thread sunilkjin
Folks, I am trying to build an interactive test application. I would like to generate interactive commands to an existing server(ftpd) so commands like ftp 192.68.20.1 acelogin: ace password : I should be able to mimic human intervention. Is this possible in perl. I do not

Re: Return value of an assignment statement?

2008-02-21 Thread Aahz
In article [EMAIL PROTECTED], Jeff Schwab [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: There's nothing like a variable storing anything in Python. All you have are names to (references to) objects binding in a namespace. Now the fact is that some types are mutable and other are not. In

Re: flattening a dict

2008-02-21 Thread Benjamin
On Feb 21, 9:13 pm, George Sakkis [EMAIL PROTECTED] wrote: On Feb 21, 8:04 pm, Benjamin [EMAIL PROTECTED] wrote: On Feb 17, 6:18 am, Terry Jones [EMAIL PROTECTED] wrote: Hi Arnaud Benjamin Here's a version that's a bit more general. It handles keys whose values are empty dicts

Re: Interactive apps with Python

2008-02-21 Thread Michael Torrie
[EMAIL PROTECTED] wrote: Folks, I am trying to build an interactive test application. I would like to generate interactive commands to an existing server(ftpd) so commands like ftp 192.68.20.1 acelogin: ace password : I should be able to mimic human intervention. Is

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread Paul Rubin
Carl Banks [EMAIL PROTECTED] writes: FWIW, when I posted my comment about C++, I was mocking the article writer's notion that it was static typing and compile-time checking that made Java and C# safer for newbies, by presenting an example that clearly defied that. I was taking it for granted

Professional Grant Proposal Writing Workshop (April 2008: Vancouver, British Columbia)

2008-02-21 Thread Anthony Jones
The Grant Institute's Grants 101: Professional Grant Proposal Writing Workshop will be held in Vancouver, British Columbia, April 14 - 16, 2008. Interested development professionals, researchers, faculty, and graduate students should register as soon as possible, as demand means that seats will

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread Jeff Schwab
Carl Banks wrote: On Feb 21, 7:17 pm, Jeff Schwab [EMAIL PROTECTED] wrote: Carl Banks wrote: On Feb 21, 1:22 pm, Nicola Musatti [EMAIL PROTECTED] wrote: There are other downsides to garbage collection, as the fact that it makes it harder to implement the Resource Acquisition Is

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
George Sakkis wrote: On Feb 21, 7:21 pm, Jeff Schwab [EMAIL PROTECTED] wrote: Steve Holden wrote: Jeff Schwab wrote: [EMAIL PROTECTED] wrote: [...] Now there's no reason to feel nervous about this. All you have to remember is that Python never copy anything unless explicitely asked for.

Re: Return value of an assignment statement?

2008-02-21 Thread Jeff Schwab
Aahz wrote: In article [EMAIL PROTECTED], Jeff Schwab [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] wrote: There's nothing like a variable storing anything in Python. All you have are names to (references to) objects binding in a namespace. Now the fact is that some types are mutable and other

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread George Sakkis
Paul Rubin wrote: It just seems to me that there is a killer language just around the corner, with Python's ease-of-use but with a serious compile-time type system, maybe some kind of cross between ML and Python. Could Boo or Cobra fit the bill ? If not, what's missing at a technical level

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread Paul Rubin
Jeff Schwab [EMAIL PROTECTED] writes: The most traditional, easiest way to open a file in C++ is to use an fstream object, so the file is guaranteed to be closed when the fstream goes out of scope. Python has this too, except it's using a special type of scope created by the with statement.

Re: Return value of an assignment statement?

2008-02-21 Thread Paul Rubin
Jeff Schwab [EMAIL PROTECTED] writes: So what is the variable? Or is Python the first HLL I've ever heard of that didn't have variables? I don't know what other HLL's you use, but some languages don't even have mutable values. -- http://mail.python.org/mailman/listinfo/python-list

Re: Return value of an assignment statement?

2008-02-21 Thread Torsten Bronger
Hallöchen! Jeff Schwab writes: Aahz wrote: [...] Notice very very carefully that Bruno is not using variable. Many expert Python programmers strongly prefer to talk about names instead of variables (especially when explaining the Python object model) precisely because using variable

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread Paul Rubin
George Sakkis [EMAIL PROTECTED] writes: Could Boo or Cobra fit the bill ? If not, what's missing at a technical level (i.e. ignoring current maturity, community size, marketing, etc.) ? I just spent a minute looking at these and both are interesting, though Cobra looks .NET specific and I'd

Re: Return value of an assignment statement?

2008-02-21 Thread George Sakkis
On Feb 22, 12:26 am, Jeff Schwab [EMAIL PROTECTED] wrote: On the other hand, a = b does always the same thing; unlike C++, '=' is not an operator and therefore it cannot be overriden by the class of 'a'. Not an operator? Then what is it? In this context, it's just the token used for the

reg - timer........

2008-02-21 Thread Manikandan R
Hai.. I have planned to access the web page via python coding, for that I use url = 'http:\\username:[EMAIL PROTECTED]' urllib.urlopen(url) It opens fine when its correct web page else it hangs there So I have planned to start a timer when i launch the web

Re: Is there a open souce IDE writen by C( C++) or partly writen by C( C++)?

2008-02-21 Thread Stefan Behnel
zaley wrote: Is there a open souce IDE writen by C( C++) or partly writen by C( C+ +)? Tons of them. What do you want to do with it? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Article of interest: Python pros/cons for the enterprise

2008-02-21 Thread Carl Banks
On Feb 22, 12:23 am, Jeff Schwab [EMAIL PROTECTED] wrote: Carl Banks wrote: On Feb 21, 7:17 pm, Jeff Schwab [EMAIL PROTECTED] wrote: Carl Banks wrote: On Feb 21, 1:22 pm, Nicola Musatti [EMAIL PROTECTED] wrote: There are other downsides to garbage collection, as the fact that it makes

Re: Return value of an assignment statement?

2008-02-21 Thread Ben Finney
Jeff Schwab [EMAIL PROTECTED] writes: Aahz wrote: Notice very very carefully that Bruno is not using variable. Many expert Python programmers strongly prefer to talk about names instead of variables (especially when explaining the Python object model) precisely because using variable

n00b with urllib2: How to make it handle cookie automatically?

2008-02-21 Thread est
Hi all, I need urllib2 do perform series of HTTP requests with cookie from PREVIOUS request(like our browsers usually do ). Many people suggest I use some library(e.g. pycURL) instead but I guess it's good practise for a python beginner to DIY something rather than use existing tools. So my

Re: Is there a open souce IDE writen by C( C++) or partly writen by C( C++)?

2008-02-21 Thread zaley
My project need a simple scripts debugger . I hope I can find something instructive Stefan Behnel 写道: zaley wrote: Is there a open souce IDE writen by C( C++) or partly writen by C( C+ +)? Tons of them. What do you want to do with it? Stefan --

Re: distutils and data files

2008-02-21 Thread Sam Peterson
Robert Bossy [EMAIL PROTECTED] on Wed, 20 Feb 2008 09:29:12 +0100 didst step forth and proclaim thus: Sam Peterson wrote: I've been googling for a while now and cannot find a good way to deal with this. I have a slightly messy python program I wrote that I've historically just run from the

Re: Is there a open souce IDE writen by C( C++) or partly writen by C( C++)?

2008-02-21 Thread zaley
Of course, python scripts debugger On 2月22日, 下午3时22分, zaley [EMAIL PROTECTED] wrote: My project need a simple scripts debugger . I hope I can find something instructive Stefan Behnel 写道: zaley wrote: Is there a open souce IDE writen by C( C++) or partly writen by C( C+ +)? Tons of

[issue2149] Queue.maxsize, __init__() accepts any value as maxsize

2008-02-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: What about requiring maxsize to be convertible to an int? This would allow dynamic objects, if they define an __int__ method. I join a patch. -- nosy: +amaury.forgeotdarc Added file: http://bugs.python.org/file9473/queue_maxsize_2.diff

[issue2127] sqlite3 docs should mention utf8 requirement

2008-02-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: IMO, connect() should accept unicode strings, and encode them to utf-8 when calling the C function. Patch attached. -- nosy: +amaury.forgeotdarc Added file: http://bugs.python.org/file9474/sqlite_connect.diff __

[issue2150] Broken Link to New Style Classes Documentation

2008-02-21 Thread Neil Roques
New submission from Neil Roques: http://docs.python.org/ref/node33.html (also packaged in the Python documentation which comes with Python) links to: http://www.python.org/doc/newstyle.html for information on new style classes However, this link has moved, as should now read:

[issue2151] no way to get http result status from urllib

2008-02-21 Thread paul rubin
New submission from paul rubin: I don't see any way in the docs to get the status of an http request, in particular I want to know whether it's a 404. It does show up in the guts of the library so maybe I can extract it somehow, but there should be a simple documented way. Also, the urllib doc

[issue2129] Link error of gethostbyaddr and gethostname in Python Manuals (the chm file)

2008-02-21 Thread Martin v. Löwis
Martin v. Löwis added the comment: That's difficult to fix. Notice that this page does reference gethostbyaddr (in the uname documentation), and that the online HTML version links to both the socket and the os modules. Apparently, the CHM generation picks up the first link. -- nosy:

[issue2152] make sqlite.Row hashable correctly

2008-02-21 Thread Thomas Heller
New submission from Thomas Heller: The attached patch implements hash and cmp for sqlite3.Row objects. -- files: sqliterow.patch keywords: patch messages: 62615 nosy: theller severity: normal status: open title: make sqlite.Row hashable correctly type: behavior versions: Python 2.6,

[issue1533] Bug in range() function for large values

2008-02-21 Thread Rafael Zanella
Rafael Zanella added the comment: FWIW, using xrange() it seems to give the proper error message: Traceback (most recent call last): File bad_range.py, line 12, in module print xrange(MyInt(2**64), MyInt(2**64+10)) OverflowError: long int too large to convert to int -- nosy:

[issue1621] Do not assume signed integer overflow behavior

2008-02-21 Thread Ismail Donmez
Ismail Donmez added the comment: Any news on this? Also gcc 4.3 gcc 4.2.3 fixed the -Wall clobbering - Wstrict-overflow problem, which is good news. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1621 __

[issue2079] UserDict documentation typo

2008-02-21 Thread Jeroen Ruigrok van der Werven
Jeroen Ruigrok van der Werven added the comment: Patch for against 2.6 trunk @ r60910. -- nosy: +asmodai Added file: http://bugs.python.org/file9476/userdict.rst.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2079

[issue2079] UserDict documentation typo

2008-02-21 Thread Jeroen Ruigrok van der Werven
Jeroen Ruigrok van der Werven added the comment: Patch against 2.5 trunk @ r60911. Added file: http://bugs.python.org/file9477/libuserdict.tex.diff __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2079 __

[issue2149] Queue.maxsize, __init__() accepts any value as maxsize

2008-02-21 Thread Rafael Zanella
Rafael Zanella added the comment: @gutworth: Since one of the main uses of Queue is with threads, I think it *really* should acquire the mutex before changing the maxsize; @amaury.forgeotdarc: Your patch makes the point of allowing the size to be changed at some other place (e.g.: an attribute

[issue2153] unittest.py modernization

2008-02-21 Thread Virgil Dupras
New submission from Virgil Dupras: What prompted me to do these changes is that Backward compatibility section for 2.1 and earlier. How long are we going to keep this? According to svn, no commit has been made on the 2.1 branch since 2003. Is it safe to assume no unittest change is ever going

[issue2149] Queue.maxsize, __init__() accepts any value as maxsize

2008-02-21 Thread Benjamin Peterson
Benjamin Peterson added the comment: I like it. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2149 __ ___ Python-bugs-list mailing list Unsubscribe:

[issue2154] doc: better detection of python snippets for highliting

2008-02-21 Thread Amaury Forgeot d'Arc
New submission from Amaury Forgeot d'Arc: The new doc framework highlights python code, and looks very nice. However, some snippets are not parseable by the compiler, and are thus left unhighlighted. For example: http://docs.python.org/dev/whatsnew/2.6.html#the-contextlib-module The vast

[issue2149] Queue.maxsize, __init__() accepts any value as maxsize

2008-02-21 Thread Rafael Zanella
Rafael Zanella added the comment: Mine patch doesn't address the hold the mutex before changing the maxsize guess it would then force a get()? __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2149 __

[issue2155] optparse.OptionGroup with_statement context handling

2008-02-21 Thread Michael Hoffman
New submission from Michael Hoffman: Adding these four lines to optparse.OptionGroup makes using option groups vastly easier: def __enter__(self): return self def __exit__(self, *exc_info): self.parser.add_option_group(self) You can then do things like: with

<    1   2   3   >