Why am I getting [10263 refs]?

2009-03-24 Thread Russ P.
I am running 2.5.2 on Red Hat 5. I am getting many printouts of reference counts, such as [10263 refs] I do not recall ever seeing this until recently. Why am I getting this? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does python not have a mechanism for data hiding?

2008-05-25 Thread Russ P.
On May 25, 2:32 pm, Joe P. Cool [EMAIL PROTECTED] wrote: On 24 Mai, 15:58, Ben Finney [EMAIL PROTECTED] wrote: Sh4wn [EMAIL PROTECTED] writes: first, python is one of my fav languages, and i'll definitely keep developing with it. But, there's 1 one thing what I -really- miss: data

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Russ P.
On Jun 2, 6:41 am, Carl Banks [EMAIL PROTECTED] wrote: You are not realizing that only useful(**) thing about data hiding is that some code has access to the data, other code does not. If you hide data equally from everyone it's just a useless spelling change. I think you're missing the

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Russ P.
On Jun 2, 3:04 pm, Carl Banks [EMAIL PROTECTED] wrote: On Jun 2, 4:50 pm, Russ P. [EMAIL PROTECTED] wrote: On Jun 2, 6:41 am, Carl Banks [EMAIL PROTECTED] wrote: You are not realizing that only useful(**) thing about data hiding is that some code has access to the data, other code does

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Russ P.
On Jun 2, 4:17 pm, Carl Banks [EMAIL PROTECTED] wrote: On Jun 2, 6:39 pm, Russ P. [EMAIL PROTECTED] wrote: On Jun 2, 3:04 pm, Carl Banks [EMAIL PROTECTED] wrote: On Jun 2, 4:50 pm, Russ P. [EMAIL PROTECTED] wrote: On Jun 2, 6:41 am, Carl Banks [EMAIL PROTECTED] wrote: You

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Russ P.
On Jun 2, 6:21 pm, alex23 [EMAIL PROTECTED] wrote: On Jun 3, 9:41 am, Russ P. [EMAIL PROTECTED] wrote: Here's what I think Python should have. I think it should have a keyword, something like priv, to identify data or functions as private. As I stated earlier in this thread, if you want

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Russ P.
On Jun 2, 5:11 pm, Paul Rubin http://[EMAIL PROTECTED] wrote: Russ P. [EMAIL PROTECTED] writes: I also realize, by the way, that Python allows a client of a class to define a new class member from completely outside the class definition. Obviously, that cannot be declared private

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Russ P.
On Jun 2, 10:23 pm, alex23 [EMAIL PROTECTED] wrote: On Jun 3, 2:11 pm, Russ P. [EMAIL PROTECTED] wrote: Yes, that looks interesting, but I think it has a couple of drawbacks. First, it requires another completely separate class for the implementation (although perhaps that could

Re: Why does python not have a mechanism for data hiding?

2008-06-02 Thread Russ P.
On Jun 2, 10:23 pm, alex23 [EMAIL PROTECTED] wrote: Then again, I have no issue with the current convention and personally find the idea of adding a private keyword makes as much sense as being able to syntactically define model, view and controller methods. Well, the designers of C++, Java,

Re: Why does python not have a mechanism for data hiding?

2008-06-03 Thread Russ P.
On Jun 3, 11:02 am, Richard Levasseur [EMAIL PROTECTED] wrote: On Jun 3, 3:07 am, BJörn Lindqvist [EMAIL PROTECTED] wrote: On Mon, Jun 2, 2008 at 10:50 PM, Russ P. [EMAIL PROTECTED] wrote: On Jun 2, 6:41 am, Carl Banks [EMAIL PROTECTED] wrote: You are not realizing that only useful

Re: Why does python not have a mechanism for data hiding?

2008-06-03 Thread Russ P.
On Jun 3, 4:21 am, George Sakkis [EMAIL PROTECTED] wrote: On Jun 3, 1:42 am, Russ P. [EMAIL PROTECTED] wrote: On Jun 2, 10:23 pm, alex23 [EMAIL PROTECTED] wrote: Then again, I have no issue with the current convention and personally find the idea of adding a private keyword makes

Re: Picking apart strings

2008-06-03 Thread Russ P.
On Jun 3, 11:44 am, tmallen [EMAIL PROTECTED] wrote: Is there a way to pick apart this text without resorting to regular expressions? p { color: black; } p - element color - property black - value Sure. data = txt.strip(}).split({) element = data[0].strip() items =

Re: Why does python not have a mechanism for data hiding?

2008-06-03 Thread Russ P.
On Jun 3, 8:50 pm, Ben Finney [EMAIL PROTECTED] wrote: alex23 [EMAIL PROTECTED] writes: So the basic answers I'm seeing that do just fine are: 1. Don't test private functions. 2. Add functionality _to_ the private functions for testing. 3. Change the interface for the purpose of testing.

Re: Why does python not have a mechanism for data hiding?

2008-06-04 Thread Russ P.
On Jun 4, 4:29 am, NickC [EMAIL PROTECTED] wrote: On Jun 4, 4:09 am, Russ P. [EMAIL PROTECTED] wrote: What is it about leading underscores that bothers me? To me, they are like a small pebble in your shoe while you are on a hike. Yes, you can live with it, and it does no harm, but you

line continuation for lines ending in and or or

2008-06-04 Thread Russ P.
I've always appreciated Python's lack of requirement for a semi-colon at the end of each line. I also appreciate its rules for automatic line continuation. If a statement ends with a +, for example, Python recognizes that the statement obviously must continue. I've noticed, however, that the same

Re: line continuation for lines ending in and or or

2008-06-04 Thread Russ P.
On Jun 4, 9:01 pm, Dan Bishop [EMAIL PROTECTED] wrote: On Jun 4, 10:09 pm, Russ P. [EMAIL PROTECTED] wrote: I've always appreciated Python's lack of requirement for a semi-colon at the end of each line. I also appreciate its rules for automatic line continuation. If a statement ends

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 4:47 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Antoon Pardon a écrit : On 2008-06-04, NickC [EMAIL PROTECTED] wrote: On Jun 4, 4:09 am, Russ P. [EMAIL PROTECTED] wrote: What is it about leading underscores that bothers me? To me, they are like a small pebble

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 4:53 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Russ P. a écrit : Given your very recent discovery of what 'dynamic' *really* means in Python (like, for exemple, dynamically adding / replacing attributes - including methods - on a per-class or per-instance basis

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 11:25 am, George Sakkis [EMAIL PROTECTED] wrote: On Jun 5, 2:07 pm, Russ P. [EMAIL PROTECTED] wrote: The private keyword goes further and prevents access even by derived classes. The double leading underscore in Python does no such thing. Who develops these derived classes

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
For the record, I have made it abundantly clear that I don't think Python should not have as rigorous an encapsulation regime as C++ or Java. The worst that could happen with my proposition is that you would need to use a mangled name to access private data or methods. But you will be using

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 12:20 pm, Roy Smith [EMAIL PROTECTED] wrote: All somebody has to do to get at the private data is: #define private public # include MySecretClass.h #undef private Well, that shows the weakness of the C/C++ header files. The include directive merely does a simple text substitution,

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 2:27 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Thu, 5 Jun 2008 11:36:28 -0700 (PDT), Russ P. [EMAIL PROTECTED] declaimed the following in comp.lang.python: would need to use a mangled name to access private data or methods. But you will be using the name many times, you

Re: Why does python not have a mechanism for data hiding?

2008-06-05 Thread Russ P.
On Jun 5, 2:57 pm, Hrvoje Niksic [EMAIL PROTECTED] wrote: Russ P. [EMAIL PROTECTED] writes: By the way, my recollection is that in C++ access defaults to private if nothing is declared explicity. So normally the private declaration is unnecessary. If it is left out, your little trick won't

Re: Why does python not have a mechanism for data hiding?

2008-06-06 Thread Russ P.
On Jun 6, 8:25 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: I also realize, by the way, that Python allows a client of a class to define a new class member from completely outside the class definition. Obviously, that cannot be declared private. Why so ? Why should the

Re: Why does python not have a mechanism for data hiding?

2008-06-06 Thread Russ P.
On Jun 6, 8:28 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Russ P. a écrit : On Jun 5, 2:27 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Thu, 5 Jun 2008 11:36:28 -0700 (PDT), Russ P. [EMAIL PROTECTED] declaimed the following in comp.lang.python: would need to use

Re: Why does python not have a mechanism for data hiding?

2008-06-08 Thread Russ P.
On Jun 8, 5:52 am, Mark Wooding [EMAIL PROTECTED] wrote: By enforcing your `data hiding', you're effectively telling me that I'm too stupid to make rational decisions of this sort. And that's actually extremely insulting. 1) I suggest you not take it personally. 2) Local data within

Re: Why does python not have a mechanism for data hiding?

2008-06-08 Thread Russ P.
On Jun 8, 5:40 am, Mark Wooding [EMAIL PROTECTED] wrote: Russ P. [EMAIL PROTECTED] wrote: The idea of being able to discern properties of an object by its name alone is something that is not normally done in programming in general. Really? You obviously haven't noticed Prolog, Smalltalk

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Russ P.
On Jun 9, 2:23 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Mark Wooding a écrit : Fuzzyman [EMAIL PROTECTED] wrote: So, you are stating that no API programmer using Python *ever* has a valid or genuine reason for wanting (even if he can't have it) genuine 'hiding' of

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Russ P.
On Jun 9, 2:22 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Does anyone object to not having access from outside a function to local variables within the function? I doubt it. The other thing is that the vast majority of Python software, I would guess, is provided with source

Re: Why does python not have a mechanism for data hiding?

2008-06-09 Thread Russ P.
On Jun 9, 2:10 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: But if it takes 6 month to get the mentioned developer to release something I can use, I'm screwed up. Fine. I've lost track of how many times I've said this now, but my suggestion for a priv keyword allowed for indirect access to

Re: Why does python not have a mechanism for data hiding?

2008-06-10 Thread Russ P.
On Jun 10, 1:04 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: If you hope to get a general agreement here in favor of a useless keyword that don't bring anything to the language, then yes, I'm afraid you're wasting your time. Actually, what I hope to do is to take something away

Re: Why does python not have a mechanism for data hiding?

2008-06-11 Thread Russ P.
On Jun 10, 11:58 am, Jonathan Gardner Who cares what the type of an object is? Only the machine. Being able to tell, in advance, what the type of a variable is is a premature optimization. Tools like psyco prove that computers (really, programmers) nowadays are smart enough to figure things

Re: Why does python not have a mechanism for data hiding?

2008-06-11 Thread Russ P.
On Jun 11, 2:36 am, Paul Boddie [EMAIL PROTECTED] wrote: Maybe, but I'd hope that some of those programmers would be at least able to entertain what Russ has been saying rather than setting themselves up in an argumentative position where to concede any limitation in Python might be

exception message output problem

2007-12-21 Thread Russ P.
I am baffled about why my exception messages are not displaying properly. I have a class that represents physical scalars with units. If I type 3 * s + 4 * m I should get something like this: scalar.InconsistentUnits: 3 s, 4 m to show that seconds cannot be added to meters. Instead, the

Re: exception message output problem

2007-12-21 Thread Russ P.
On Dec 21, 2:58 pm, Lie [EMAIL PROTECTED] wrote: Change the exception into this: class InconsistentUnits(Exception): def __init__(self, args=): self.args = (args,) # Python have an odd (read: broken) singleton implementation # single member tuple must have a comma behind it Hey,

Re: exception message output problem

2007-12-22 Thread Russ P.
On Dec 22, 5:34 am, Fredrik Lundh [EMAIL PROTECTED] wrote: Russ P. wrote: Actually, the parens aren't needed, so this works too: def __init__(self, args=): self.args = args, The trailing comma wasn't necessary a while back (pre 2.5?), so something in Python must have changed. I'd

Re: C++ equivalent of comp.lang.python?

2008-01-03 Thread Russ P.
On Jan 3, 9:39 am, [EMAIL PROTECTED] wrote: Hopefully this isn't too OT. One thing I like about comp.lang.python is the breadth of topics discussed here. People can ask about Python installation and configuration issues on specific platforms, compare third party libraries, ask for book

Re: How a smart editor could make Postfix type declarations PEP3117 in Python3000 more readable

2008-01-04 Thread Russ P.
On Jan 4, 10:07 pm, John Nagle [EMAIL PROTECTED] wrote: aspineux wrote: Hi I read the PEP 3117 about the new Postfix type declarations in Python3000. THIS PEP as been REJECTED ! Of course. That was a joke. And I think this is a good idea to include typing in python.

Re: Language type systems (was: How a smart editor could make Postfix type declarations PEP3117 in Python3000 more readable)

2008-01-05 Thread Russ P.
Since Python is strongly-typed and dynamically-typed, this -- Hyphenating after ly is grammatically incorrect. \It is the responsibility of intellectuals to tell the truth | `\and expose lies. -- Noam Chomsky Never quote Noam Chomsky on truth. He

Re: use fileinput to read a specific line

2008-01-07 Thread Russ P.
On Jan 7, 7:15 pm, jo3c [EMAIL PROTECTED] wrote: hi everybody im a newbie in python i need to read line 4 from a header file using linecache will crash my computer due to memory loading, because i am working on 2000 files each is 8mb fileinput don't load the file into memory first how do i

Re: use fileinput to read a specific line

2008-01-07 Thread Russ P.
Given that the OP is talking 2000 files to be processed, I think I'd recommend explicit open() and close() calls to avoid having lots of I/O structures floating around... Good point. I didn't think of that. It could also be done as follows: for fileN in files: lnum = 0 # line

Re: use fileinput to read a specific line

2008-01-07 Thread Russ P.
On Jan 7, 9:41 pm, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Mon, 7 Jan 2008 20:10:58 -0800 (PST), Russ P. [EMAIL PROTECTED] declaimed the following in comp.lang.python: for file0 in files: lnum = 0 # line number for line in file(file0): lnum += 1 if lnum

Re: docstrings style question

2008-01-10 Thread Russ P.
On Jan 9, 11:51 pm, Fredrik Lundh [EMAIL PROTECTED] wrote: Steve Brown wrote: I've got a series of modules which look like this: # # # Temperature Sense Test # # class Test3(ar_test.AR_TEST): Temperature Sense Test I don't like the duplicated

Re: split parameter line with quotes

2008-01-11 Thread Russ P.
On Jan 11, 10:50 am, teddyber [EMAIL PROTECTED] wrote: Hello, first i'm a newbie to python (but i searched the Internet i swear). i'm looking for some way to split up a string into a list of pairs 'key=value'. This code should be able to handle this particular example string :

Re: split parameter line with quotes

2008-01-11 Thread Russ P.
On Jan 11, 12:53 pm, Russ P. [EMAIL PROTECTED] wrote: On Jan 11, 10:50 am, teddyber [EMAIL PROTECTED] wrote: Hello, first i'm a newbie to python (but i searched the Internet i swear). i'm looking for some way to split up a string into a list of pairs 'key=value'. This code should

Re: Linux Journal Survey

2008-01-24 Thread Russ P.
On Jan 23, 7:42 pm, George Sakkis [EMAIL PROTECTED] wrote: On Jan 23, 8:14 pm, [EMAIL PROTECTED] wrote: The annual Linux Journal survey is online now for any Linux users who want to vote for Python. http://www.linuxjournal.com/node/1006101 ... 18. What is your favorite programming

optional static typing for Python

2008-01-27 Thread Russ P.
A while back I came across a tentative proposal from way back in 2000 for optional static typing in Python: http://www.python.org/~guido/static-typing Two motivations were given: -- faster code -- better compile-time error detection I'd like to suggest a third, which could help extend

Re: optional static typing for Python

2008-01-27 Thread Russ P.
On Jan 27, 2:36 pm, Jarek Zgoda [EMAIL PROTECTED] wrote: Russ P. pisze: I noticed that Guido has expressed further interest in static typing three or four years ago on his blog. Does anyone know the current status of this project? Thanks. I thought it was april fools joke? On January 21

Re: optional static typing for Python

2008-01-27 Thread Russ P.
On Jan 27, 2:49 pm, André [EMAIL PROTECTED] wrote: On Jan 27, 6:19 pm, Russ P. [EMAIL PROTECTED] wrote: A while back I came across a tentative proposal from way back in 2000 for optional static typing in Python: http://www.python.org/~guido/static-typing Two motivations were given

Re: optional static typing for Python

2008-01-27 Thread Russ P.
On Jan 27, 3:08 pm, Jarek Zgoda [EMAIL PROTECTED] wrote: Russ P. pisze: I noticed that Guido has expressed further interest in static typing three or four years ago on his blog. Does anyone know the current status of this project? Thanks. I thought it was april fools joke? On January

Re: optional static typing for Python

2008-01-27 Thread Russ P.
On Jan 27, 5:03 pm, Paddy If static typing is optional then a program written in a dynamic language that passes such an automated static analysis of source code would have to be a simple program written in a simplistic way, and also in a static style. Yes, but for safety-critical software

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-27 Thread Russ P.
On Jan 27, 5:13 pm, Wildemar Wildenburger [EMAIL PROTECTED] wrote: Ben Finney wrote: André [EMAIL PROTECTED] writes: Personally, I like the idea you suggest, with the modification that I would use . instead of @, as in class Server(object): def __init__(self, .host, .port,

Re: Python Standardization: Wikipedia entry

2008-01-27 Thread Russ P.
On Jan 27, 5:41 pm, Roy Smith [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], ajaksu [EMAIL PROTECTED] wrote: On Jan 27, 10:32 pm, Paddy [EMAIL PROTECTED] wrote: I would value the opinion of fellow Pythoneers who have also contributed to Wikipedia, on the issue of Is Python

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-27 Thread Russ P.
On Jan 27, 7:33 pm, Ben Finney [EMAIL PROTECTED] wrote: Russ P. [EMAIL PROTECTED] writes: On Jan 27, 5:13 pm, Wildemar Wildenburger [EMAIL PROTECTED] wrote: class Server(object): def __init__(self, self.host, self.port, self.protocol, self.bufsize, self.timeout

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-28 Thread Russ P.
On Jan 27, 11:47 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Mon, 28 Jan 2008 08:04:05 +0100, Torsten Bronger wrote: Are you referring to the alternate syntax or to the decorator? Either way, you could be saving 4 or 5 or more lines, if you have enough arguments.

Re: py3k feature proposal: field auto-assignment in constructors

2008-01-28 Thread Russ P.
On Jan 28, 12:21 am, Ben Finney [EMAIL PROTECTED] wrote: Russ P. [EMAIL PROTECTED] writes: OK, then how about a special function that could be called from inside the constructor (or anywhere else for that matter) to initialize a list of data members. For example, self.__set__(host, port

Re: optional static typing for Python

2008-01-28 Thread Russ P.
On Jan 28, 1:53 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Russ P. a écrit : On Jan 27, 5:03 pm, Paddy If static typing is optional then a program written in a dynamic language that passes such an automated static analysis of source code would have to be a simple program

Re: optional static typing for Python

2008-01-28 Thread Russ P.
On Jan 28, 1:51 am, Bruno Desthuilliers bruno. [EMAIL PROTECTED] wrote: Russ P. a écrit : A while back I came across a tentative proposal from way back in 2000 for optional static typing in Python: (snip) In any case, optional static typing in Python would help tremendously here

Re: Best Python packages?

2008-07-16 Thread Russ P.
On Jul 16, 7:16 am, Ben Sizer [EMAIL PROTECTED] wrote: Although the standard library in Python is great, there are undoubtedly some great packages available from 3rd parties, and I've encountered a few almost by accident. However, I don't know how a user would become aware of many of

Re: Attack a sacred Python Cow

2008-07-26 Thread Russ P.
If, as I wrote, you permit the omission of self in method signatures defined within class definitions, then you could still insist on instance attribute qualification using self - exactly as one would when writing Java according to certain style guidelines. I'm not sure exactly what people

Re: Attack a sacred Python Cow

2008-07-26 Thread Russ P.
So why not allow something like this?: class MyClass: def func( , xxx, yyy): .xxx = xxx local = .yyy The self argument is replaced with nothing, but a comma is used as a placeholder. (+1) but why retain the leading comma in the argument list? As I said,

Re: Attack a sacred Python Cow

2008-07-26 Thread Russ P.
On Jul 26, 2:25 pm, Terry Reedy There is a lot of code you have not seen. Really. In informal code I use 's' and 'o' for 'self' and 'other'. I don't usually post such because it is not considered polite. So you have seen a biased sample of the universe. You take the name down to a single

Re: Attack a sacred Python Cow

2008-07-26 Thread Russ P.
On Jul 26, 7:23 pm, Marcus.CM 1. python should hardcode the keyword self. So whenever this keyword is used, it would automatically implied that it is referring to a class scope variable. This would be similar to how the this keyword is used in C++. 2. Omit self from the parameter. That

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
On Jul 26, 11:18 pm, Terry Reedy [EMAIL PROTECTED] wrote: Colin J. Williams wrote: Russ P. wrote: class MyClass: def func( , xxx, yyy): .xxx = xxx local = .yyy The use of nothing'.' has been suggested before and rejected. Where and why? -- http

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
On Jul 26, 11:22 pm, Terry Reedy [EMAIL PROTECTED] wrote: Russ P. wrote: On Jul 26, 2:25 pm, Terry Reedy There is a lot of code you have not seen. Really. In informal code I use 's' and 'o' for 'self' and 'other'. I don't usually post such because it is not considered polite. So you

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
On Jul 27, 3:11 am, alex23 [EMAIL PROTECTED] wrote: On Jul 27, 4:26 pm, Russ P. [EMAIL PROTECTED] wrote: On Jul 26, 11:18 pm, Terry Reedy [EMAIL PROTECTED] wrote: The use of nothing'.' has been suggested before and rejected. Where and why? Google is your friend:http://mail.python.org

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
On Jul 27, 1:19 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Sat, 26 Jul 2008 17:14:46 -0700, Russ P. wrote: You take the name down to a single letter. As I suggested in an earlier post on this thread, why not take it down to zero letters? The question isn't why

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
On Jul 27, 12:39 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Derek Martin a écrit : On Sun, Jul 27, 2008 at 08:19:17AM +, Steven D'Aprano wrote: You take the name down to a single letter. As I suggested in an earlier post on this thread, why not take it down to zero letters?

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
On Jul 27, 3:11 pm, Russ P. [EMAIL PROTECTED] wrote: On Jul 27, 12:39 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Derek Martin a écrit : On Sun, Jul 27, 2008 at 08:19:17AM +, Steven D'Aprano wrote: You take the name down to a single letter. As I suggested in an earlier

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
On Jul 27, 3:54 pm, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Sun, 27 Jul 2008 12:33:16 -0700, Russ P. wrote: On Jul 27, 1:19 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Sat, 26 Jul 2008 17:14:46 -0700, Russ P. wrote: You take the name down

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
On Jul 27, 6:21 pm, Terry Reedy [EMAIL PROTECTED] wrote: Russ P. wrote: On Jul 27, 12:39 pm, Bruno Desthuilliers All I am suggesting is that the programmer have the option of replacing self.member with simply .member, since the word self is arbitrary and unnecessary. I presume you

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
On Jul 27, 8:38 pm, alex23 [EMAIL PROTECTED] wrote: On Jul 28, 4:59 am, Russ P. [EMAIL PROTECTED] wrote: On Jul 27, 3:11 am, alex23 [EMAIL PROTECTED] wrote: On Jul 27, 4:26 pm, Russ P. [EMAIL PROTECTED] wrote: On Jul 26, 11:18 pm, Terry Reedy [EMAIL PROTECTED] wrote: The use

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
On Jul 27, 8:58 pm, castironpi [EMAIL PROTECTED] wrote: On Jul 27, 2:39 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Derek Martin a écrit : It's bad programming, but the world is full of bad programmers, and we don't always have the choice not to use their code. Isn't one of

Re: Attack a sacred Python Cow

2008-07-27 Thread Russ P.
On Jul 27, 9:44 pm, alex23 [EMAIL PROTECTED] wrote: On Jul 27, 4:26 pm, Russ P. [EMAIL PROTECTED] wrote: Terry Reedy [EMAIL PROTECTED] wrote: The use of nothing'.' has been suggested before and rejected. Where and why? Dude, I agree with Guido completely on this one. You

Re: Attack a sacred Python Cow

2008-07-28 Thread Russ P.
On Jul 27, 10:32 pm, Terry Reedy [EMAIL PROTECTED] wrote: Derek Martin wrote: Furthermore, as you described, defining the function within the scope of a class binds a name to the function and then makes it a method of the class. Once that happens, *the function has become a method*. If

Re: Attack a sacred Python Cow

2008-07-28 Thread Russ P.
On Jul 28, 4:23 am, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Russ P. a écrit : On Jul 27, 3:11 pm, Russ P. [EMAIL PROTECTED] wrote: On Jul 27, 12:39 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Derek Martin a écrit : On Sun, Jul 27, 2008 at 08:19:17AM +, Steven D'Aprano

Re: Attack a sacred Python Cow

2008-07-28 Thread Russ P.
On Jul 28, 2:52 am, alex23 [EMAIL PROTECTED] wrote: On Jul 28, 3:07 pm, Russ P. [EMAIL PROTECTED] wrote: What was suggested in rejected on the thread you pointed me to was not what I suggested. Not even close. Get it, genius? *sigh* Clearly I don't have better things to do right now than

Re: QOTW [was Re: Attack a sacred Python Cow]

2008-07-28 Thread Russ P.
On Jul 28, 7:07 am, Steven D'Aprano [EMAIL PROTECTED] cybersource.com.au wrote: On Sun, 27 Jul 2008 21:42:37 -0700, Russ P. wrote: +1 QOTW Do you realize what an insult that is to everyone else who has posted here in the past week? Actually I don't. I hadn't realised that when a person

Re: Attack a sacred Python Cow

2008-07-28 Thread Russ P.
On Jul 28, 5:44 pm, Ben Finney [EMAIL PROTECTED] wrote: Bruno Desthuilliers [EMAIL PROTECTED] writes: Boy, I don't know who you think you're talking to, but you're obviously out of luck here. I'm 41, married, our son is now a teenager, I have an happy social life, quite a lot of work, and

Re: Attack a sacred Python Cow

2008-07-28 Thread Russ P.
On Jul 28, 12:08 pm, Bruno Desthuilliers [EMAIL PROTECTED] wrote: It's a very simple idea that you insist on making complicated. As I said, I could write a pre-processor myself to implement it in less than a day. Preprocessor are not a solution. Sorry. I never said that a pre-processor

Re: Attack a sacred Python Cow

2008-07-28 Thread Russ P.
On Jul 28, 8:44 pm, alex23 [EMAIL PROTECTED] wrote: On Jul 29, 4:46 am, Russ P. [EMAIL PROTECTED] wrote: As I said, I could write a pre-processor myself to implement it in less than a day. So WHY DON'T YOU WRITE IT ALREADY? I'm working on something else right now if you don't mind

Re: static variables in Python?

2008-07-29 Thread Russ P.
On Jul 29, 1:40 pm, kj [EMAIL PROTECTED] wrote: Yet another noob question... Is there a way to mimic C's static variables in Python? Or something like it? The idea is to equip a given function with a set of constants that belong only to it, so as not to clutter the global namespace with

Re: static variables in Python?

2008-07-29 Thread Russ P.
On Jul 29, 6:33 pm, Russ P. [EMAIL PROTECTED] wrote: On Jul 29, 1:40 pm, kj [EMAIL PROTECTED] wrote: Yet another noob question... Is there a way to mimic C's static variables in Python? Or something like it? The idea is to equip a given function with a set of constants that belong

Re: Attack a sacred Python Cow

2008-07-29 Thread Russ P.
On Jul 29, 2:27 am, Iain King [EMAIL PROTECTED] wrote: On Jul 29, 5:33 am, Russ P. [EMAIL PROTECTED] wrote: On Jul 28, 8:44 pm, alex23 [EMAIL PROTECTED] wrote: On Jul 29, 4:46 am, Russ P. [EMAIL PROTECTED] wrote: As I said, I could write a pre-processor myself to implement

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-29 Thread Russ P.
On Jul 29, 9:52 pm, Carl Banks [EMAIL PROTECTED] wrote: On Jul 29, 11:17 pm, Terry Reedy [EMAIL PROTECTED] wrote: Carl Banks wrote: As I wrote in the second reply email I sent, check out my integer set recipe on ASPN (and to save you the search:

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Russ P.
On Jul 29, 10:33 pm, Carl Banks [EMAIL PROTECTED] wrote: On Jul 30, 1:15 am, Russ P. [EMAIL PROTECTED] wrote: Having said that, it would sure be nice to be able to write if myList is not empty: instead of if len(myList) != 0: I can agree with this. But I guess that could only work

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Russ P.
On Jul 29, 11:09 pm, Erik Max Francis [EMAIL PROTECTED] wrote: I'm getting this sneaking suspicion that you guys are all putting us on. As I said in an earlier post, I realize that this would only work if there were only one copy of empty (as there is only one copy of None). I don't know off

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Russ P.
On Jul 29, 11:16 pm, Erik Max Francis [EMAIL PROTECTED] wrote: Russ P. wrote: On Jul 29, 10:33 pm, Carl Banks [EMAIL PROTECTED] wrote: On Jul 30, 1:15 am, Russ P. [EMAIL PROTECTED] wrote: Having said that, it would sure be nice to be able to write if myList is not empty: instead

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Russ P.
On Jul 29, 11:36 pm, Erik Max Francis [EMAIL PROTECTED] wrote: Russ P. wrote: On Jul 29, 11:09 pm, Erik Max Francis [EMAIL PROTECTED] wrote: I'm getting this sneaking suspicion that you guys are all putting us on. As I said in an earlier post, I realize that this would only work

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Russ P.
On Jul 29, 11:36 pm, Erik Max Francis [EMAIL PROTECTED] wrote: Russ P. wrote: Come to think of it, shouldn't the list type have an isempty method? Or does it? Yes. It's written: if not aList: ... As you know, that is not quite exactly the same thing. An isempty

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Russ P.
On Jul 30, 12:03 am, Heiko Wundram [EMAIL PROTECTED] wrote: Am Mittwoch, 30. Juli 2008 08:30:48 schrieb Russ P.: On Jul 29, 11:09 pm, Erik Max Francis [EMAIL PROTECTED] wrote: I'm getting this sneaking suspicion that you guys are all putting us on. As I said in an earlier post, I realize

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Russ P.
On Jul 30, 12:49 am, Heiko Wundram [EMAIL PROTECTED] wrote: Am Mittwoch, 30. Juli 2008 09:18:48 schrieb Russ P.: Oh, Lordy. I understand perfectly well how boolean tests, __len__, and __nonzero__ work in Python. It's very basic stuff. You can quit patronizing me (and Carl too, I'm sure

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Russ P.
On Jul 30, 1:07 am, Erik Max Francis [EMAIL PROTECTED] wrote: Russ P. wrote: Oh, Lordy. I understand perfectly well how boolean tests, __len__, and __nonzero__ work in Python. It's very basic stuff. You can quit patronizing me (and Carl too, I'm sure). You suggested a syntax for testing

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Russ P.
On Jul 30, 7:05 pm, Erik Max Francis [EMAIL PROTECTED] wrote: Russ P. wrote: On Jul 30, 1:07 am, Erik Max Francis [EMAIL PROTECTED] wrote: Russ P. wrote: Oh, Lordy. I understand perfectly well how boolean tests, __len__, and __nonzero__ work in Python. It's very basic stuff. You can quit

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Russ P.
On Jul 30, 8:03 pm, Erik Max Francis [EMAIL PROTECTED] wrote: Russ P. wrote: The reason I wrote that it would be nice to be able to write if x is not empty: is that it reads naturally. It was not an actual proposal, and the fact that you took it as such was *your* mistake

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Russ P.
On Jul 30, 8:24 pm, Russ P. [EMAIL PROTECTED] wrote: On Jul 30, 8:03 pm, Erik Max Francis [EMAIL PROTECTED] wrote: Russ P. wrote: The reason I wrote that it would be nice to be able to write if x is not empty: is that it reads naturally. It was not an actual proposal

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-30 Thread Russ P.
On Jul 30, 9:27 pm, Erik Max Francis [EMAIL PROTECTED] wrote: Russ P. wrote: I don't know if you can read minds, but you seem to have a lot of trouble reading words. Can you read it would be nice to be able to write ...? Can you understand what it means? Can you understand that it does

Re: Boolean tests [was Re: Attack a sacred Python Cow]

2008-07-31 Thread Russ P.
On Jul 30, 10:43 pm, Erik Max Francis [EMAIL PROTECTED] wrote: Russ P. wrote: On Jul 30, 9:27 pm, Erik Max Francis [EMAIL PROTECTED] wrote: You're sure going on about a distinction without a difference for a guy who childishly likes to call other people names. A reasonable person would

Re: Strong/weak typing

2008-08-01 Thread Russ P.
On Aug 1, 8:31 am, [EMAIL PROTECTED] wrote: I'm writing Python as if it were strongly typed, never recycling a name to hold a type other than the original type. Is this good software engineering practice, or am I missing something Pythonic? Reusing names for no reason can make debugging

Apology

2008-08-01 Thread Russ P.
Many of you probably consider me a real jerk. Well, I guess I have been one here. Believe it or not, I'm actually a pretty nice guy in real life. Something about the detachment and (partial) anonymity of being online makes me write things I would never say in person. For that I apologize. I had

  1   2   3   >