By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,050 Members | 1,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,050 IT Pros & Developers. It's quick & easy.

Python for everything?

P: n/a
I posted a article earlier pertaining programming for my boss. Now I am
gonna ask a question about programming for myself. I just finished my
first C++ Class. Next semester is a class on encryption(and it's
probably gonna be a math class too). And finally back in programming in
the fall with C++ and Java 1. The C++ will cover pointers, and linked
lists, sorting algorithms, etc... I run linux and OS X. I have read in
the old days that C was used for everything. It was a systems
programming language, and also did a lot of the same stuff Bash scripts
and perl do now. So, in that era, C did it all, from short to tall. My
question is, can Python "do it all"? I am wondering what to learn as my
scripting language. I have read that perl is good up to about 250
lines, and after that it gets kind of hairy. However, from what little
I have heard about Python, it's very well suited for readability due to
the whitespace requirements of the language, and very good for large
projects due to it's large amount of modules and it's object oriented
structure. I would like opinions as to the suitability of Python as a
general purpose language for programming unix, everything from short
scripts to muds. Thanks for your patience, opinions, and comments.

Xeys

Jul 19 '05 #1
Share this Question
Share on Google+
20 Replies


P: n/a
Python for everything except things that need to be ridiculously
optimized for speed. Thats what C embedded in Python and Psyco enhanced
Python code is for.

Oh wait, thats still all Python...

Jul 19 '05 #2

P: n/a
Short answer is yes.

Longer answer: You will still need C for device drivers and other
applications that have high performance demands. Calling C from
Python is quite easy. Python can be used from short "shell" scripting
to projects that very large (see Zope, Plone, ReportLab, etc). Other
than C, Python is the only language that I've been able to write
Windows Services (or *nix daemons), COM objects, GUI programs, text
programs, and headless programs (e.g. programs that produce no
console output). I'm much more productive with Python. By choosing
Python you commit to learning one language extremely well instead of
jumping all over with different languages that you can remember only
poorly. When new version of Python ships, you just learn what is new.
If you try to keep up with C, C++, Visual Basic, ... it gets to be
impossible.

Hope information helps.

Larry Bates
xe*****@yahoo.com wrote:
I posted a article earlier pertaining programming for my boss. Now I am
gonna ask a question about programming for myself. I just finished my
first C++ Class. Next semester is a class on encryption(and it's
probably gonna be a math class too). And finally back in programming in
the fall with C++ and Java 1. The C++ will cover pointers, and linked
lists, sorting algorithms, etc... I run linux and OS X. I have read in
the old days that C was used for everything. It was a systems
programming language, and also did a lot of the same stuff Bash scripts
and perl do now. So, in that era, C did it all, from short to tall. My
question is, can Python "do it all"? I am wondering what to learn as my
scripting language. I have read that perl is good up to about 250
lines, and after that it gets kind of hairy. However, from what little
I have heard about Python, it's very well suited for readability due to
the whitespace requirements of the language, and very good for large
projects due to it's large amount of modules and it's object oriented
structure. I would like opinions as to the suitability of Python as a
general purpose language for programming unix, everything from short
scripts to muds. Thanks for your patience, opinions, and comments.

Xeys

Jul 19 '05 #3

P: n/a
<xe*****@yahoo.com> wrote:
I have read in the old days that C was used for everything. It was a
systems programming language, and also did a lot of the same stuff
Bash scripts and perl do now.
I learned C in "the old days" (1977 or maybe 78). We had plenty of
other tools for scripting. Before perl, we certainly had shell
scripts (although the early shells were not as powerful as
bash/ksh/etc), along with a healthy dose of utilities like
grep/sed/sort and awk. I don't know anybody who tried to do
everything in C.
My question is, can Python "do it all"?
Probably not. I couldn't imagine writing an operating system in
Python; you'd never get the performance you need. For very low-level
stuff that interfaces with hardware and twiddles with bits, it's
probably the wrong tool as well.
I am wondering what to learn as my scripting language.


Python is an excellent scripting language, and I strongly urge you to
learn it. But, for certain niches, there are better tools. If you
main goal is to execute other processes and manipulate files, for
example, bash is probably a better tool.

