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

Python compared to other language

P: n/a
Hi all,

I have been looking at the various programming languages available. I
have programed in Basic since I was a teenager and I also have a basic
understanding of C, but I want something better.

Can anybody tell me the benefits and weaknesses of using Python?

--
Your friend,
Scott

Sent to you from a Linux computer using Kubuntu Version 7.04 (Feisty Fawn)
May 18 '07 #1
Share this Question
Share on Google+
27 Replies


P: n/a
On May 18, 3:04 pm, scott <sle...@rogers.comwrote:
Hi all,

I have been looking at the various programming languages available. I
have programed in Basic since I was a teenager and I also have a basic
understanding of C, but I want something better.

Can anybody tell me the benefits and weaknesses of using Python?
That question has been asked hundreds of times here -- read the
archives of this group and language comparisons on the web, for
example the one by Eric Raymond at http://www.faqs.org/docs/artu/languageschapter.html
..

Even better, try the language and draw your own conclusions.

May 18 '07 #2

P: n/a
scott wrote:
Hi all,

I have been looking at the various programming languages available.
I have programed in Basic since I was a teenager and I also have a basic
understanding of C, but I want something better.

Can anybody tell me the benefits and weaknesses of using Python?
Search the archives, this question has been covered many times.

That said I'm going to list some benefits below:

Python is Portable - C is probably the only more portable language

Python is Powerful - You can write everything from simple scripts to
daemons, Windows Services, Windows COM objects, web frameworks, GUI
or console programs. Again only C has that much range. On Windows,
Delphi comes close, but try to move a Delphi program to Macintosh or
even to Linux. I've merely copied Python programs from one OS to
another and they have run without so much as a single change.

Python has strong standard library - The standard library contains many
modules that you would have to purchase with other languages. This
adds to portability because many features are standard and don't
require additions.

Python is maintainable - Python coerces you into writing better code.
From the required indention of blocks to the rich built in data types
it provides a programmer with tools that you use over and over. I've
gone back to programs that I wrote 5+ years ago an it was remarkable
how quickly I could remember what I was doing.

Python is a strongly typed but dynamic language - I have always hated
the fact that you have to define everything in other languages. In
Python you define something when you need it and the definition is
implicit in hat you point to with a variable name. The introspection
that Python provides also lets you do some really powerful things
because you can make your code self-aware. While compiled languages
have their place, give me Python for my daily work. If I find myself
needing more performance in my code, I isolate that code into an
external C library and call it from Python. The data types that are
provided by Python (lists, tuples, dictionaries) are exactly what
programmers need. If you don't have a datatype that you want, its
easy to create one using Python classes.

Python has strong group of helpful users - This list is amazing. Post
a question and you get not one but several answers to even the most
complex of inquiries. This list provides the BEST technical support
of any language I've ever used in my 30+ years of programming many
different languages.

Python allows me to get really good at one language - Since I can do
almost anything that I can dream up in Python, I find I write almost
100% of my code in Python. This means that I am getting better at
Python not learning lots of other languages which I will never know
well.

I hope you find the information at least helpful.

Regards,
Larry

May 18 '07 #3

P: n/a
In article <11*********************@o5g2000hsb.googlegroups.c om>,
Beliavsky <be*******@aol.comwrote:
>On May 18, 3:04 pm, scott <sle...@rogers.comwrote:
>Hi all,

I have been looking at the various programming languages available. I
have programed in Basic since I was a teenager and I also have a basic
understanding of C, but I want something better.

Can anybody tell me the benefits and weaknesses of using Python?

That question has been asked hundreds of times here -- read the
archives of this group and language comparisons on the web, for
example the one by Eric Raymond at
http://www.faqs.org/docs/artu/languageschapter.html
.

Even better, try the language and draw your own conclusions.
"... [T]ry the language and draw your own conclusions" is better
advice than the original questioner might realize, for he doesn't
yet know how low is the cost to get started with Python <URL:
http://www.awaretek.com/tutorials.html >.

In the meantime, <URL:
http://wiki.python.org/moin/LanguageComparisons might be of
interest.
May 18 '07 #4

P: n/a
scott wrote:
Hi all,

I have been looking at the various programming languages available.
I have programed in Basic since I was a teenager and I also have a basic
understanding of C, but I want something better.