Often, your choice of tool will be dictated by external constraints.
If you're trying to interface to some third-party system which only
has a perl or java API (not an uncommon situation), you're going to be
doing it in perl or java.
Jul 19 '05 #4

P: n/a
Python is in my opinion the best "all-purpose" language ever
designed ( lisp is extremely cool but not as all purpose.)
Much more elegant than perl and far far easier to do cool things
than java (java is c++ on valium).

HOWEVER, "all purpose" needs a little disclosure.
A well coded C program may be 100 times faster than Python.
C forces you to learn some things about relative addressing
and memory management.
C is pretty much required for interrupt handling.
Python is coded in C. (everthing is coded in C, including C)
The C language embodies a language design philosophy which
has influenced everything for 30 years.

So Python is just a wonderful way to learn about things like
algorithms, with relatively little pain. But the bottom
line for a would be computer scientist is that Python is
sort of like a model or an abstraction of C (which itself
is a very weak (but convenient) model of the CPU)

IMHO

There probably is NO college where you can get out of
C++ and Java. Too bad.

xe*****@yahoo.com wrote:
I posted a article earlier pertaining programming for my boss. Now I am
gonna ask a question about programming for myself. I just finished my
first C++ Class. Next semester is a class on encryption(and it's
probably gonna be a math class too). And finally back in programming in
the fall with C++ and Java 1. The C++ will cover pointers, and linked
lists, sorting algorithms, etc... I run linux and OS X. I have read in
the old days that C was used for everything. It was a systems
programming language, and also did a lot of the same stuff Bash scripts
and perl do now. So, in that era, C did it all, from short to tall. My
question is, can Python "do it all"? I am wondering what to learn as my
scripting language. I have read that perl is good up to about 250
lines, and after that it gets kind of hairy. However, from what little
I have heard about Python, it's very well suited for readability due to
the whitespace requirements of the language, and very good for large
projects due to it's large amount of modules and it's object oriented
structure. I would like opinions as to the suitability of Python as a
general purpose language for programming unix, everything from short
scripts to muds. Thanks for your patience, opinions, and comments.

Xeys


Jul 19 '05 #5

P: n/a
xe*****@yahoo.com writes:
I posted a article earlier pertaining programming for my boss. Now I am
gonna ask a question about programming for myself. I just finished my
first C++ Class. Next semester is a class on encryption(and it's
probably gonna be a math class too). And finally back in programming in
the fall with C++ and Java 1. The C++ will cover pointers, and linked
lists, sorting algorithms, etc... I run linux and OS X. I have read in
the old days that C was used for everything. It was a systems
programming language, and also did a lot of the same stuff Bash scripts
and perl do now. So, in that era, C did it all, from short to tall. My
question is, can Python "do it all"? I am wondering what to learn as my
scripting language. I have read that perl is good up to about 250
lines, and after that it gets kind of hairy. However, from what little
I have heard about Python, it's very well suited for readability due to
the whitespace requirements of the language, and very good for large
projects due to it's large amount of modules and it's object oriented
structure. I would like opinions as to the suitability of Python as a
general purpose language for programming unix, everything from short
scripts to muds. Thanks for your patience, opinions, and comments.


As other have noted, C was never really used for everything. Unix
tools were designed to connect together from the very beginning, which
is what makes shell scripting so powerful. This was true before there
was a C. Likewise, some things you need more control over the machine
than you get in C - those are still done in assembler. These days, C
compilers let you embed assembler statements in your C, so some of
these things are done in such variants.

Some things require you to be able to generate machine code. Those
can't be done in any current implementation of Python. That doesn't
mean they'll never be doable in Python - just not now. As mentioned,
some things needvery explicit control over the generated machine
code. Those things aren't done in C now, and will never be done in C
or Python.

Rather than talk about how suitable Python is for programming in
general, I wanted to talk about the things you mentioned you'd be
learning.

Python doesn't have explicit pointers - except that every name is a
pointer. That makes it hard to learn about pointers with Python. You
can do data structures in Python, though. Just replace the C/C++
struct with a class, and manipulate the attributes like you'd
manipulate struct members. For instance, a linked list might be
represented by:

class ListNode:
def __init__(self, data):
self.data = data
self.next = None

A routine that manipulated a list might look like:

def cons(car, cdr): car.next = cdr

Though I'd be tempted to make it a method of ListNode:

def cons(self, cdr): self.next = cdr

You build a list from the back to the front like so:

LinkedList = cons(ListNode(1), cons(ListNode(2), ListNode(3)))

or

LinkedList = ListNode(1).cons(ListNode(2).cons(ListNode(3)))

(this is heavily influenced by LISP; you might prever a different
abstraction) and then you'd iterate over the list like so:

item = LinkedList
while item:
Process(item.data)
item = item.next

Compared to a C implementation, which would look like:

struct ListNode {
struct ListNode *next ;
void *data ;
} ;

and an iteration like so:

struct ListNode *item ;
item = &LinkedList ;
while (item) {
Process(item->data) ;
item = item->next ;
}

I won't get into the details of building a list in C. It's just too
ugly.

Sorting is generally done on arrays, though there are methods that use
lists, etc. You can study those just fine in Python. However, those
are mostly of academic interest. Any computing platform worth
mentioning will have a good, general-purpose sort facility
available. Using that is certainly faster than writing and debugging
your own.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Jul 19 '05 #6

P: n/a
Hi All--

Mike Meyer wrote:

xe*****@yahoo.com writes:

As other have noted, C was never really used for everything. Unix
tools were designed to connect together from the very beginning, which
is what makes shell scripting so powerful. This was true before there
was a C. Likewise, some things you need more control over the machine
than you get in C - those are still done in assembler. These days, C
compilers let you embed assembler statements in your C, so some of
these things are done in such variants.


It really was used "for everything"; C compilers have *always* let you
include assembler, with the "asm" keyword. Unless you're talking about
the early days of DOS/Windows compilers, about which I know little, but
all *K&R* compilers had asm. If you wanted to write kernel code and
device driver code (including disk drivers) for large Unix systems, asm
was a requirement. To put it in perspective, for Gould systems in the
80s, for the entire OS (BSD-derived Unix), there were under 100 lines of
assembler, all in a very few device drivers (multiple thousands of lines
of code, don't remember exactly how many).

And living with structs instead of classes was not nearly as much of a
pain in the butt as you make out; it was perfectly reasonable to include
methods within structs, by including a pointer to a function. X10 and
X11 showed just how object-oriented you could get with C, using
callbacks with required signatures, and specifying how Widgets were to
be written--contracts before there were contracts.

It's true that OO languages are better, and languages like Python which
allow you to combine fairly low-level calls with an OO worldview make
life *vastly* easier, but C is still hugely flexible, highly adaptable,
and very powerful. For about 10 or 15 years there, knowing C was pretty
much a guarantee of a good job. That changed when C++ compilers became
common and good and not merely preprocessors that wrote really, really
ugly C.

Metta,
<while(*s++=*p++);>-ly y'rs,
Ivan;-)
----------------------------------------------
Ivan Van Laningham
God N Locomotive Works
http://www.andi-holmes.com/
http://www.foretec.com/python/worksh...oceedings.html
Army Signal Corps: Cu Chi, Class of '70
Author: Teach Yourself Python in 24 Hours
Jul 19 '05 #7

P: n/a
Ivan Van Laningham <iv*****@pauahtun.org> wrote:
It really was used "for everything"; C compilers have *always* let you
include assembler, with the "asm" keyword. Unless you're talking about
the early days of DOS/Windows compilers, about which I know little, but
all *K&R* compilers had asm. If you wanted to write kernel code and
device driver code (including disk drivers) for large Unix systems, asm
was a requirement.


The ability to embed assembler in-line with C code is only a convenience.
For the extremely small amount of assembler code required in a typical
kernel, it's easy enough to write small routines directly in assembler, and
call them from your C code like you would any other function.

The last time I was inside a Unix kernel was the pdp-11 days. The pdp-11
was a memory-mapped machine, which meant almost all hardware interactions
were done by loading and reading fixed memory locations. So, you could do
things like (I'm doing this from memory, so it's only vaguely correct):

struct dr11regs {
unsigned int cmd;
unsigned int status;
unsigned int count;
unsigned int base;
};

struct dr11regs *drptr = 0177540;
char buf[MAXBUF];

drptr->base = buf;
drptr->count = MAXBUF;
drptr->cmd =& DR_START;
while ((drptr->status & DR_REMAIN) > 0) {
wait();
}

That's a lot of low-level bit fiddling right down on the bare metal, and
not a line of assembler in sight.
Jul 19 '05 #8

P: n/a
Ivan Van Laningham <iv*****@pauahtun.org> writes:
Mike Meyer wrote:
xe*****@yahoo.com writes:
As other have noted, C was never really used for everything. Unix
tools were designed to connect together from the very beginning, which
is what makes shell scripting so powerful. This was true before there
was a C. Likewise, some things you need more control over the machine
than you get in C - those are still done in assembler. These days, C
compilers let you embed assembler statements in your C, so some of
these things are done in such variants. It really was used "for everything"; C compilers have *always* let you
include assembler, with the "asm" keyword. Unless you're talking about
the early days of DOS/Windows compilers, about which I know little, but
all *K&R* compilers had asm.


Actually, I was thinking of pre-K&R Unix compilers. The v6 Unix
compiler, and the photo7 compiler. I don't believe they had asm
statements. If they did, it wasn't used in the v6 kernel.
And living with structs instead of classes was not nearly as much of a
pain in the butt as you make out; it was perfectly reasonable to include
methods within structs, by including a pointer to a function. X10 and
X11 showed just how object-oriented you could get with C, using
callbacks with required signatures, and specifying how Widgets were to
be written--contracts before there were contracts.
Yeah, X is a good example of how to do OO programming in a non-OO
language. The current BSD kernels do the same kind of things. But I'd
say it was a bigger pain in the but than I made out to be. You wind up
having to invoke the function through your data object, and then pass
the data object in - sort of as an explicit "self".
It's true that OO languages are better, and languages like Python which
allow you to combine fairly low-level calls with an OO worldview make
life *vastly* easier, but C is still hugely flexible, highly adaptable,
and very powerful. For about 10 or 15 years there, knowing C was pretty
much a guarantee of a good job. That changed when C++ compilers became
common and good and not merely preprocessors that wrote really, really
ugly C.


I still use C when I need more control/speed than I can get out of
Python (or something modern). And for wrapping things to use in
HLLs.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Jul 19 '05 #9

P: n/a
On Thu, 30 Jun 2005 xe*****@yahoo.com wrote:
can Python "do it all"?
More or less. There are two places where python falls down, IMHO. One is
performance: python isn't generally as fast as C or Java, even with Psyco.
However, the number of cases where performance - and absolute
straight-line performance of the code - actually matters is much smaller
than you might think. Also, you can incorporate C into python pretty
easily. The other is in bit-twiddling - anything that involves mucking
about with data at the level of bits and bytes. Maybe this is just blind
prejudice, but i'm never as comfortable hacking on that sort of stuff
(writing a Huffman coder, say) in python as in java.

Other than that, python is pure victory.
I am wondering what to learn as my scripting language.
Python.
I have read that perl is good up to about 250 lines, and after that it
gets kind of hairy.
That's putting it mildly.
I would like opinions as to the suitability of Python as a general
purpose language for programming unix, everything from short scripts to
muds.


Python is, all things considered, definitely the best such language.

There are strong arguments that can be made in favour of younger cousins
of Python such as Ruby and Lua, but none of those have anything like the
userbase or third-party code that Python does, and that counts for a lot.
LISP (or rather Scheme) would be a more unusual option; it's a language
that most people hate, but that people who really take the time to learn
it love with a fervour bordering on scary.

tom

--
In-jokes for out-casts
Jul 19 '05 #10

P: n/a
Let me express it with an exaple (by the way, sorry for my bad
english):
Suppose you are planning to build a house.
You have two choices:
- Option one: Buy several thousands bricks, doors, tiles, windows,
etc... put them all together according to the blueprints and build your
home.
- Option two: Get loads of sand, concrete, wood and raw materials, make
your own bricks, make each door and windows with your prefered kind of
wood, design and make your tiles, etc.. and after a long, long time,
create a unique, one of a kind house.

Option one would be like using Python for creating your programs.
It gives you all the built-in functions and high level data structures
with which you can create a solution for almost any kind of problem you
might want to solve. You don't have to spend time allocating memmory,
using pointers, creting your data structures from scratch, etc, etc..
because it's all there already available for you, and all these time
consuming, error-prone tasks are very well hadled by python itself.