Can anybody tell me the benefits and weaknesses of using Python?
hi Scott,
coming from Basic, I think Python might be a very good (maybe even thé best) choice.

I've been searching for the past few years for a universal language,
in which I can do everything, whether it's
- a normal (graphical) user application,
- a program which is downloaded in a small micro-controller
- an interactive webpage design
- performing educational / scientific calculations
now this can all (well almost) be done in Python.
(a year ago I thought it was PHP,
but it can't do small micros and scientific work)

The major disadvantage of Python,
(at least if you compare it with Visual Basic, Delphi, Kylix, Lazarus),
is the somewhat limited (or more difficult) building of a graphical user interface.

I've rewritten a few pieces of code from both MatLab and Delphi (comparable with Basic),
into Python,
and it's really great,
number of sourcecode lines decreased to about 30% !!

But as others said, try it yourself.

cheers,
Stef Mientki
May 18 '07 #5

P: n/a
Thank you everyone for your help. I will make sure to check the
archives, something I should have done first :)

--
Your friend,
Scott

Sent to you from a 100% Linux computer using Kubuntu Version 7.04
(Feisty Fawn)
May 18 '07 #6

P: n/a
On May 18, 2:17 pm, Larry Bates <larry.ba...@websafe.comwrote:
Python is Portable - C is probably the only more portable language
Small quibble: IMO, although C runs on many platforms, I don't think C
code is typically portable between platorms. Unless you are doing
something very simple. If you write something with Visual Studio to do
something fairly advanced on Windows, I don't think the same,
unmodified, code will usually run on UNIX, or MS-DOS. Maybe if you use
pure ANSI C, but I don't think many people do that.

I'm just learning Python. FWIW: my opinions about Python:

- good for many things, but probably not the most popular for any one
thing. For example: PHP is more popular for web-dev, Perl is more
popular for sys-admin.

- IMO: the most comparable language to Python, is Perl. Both are
scripting languages. Both are free, multi-platform, and multi-purpose.
Both are also very popular.

- although good for beginners, Python is also used for some very
advanced stuff.

- IMO: people are more likely to switch from Perl, to Python, than the
other way around.

- Python is generally considered to be more readable than Perl, and
thereby, more maintainable.

- I have managed to be fairly productive with Python in a very short
time, if I get good at Python, I think I could be very productive.

- although Python is considered one of the most popular languages,
jobs as python programmers seem to be very rare. I think Python is
often used as a tool by people who specialize in other things: data
analysts, scientists, systems administrators, database administrators,
software testers, etc.

- some will tell you that you don't need to know anything about object
oriented development to use Python. But, I don't think you will get
far without some OO.

Just my $0.02

May 19 '07 #7

P: n/a
walterbyrd wrote:
On May 18, 2:17 pm, Larry Bates <larry.ba...@websafe.comwrote:
>Python is Portable - C is probably the only more portable language

Small quibble: IMO, although C runs on many platforms, I don't think C
code is typically portable between platorms. Unless you are doing
something very simple. If you write something with Visual Studio to do
something fairly advanced on Windows, I don't think the same,
unmodified, code will usually run on UNIX, or MS-DOS. Maybe if you use
pure ANSI C, but I don't think many people do that.
Surely the fact that Python is available on so many platforms implies
that C is a fairly portable language. I realise that you have to take
platform specifics into account much more than you do in Python, but I
do feel you are being somewhat unfair to C.
I'm just learning Python. FWIW: my opinions about Python:
[ ... ]

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
------------------ Asciimercial ---------------------
Get on the web: Blog, lens and tag your way to fame!!
holdenweb.blogspot.com squidoo.com/pythonology
tagged items: del.icio.us/steve.holden/python
All these services currently offer free registration!
-------------- Thank You for Reading ----------------

May 19 '07 #8

P: n/a
walterbyrd <wa********@iname.comwrote:
- IMO: the most comparable language to Python, is Perl. Both are
scripting languages. Both are free, multi-platform, and multi-purpose.
Both are also very popular.
I think that Ruby, which roughly speaking sits somewhere between Python
and Perl, is closer to Python than Perl is. Judging popularity strictly
by the number of hits on search engines, it seems to be in the same
ballpark as Python and Perl.
Alex
May 19 '07 #9

P: n/a
On May 18, 8:28 pm, Steve Holden <s...@holdenweb.comwrote:
Surely the fact that Python is available on so many platforms implies
that C is a fairly portable language.
Unless it's the same C code, I don't see how that means anything. If I
write an app on Windows with C, and I rewrite the same app on UNIX
with C - that doesn't mean the C code has been ported.

My guess is that some of the C code used to develop Python is the same
between the different Python distros, but much of the code is unique
to the particular platform. If that is the case, then the C code may
not be very portable.

But, I can often take the same python code, and run it on MacOS,
Linux, FreeBSD, and Windows. Often I can do this even if the app has a
gui interface.

May 19 '07 #10

P: n/a
On May 18, 10:24 pm, a...@mac.com (Alex Martelli) wrote:
>
I think that Ruby, which roughly speaking sits somewhere between Python
and Perl, is closer to Python than Perl is.
I don't know much about Ruby, but it does not seem to be commonly used
for anything other than web-development. It may be that Ruby could be
used for other purposes, but I don't seem to see it happen much.

I know that PHP can used at the command line, and could be used for
the same sort of sys-admin tasks for which, Perl and Python are often
used, but I don't seem to see that happening either.

I'm not sure if Ruby, or PHP, are as general purpose as Perl or Python.

May 19 '07 #11

P: n/a
En Sat, 19 May 2007 03:24:15 -0300, walterbyrd <wa********@iname.com>
escribió:
My guess is that some of the C code used to develop Python is the same
between the different Python distros, but much of the code is unique
to the particular platform. If that is the case, then the C code may
not be very portable.
Well, your guess was wrong. The core CPython code is the same on all
platforms; of course it uses #define/#ifdef/etc. where appropiate, but
it's not a mess, and not so much code is conditionally compiled.
The Python developers take special care on portability - the C language
itself (C89 is currently used) is pretty standard, but you have to be
careful on how you write your code.
But, I can often take the same python code, and run it on MacOS,
Linux, FreeBSD, and Windows. Often I can do this even if the app has a
gui interface.
Because someone has taken out all the differences, so you don't have to
struggle with them yourself. GUI toolkits: some libraries "draw" the whole
thing and manage all the user interaction themselves so they're basically
portable but never have the native "look&feel" (tcl/tk); other rely on the
native buttons and controls for each platform, but providing a homogeneous
view for the programmer (wxWidgets). Anyway, they work across platforms
because "someone" has already worked on the differences for you - using C.
Both menctioned libraries are written in C (wx in C++), and Python
provides a convenient wrapper for them.
Even on the Python side, some libraries do one thing or another depending
on the platform (cf: subprocess). The good thing is that *you* as a
developer, don't have to worry about the differences; many are managed by
Python itself internally, and many are worked on by other people on top of
this. webbrowser.open('your favourite url') "just works" and does "the
right thing" because of these efforts.

--
Gabriel Genellina

May 19 '07 #12

P: n/a
walterbyrd wrote:
On May 18, 8:28 pm, Steve Holden <s...@holdenweb.comwrote:
>Surely the fact that Python is available on so many platforms implies
that C is a fairly portable language.

Unless it's the same C code, I don't see how that means anything. If I
write an app on Windows with C, and I rewrite the same app on UNIX
with C - that doesn't mean the C code has been ported.

My guess is that some of the C code used to develop Python is the same
between the different Python distros, but much of the code is unique
to the particular platform. If that is the case, then the C code may
not be very portable.

But, I can often take the same python code, and run it on MacOS,
Linux, FreeBSD, and Windows. Often I can do this even if the app has a
gui interface.
Perhaps you could try a more constructive approach in future.

The reason you can do this with Python is precisely because the
developers have ironed out the wrinkles between platforms by putting the
requisite conditionals in the C source. Which, by the way, is open in
case you ever feel like answering your own questions.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
------------------ Asciimercial ---------------------
Get on the web: Blog, lens and tag your way to fame!!
holdenweb.blogspot.com squidoo.com/pythonology
tagged items: del.icio.us/steve.holden/python
All these services currently offer free registration!
-------------- Thank You for Reading ----------------

May 19 '07 #13

P: n/a
walterbyrd <wa********@iname.comwrote:
On May 18, 10:24 pm, a...@mac.com (Alex Martelli) wrote:

I think that Ruby, which roughly speaking sits somewhere between Python
and Perl, is closer to Python than Perl is.