Option two is like using C:
It gives you full control in the creating on your program, but 90% of
the times (or more) you might think "do I really need to go through all
this hassle?". Sure, it will be faster but, "do I really need this
extra speed?".

I think that with the current processors, speed and performance is less
an isue than it was a few years ago.
Most of the times, developing time is paramount. And even if you need
very good execution speed for a given task, you can still code an
extension in c or c++ and keep all the benefits of a high level
programming language such as python.

And if these arguments still can't convince you, be adviced that
there's a very ambicious and exciting project called "Pypy" which aims
to create a high performance python implementation, and it is being
developed very succesfully.
They say that the secret goal is being faster than c... and I'm not
sure but I think that there's a tentative hard line set to december of
2006. Check it out: http://codespeak.net/pypy/index.cgi?news

Cheers,
Luis

Jul 19 '05 #11

P: n/a
Tom Anderson <tw**@urchin.earth.li> writes:
On Thu, 30 Jun 2005 xe*****@yahoo.com wrote:
can Python "do it all"?

[snip] The other is in bit-twiddling - anything that involves
mucking about with data at the level of bits and bytes. Maybe this is
just blind prejudice, but i'm never as comfortable hacking on that
sort of stuff (writing a Huffman coder, say) in python as in java.


Maybe we should distinguish:

1. Can you do it at all? Yes, via the struct package and via the bit
operators. And, the bit operators support the same idioms we all
know and love from C.

2. Can it be done "fast enough"? Maybe. I wrote a Morse code
generator based on algorithms from a C program, which generated pcm
files. The initial cut was way too slow. Then I did some caching
and got it fast enough to use. Still not C speeds, but fast enough
for the task. But if you are doing encryptions (where even C is
giving way to hardware), then Python is not the answer.

--
ha************@boeing.com
6-6M21 BCA CompArch Design Engineering
Phone: (425) 294-4718
Jul 19 '05 #12

P: n/a
On 2005-06-30, xe*****@yahoo.com <xe*****@yahoo.com> wrote:
I have read in the old days that C was used for everything. It
was a systems programming language, and also did a lot of the
same stuff Bash scripts and perl do now.
Not really. C was used for a lot of stuff (mostly just under
Unix), but there was still tons of COBOL, FORTRAN, Lisp, and a
bunch of other languages. Under Unix bourne shell (from which
bash evolved) has always been popular for scripting. Sed and
awk scripts have been popular for ages as well. Other OSes
have various JCL and batch scripting languages. C was only
popular under Unix OSes -- under most other OSes, C wasn't
popular at all. MacOS and Windows APIs were originally
designed for use by Pascal, VAX/VMS was apparently intended to
be used via FORTRAN and BLISS-32. C was later made available
on those platforms but you could tell it didn't really "fit"
well with the OS.
So, in that era, C did it all, from short to tall.
My memory only goes back about 25 years, but that was never
true in my experience.
My question is, can Python "do it all"? I am wondering what to
learn as my scripting language.
First, stop thinking in the singular. For starters I'd
recommend bash, Python, and awk. Add perl if you like, but I
think it's syntax/semantics are extraordinarily nasty (I even
find the Lisp family of languages far easier to read).
I have read that perl is good up to about 250 lines, and after
that it gets kind of hairy.
In my experience it get's hairy a lot faster than that. :)
However, from what little I have heard about Python, it's very
well suited for readability due to the whitespace requirements
of the language, and very good for large projects due to it's
large amount of modules and it's object oriented structure.
True.
I would like opinions as to the suitability of Python as a
general purpose language for programming unix, everything from
short scripts to muds.


I use Python for all sorts of programs under from a couple
lines for a normal text filter to thousands of lines with a
complex GUI.

[Why are Python programs referred to as "scripts". Python no
more a "scripting" language than Java, Pascal, Smalltalk,
Objective C.]

--
Grant Edwards grante Yow! Yow! We're going to
at a new disco!
visi.com
Jul 19 '05 #13

P: n/a
On 2005-06-30, Ivan Van Laningham <iv*****@pauahtun.org> wrote:
As other have noted, C was never really used for everything. Unix
tools were designed to connect together from the very beginning, which
is what makes shell scripting so powerful. This was true before there
was a C. Likewise, some things you need more control over the machine
than you get in C - those are still done in assembler. These days, C
compilers let you embed assembler statements in your C, so some of
these things are done in such variants.