I don't know much about Ruby, but it does not seem to be commonly used
for anything other than web-development. It may be that Ruby could be
used for other purposes, but I don't seem to see it happen much.

I know that PHP can used at the command line, and could be used for
the same sort of sys-admin tasks for which, Perl and Python are often
used, but I don't seem to see that happening either.

I'm not sure if Ruby, or PHP, are as general purpose as Perl or Python.
PHP was definitely born _for_ webpages; Ruby wasn't, just like Perl or
Python weren't, it just became very popular for webpages when Rails
appeared.

so i tried search queries for [ intitle:X intitle:Y ] where X is each of
various languages and Y one of two words connected with non-web
traditional application programming, and these are the number of hits I
saw:

Y==scientific:
perl 334
python 703
ruby 452
php 423
java 2370
c++ 3340
fortran 3200

Y==payroll:
perl 81
python 1
ruby 8
php 176
java 382
c++ 101
fortran 1

From these numbers it would seem that Ruby (and PHP) aren't really more
web-specific than Perl (and Python).

In general, these days, when you're interested in how popular each of a
certain set of technologies / subjects is, search engines can come in
handy (with due precautions, of course: for example, "php" appears in SO
many web pages (2.5 billion, vs e.g. 282 million for java) that you need
to restrict it cleverly (e.g., I used the intitle: attribute -- that
gives 20.1 million for php vs 21.4 million for Java, and biases numbers
towards pages that in some sense are "about" that technology rather than
just happening to mention it as an aside, a part of an URL, etc:-). "c"
is very hard to search for because many occurrences of that single
letter have nothing to do with the language (here you may try quoted
sentences such as "c programming": without precautions, "c" has 2.86
billion hits, but "c programming" 1.22 million vs 1.09 million for "java
programming", which again puts things in better perspective). I say
"technology" because this doesn't apply to just programming languages:
e.g., "COM", a classic Microsoft technology for component
interconnection, is swamped by the homonimous occurrence of ".com" in
URLs, so you need the intitle: trick or something like that.

An interesting alternative would be to use search engines which do
semantic annotation, but I'm not very familiar with those, myself; I'd
be interested in details if anybody does try that.

Anyway, if you're interested in popularity issues, I believe these
techniques, for all their defects, will work better than asking a few
people or trying to generalize from unsystematic observations.
Alex
May 19 '07 #14

P: n/a
On May 19, 7:23 am, Steve Holden <s...@holdenweb.comwrote:
The reason you can do this with Python is precisely because the
developers have ironed out the wrinkles between platforms by putting the
requisite conditionals in the C source.
But that is my point. With Python, the language itself takes care of
the platform differences, so the same Python code will run on
different platforms. I realize that, at a lower level, everything is
done is C. But, from the developers point of view: developing code in
C requires more attention to platform specifics, than does developing
code in Python.

May 19 '07 #15

P: n/a
On May 19, 9:36 am, a...@mac.com (Alex Martelli) wrote:
>
From these numbers it would seem that Ruby (and PHP) aren't really more
web-specific than Perl (and Python).
Excellent find, nice work. However, if it is found that there are "X"
many PHP programs running payroll applications, does that mean that
those PHP programs are *not* web applications? I don't think that it
does.

I was surprised to see Ruby in the same catagory as Perl and Python,
when it came to Scientific apps. I always thought of Ruby as being
used for database oriented web-based stuff. Just goes to show what I
don't know.

I can tell you this much for sure: when it comes to UNIX system
scripting, Perl is the leader, with Python as a solid second. Unless,
maybe, you count bash & bourne, which I don't because those are not
multi-purpose languages.

May 19 '07 #16

P: n/a
walterbyrd wrote:
On May 19, 7:23 am, Steve Holden <s...@holdenweb.comwrote:
>The reason you can do this with Python is precisely because the
developers have ironed out the wrinkles between platforms by putting the
requisite conditionals in the C source.

But that is my point. With Python, the language itself takes care of
the platform differences, so the same Python code will run on
different platforms. I realize that, at a lower level, everything is
done is C. But, from the developers point of view: developing code in
C requires more attention to platform specifics, than does developing
code in Python.
That I can agree with, but it isn't the same as "not portable". It
would have been better to say "more difficult to port".

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
------------------ Asciimercial ---------------------
Get on the web: Blog, lens and tag your way to fame!!
holdenweb.blogspot.com squidoo.com/pythonology
tagged items: del.icio.us/steve.holden/python
All these services currently offer free registration!
-------------- Thank You for Reading ----------------

May 19 '07 #17

P: n/a
On Fri, 2007-05-18 at 22:28 -0400, Steve Holden wrote:
Surely the fact that Python is available on so many platforms implies
that C is a fairly portable language. I realise that you have to take
platform specifics into account much more than you do in Python, but I
do feel you are being somewhat unfair to C.
This is now going off-topic. Cross-platform code is a matter of mindset
and toolset. It's very possible to write python code that is *not*
cross-platform compatible. Perhaps it relies a specific behavioral
quirk of the platform. Or maybe it uses modules that only exist on a
platform. For example, you can do very low-level COM or even Active X
programming using python. That certainly wouldn't run on Linux. The
same can be true of some python code that's only intended to run on
Posix systems. You may have assumed a certain directory character
separator, for example (of course the os module can give you a portable
way of not making this assumption).

I write cross-platform C code all the time. I do it by carefully
choosing my libraries (toolset) and then try to code making as few
assumptions as possible. Platform-specific code is generally less than
6% of the total code. I even wrote a cross-platform python module in C.
It's no big deal. Recently I wrote a medium-sized C++ application using
Qt. The platform-specific code (basically a few minor things Qt doesn't
do for me) is 10 lines total, out of many thousands of lines of code.
The apps compiles and runs on Linux, OS X, and Windows. I plan to write
the next version in Python, but I'm still not sure what GUI toolkit to
use. wxWidgets just doesn't sit well with me, Qt's licensing doesn't
fit my client (I can't afford the non-GPL version), and GTK isn't there
on OS X.

Python, like C, can be used easily to make cross-platform programs.
Python makes it even easier than C because the entire standard python
library of modules is available on every platform, so you don't have to
rely on as many third-party abstraction libraries for threads, sockets,
etc. I think the original poster will find Python, and may wxPython,
satisfies the bulk of his development needs.
>
I'm just learning Python. FWIW: my opinions about Python:
[ ... ]

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
------------------ Asciimercial ---------------------
Get on the web: Blog, lens and tag your way to fame!!
holdenweb.blogspot.com squidoo.com/pythonology
tagged items: del.icio.us/steve.holden/python
All these services currently offer free registration!
-------------- Thank You for Reading ----------------
May 19 '07 #18

P: n/a
Michael Torrie wrote:
I think the original poster will find Python, and may wxPython,
satisfies the bulk of his development needs.
True, I like how Python is a general language that can be used for many
different purposes and hope to learn wxPython as well. I have read
through the archives and found some good suggestions for books/tutorials.

--
Your friend,
Scott

Sent to you from a 100% Linux computer using Kubuntu Version 7.04
(Feisty Fawn)
May 19 '07 #19

P: n/a
>But that is my point. With Python, the language itself takes care of
>the platform differences, so the same Python code will run on
different platforms. I realize that, at a lower level, everything is
done is C. But, from the developers point of view: developing code in
C requires more attention to platform specifics, than does developing
code in Python.
That I can agree with, but it isn't the same as "not portable". It
would have been better to say "more difficult to port".
Indeed, there are significant chunks (several hundred lines of code)
that are specific to Microsoft Windows; also, there are some modules
(e.g. nis, passwd) which solely run on Unix systems. This code is
inherently unportable. In some cases, there is alternative code for
other platforms, in some cases, there isn't.

In Python itself, the fraction of platform-specific code is still
small (I think - one would have to count to be sure). This is partly
due to Python only using file and network IO from the system, and
these two system-dependent aspects have fairly standard APIs
even on the C level (POSIX in particular).

GUI is much harder - in Tk, the amount of system-specific code is
significant (ca. 80 kLOC specific to either Unix, Windows, or Mac,
compared to 240 kLOC total, for Tk 8.4.7). Fortunately, Python
abstains from implementing its own cross-platform GUI library,
and offloads that burden to third-party libraries.

Regards,
Martin
May 20 '07 #20

P: n/a
PHP was definitely born _for_ webpages; Ruby wasn't, just like Perl or
Python weren't, it just became very popular for webpages when Rails
appeared.
In this kind of discussion, I get always reminded that Perl stands
for "Practical Extraction and Report Language". So Perl _clearly_
is for generating reports :-)

FWIW, I think the main purpose of Python is to do testing on distributed
operating systems :-)

Regards,
Martin
May 20 '07 #21

P: n/a
walterbyrd a écrit :
On May 18, 10:24 pm, a...@mac.com (Alex Martelli) wrote:

>>I think that Ruby, which roughly speaking sits somewhere between Python
and Perl, is closer to Python than Perl is.


I don't know much about Ruby, but it does not seem to be commonly used
for anything other than web-development. It may be that Ruby could be
used for other purposes, but I don't seem to see it happen much.
Ruby is probably far better than Python at sys-admin tasks. And, while
recently made much more visible because of the hype around Rails, it's
definitively not specialized in web development.
I know that PHP can used at the command line, and could be used for
the same sort of sys-admin tasks for which, Perl and Python are often
used, but I don't seem to see that happening either.

I'm not sure if Ruby, or PHP, are as general purpose as Perl or Python.
Perl is not what I'd call a "general purpose" language. It has been
explicitly designed as a sys-admin tool. PHP is of course not a general
purpose language - the only serious reason to use PHP is that it's
widely available on cheap web-hosting. Python and Ruby are general
purpose languages - they have been designed to help writing
applications, whatever the domain and the UI.
May 20 '07 #22

P: n/a
In article <46**********************@news.free.fr>,
Bruno Desthuilliers <bd*****************@free.quelquepart.frwrote:
May 21 '07 #23

P: n/a
Python is a strongly typed but dynamic language ...

In the "A few questions" thread, John Nagle's summary of Python begins
"Python is a byte-code interpreted untyped procedural dynamic
language with implicit declaration. "

Is Python strongly typed or untyped?

May 21 '07 #24

P: n/a
On May 20, 5:02 pm, Bruno Desthuilliers
>Ruby is probably far better than Python at sys-admin tasks.
Why, pray tell? I don't know much about Ruby, but I know that Python
is the language that Gentoo uses for package management, which
certainly qualifies as a sys-admin task.

May 21 '07 #25

P: n/a
On 2007-05-21, us******@yahoo.com <us******@yahoo.comwrote:
>Python is a strongly typed but dynamic language ...

In the "A few questions" thread, John Nagle's summary of Python
begins "Python is a byte-code interpreted untyped procedural
dynamic language with implicit declaration. "

Is Python strongly typed or untyped?
It's strongly typed (only a handful of type conversions are
automatic), and dynamically typed (no type declarations for
identifiers are needed, types are checked at run time, not
compile time).