It really was used "for everything";


I think there are two intepretations of C being "used for
everthing".

My reading of that phrase is that nothing else was used: there
were no shell scripts, no awk scripts, no FORTRAN programs, no
JCL, no COBOL, no Lisp, no sed.

That just was never the case. There never was a C-language
monoculture in any OS.

Another possible interpretation is that at some point in the
past, there was some misguided soul who has tried to use C for
every type of task imaginable. That's probably true, but the
same could be said of any language.

--
Grant Edwards

Jul 19 '05 #14

P: n/a
Grant Edwards wrote:
[Why are Python programs referred to as "scripts". Python no
more a "scripting" language than Java, Pascal, Smalltalk,
Objective C.]


I think it's because the term "script" is a nice, simple word that
evokes the idea of "source file that can be directly executed", which is
a convenient thing to be able to say in fewer words than that...

I think it would be unusual for anyone to refer to a multi-file Python
program as merely a "script".

We do often call individual source files in a large Python program
"scripts", but I think that's probably just out of habit or association:
calling single Python source files "scripts" is so common, even if they
aren't scripts in the sense of "individually executable files written in
a scripting language" any more.

-Peter
Jul 19 '05 #15

P: n/a
On Thu, 30 Jun 2005 20:55:20 -0400, rumours say that Mike Meyer
<mw*@mired.org> might have written:
Actually, I was thinking of pre-K&R Unix compilers.


There must be something I am missing here, cause I don't understand what
you mean; what is the earliest K&R C compiler ("Unix" compiler) you
consider as such? Were there other Unix C compilers before K&R wrote
one? Or are you considering as "K&R Unix compilers" those after the
publication of the white book and before C89?
--
TZOTZIOY, I speak England very best.
"Dear Paul,
please stop spamming us."
The Corinthians
Jul 19 '05 #16

P: n/a
Christos "TZOTZIOY" Georgiou <tz**@sil-tec.gr> wrote:
Were there other Unix C compilers before K&R wrote one?


Considering that K&R (along with T) invented both Unix and C, I would say
that the answer to the above has to be "No".
Jul 19 '05 #17

P: n/a
Christos "TZOTZIOY" Georgiou <tz**@sil-tec.gr> writes:
On Thu, 30 Jun 2005 20:55:20 -0400, rumours say that Mike Meyer
<mw*@mired.org> might have written:
Actually, I was thinking of pre-K&R Unix compilers.


There must be something I am missing here, cause I don't understand what
you mean; what is the earliest K&R C compiler ("Unix" compiler) you
consider as such? Were there other Unix C compilers before K&R wrote
one? Or are you considering as "K&R Unix compilers" those after the
publication of the white book and before C89?


The latter. I was considering "K&R Unix compilers" to be the compiler
described by the white K&R book - what is basically the v7 Unix C
compiler. Thwe v6 compiler didn't do op=, it still did =op. We used the
photo7 C compiler on our v6 system. I don't believe that was written by
K&R.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Jul 19 '05 #18

P: n/a
Larry Bates wrote:
poorly. When new version of Python ships, you just learn what is new.
If you try to keep up with C, C++, Visual Basic, ... it gets to be
impossible.

Hope information helps.

Larry Bates

Huh? Part of C++'s problem is that it takes too long for obvious good
stuff to get into the language. It stays the same for years at a crack
inbetween the committees approving stuff. Python in contrast can see a
release every few months.

Python is a moving target. C++ is not.

Jul 21 '05 #19

P: n/a
Mike Meyer wrote:
You wind up
having to invoke the function through your data object, and then pass
the data object in - sort of as an explicit "self".

Yeah, and us pythonists hate explicit self! ;)

Jul 21 '05 #20

P: n/a
Joseph Garvin <k0*****@kzoo.edu> writes:
Mike Meyer wrote:
You wind up
having to invoke the function through your data object, and then pass
the data object in - sort of as an explicit "self".

Yeah, and us pythonists hate explicit self! ;)


Except the explicit self is on the method invocation, and not in the
method definition! So you wind up repeating the variable name.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Jul 21 '05 #21

This discussion thread is closed

Replies have been disabled for this discussion.