--
Neil Cerutti
The doctors X-rayed my head and found nothing. --Dizzy Dean
May 21 '07 #26

P: n/a
In <11**********************@y18g2000prd.googlegroups .com>,
us******@yahoo.com wrote:
>Python is a strongly typed but dynamic language ...

In the "A few questions" thread, John Nagle's summary of Python begins
"Python is a byte-code interpreted untyped procedural dynamic
language with implicit declaration. "

Is Python strongly typed or untyped?
Strongly typed.

Ciao,
Marc 'BlackJack' Rintsch

May 21 '07 #27

P: n/a
On Mon, 2007-05-21 at 16:00 +0200, Marc 'BlackJack' Rintsch wrote:
In <11**********************@y18g2000prd.googlegroups .com>,
us******@yahoo.com wrote:
Python is a strongly typed but dynamic language ...
In the "A few questions" thread, John Nagle's summary of Python begins
"Python is a byte-code interpreted untyped procedural dynamic
language with implicit declaration. "

Is Python strongly typed or untyped?

Strongly typed.
Most people think of statically typed, like Java, when they think of
"Strongly typed."

Python is strongly, dynamically typed. Some people refer to Python as
"duck typed" meaning that python cares more about what the object
appears to be, rather than it's actual type. If it looks like a duck,
quacks like a duck, it must be a duck. Thus python is more concerned
with the protocol of an object than the actual type. This is a powerful
concept. I've also found, though, that duck-typing can be a real
weakness when you're working with a complicated third-party library with
weak documentation. You can't always infer what the method call is
expecting, even if you have the source code in front of you. Figuring
out the python twisted I/O library, is fraught with such challenges,
despite the documentation.
>
Ciao,
Marc 'BlackJack' Rintsch
May 21 '07 #28

This discussion thread is closed

Replies have been disabled for this discussion.