Slashdot Mirror


Ask Guido van Rossum

This week's interview is with Guido van Rossum, a man who, as they say, needs no introduction. (Not around here, at least.) To learn a bit more about him, check his personal page. You might want to ask him about Python 2.1, which was released today. One question per person, please. We'll send 10 of the highest-moderated ones to Guido about 24 hours after this post went up, and will run his answers as soon as he gets them back to us.

202 comments

  1. Re:Language Specification by Anonymous Coward · · Score: 1

    Please mod this down. It's a fair question, but it's kind of uninformed. It certainly doesn't pertain specifically to Python.

    (First of all, Python doesn't have ++ and -- operators.)

    Even C goes through revisions. Some C programs that work on more recent C compilers won't work under older ones.

    Any language newer than C is likely to have this problem, because computing (let's face it) is exploding. The number of standard libraries people want is always increasing. Java definitely has this problem. Just one call to a v1.3 API prevents your program from running in a v1.2 JRE. Likewise, Perl has new language features and libraries with each release. And so on.

    Either you accept change, and you get all the benefits of progress; or you standardize on one Final version, and you get the benefit of language stability. Most people prefer for Python (and Perl; and Java; etc.) to keep improving. Go figure.

    For your Debian box at home, I recommend upgrading to (at least) Python 2.0.

    -- jason

  2. Favourite Python sketch? by abischof · · Score: 5

    Considering that you named the language after the comedy troupe, what's your favourite Monty Python sketch? Personally, my favourite is the lecture on sheep aircraft, but I suppose that's a discussion for another time ;).

    Alex Bischoff
    ---

    --

    Alex Bischoff
    HTML/CSS coder for hire

    1. Re:Favourite Python sketch? by e-Motion · · Score: 1

      Most importantly, as a Monty Python fan, how do you feel about the treatment of fellow programmer Jared Blanks?

  3. Re:Python 3000 by cduffy · · Score: 2
    I've got to disagree with you wrt the C API -- I find it quite pleasent (and though I haven't worked with TCL, I do have prior experience with the C APIs of Perl and, to a limited extend, Scheme). Threading, on the other hand, is a real issue (has Stackless Python resolved it?) and I'm as interested as you to find out when it'll be fixed in the official Python implementation.

    Of course, there's also JPython, which has fantastic integration between Java and Python code, and resolves the threading thing... so if yer extending Java code, it's really a no-brainer (IMHO).

  4. Re:Performance by Ian+Bicking · · Score: 2
    Forget that other guy -- of course Python is interpreted, just like everything else: it all comes down to machine code, which the CPU interprets.

    There has been efforts, most notably the (currently inactive, I believe) static typing SIG, which would make it possible to make code that could be efficiently translated to machine code (also known as "compiling"). Static typing is by no means required to translate to machine code, but it would probably make that faster.

    An interesting option might be something like Squeak did, with a subset of the language that can be efficiently translated into C (and then compiled). This is something like what the static type SIG was aproaching -- not quite Python, but something that could run in the conventional CPython interpreter, wouldn't necessarily require any knowledge of C or assembly, but could run fast.

    Of course, it is also possible to simply compile Python into system code just as it is (well, if someone wrote the compiler). There is nothing that makes Python inherently interpreted. The problem, however, would be in the efficiency of that code. A naive attempt to do this would probably be slower than CPython. OTOH, compilers for Scheme (which have many similar issues as Python) have produced very fast code (on par with C). In particular, Stalin is very fast (though there are others which are very fast as well) -- sometimes faster than C. Python doesn't have any of the huge flaws that languages like, say, Tcl have in this regard. Some operations are difficult in compiled environments -- like getattr or eval -- but they could still be possible, or they could be left out (since much code doesn't use them). OTOH, all the best Python code uses them.

  5. Re:does Python need a CPAN? by Ian+Bicking · · Score: 2
    There has already been work towards this, particularly in the last few months.

    distutils fulfills some of the functionality required for a Python CPAN. I think it has reached a state of relative maturity -- it may be asked to do more later, but it does what it needs to well right now.

    There has also been some discussion and implementation of methods to describe and upload modules, which would probably be included in distutils or something related when they mature. I think at that point, along with a little infrastructure on the web, Python will have its own little CPAN. I know CPAN does more than this, but not all that much more, and it's something that should be grown into.

    I couldn't find what I was really looking for on the subject, but maybe this thread would be a starting place. There's more stuff elsewhere as well. This message (from that thread) gives a nice overview of what's necessary for CPAN, I think. And I guess the whole discussion starts here.

  6. Do you believe in Object Oriented Programming? by defile · · Score: 2

    Almost every modern high-level application language today supports, and perhaps forces the Object Oriented Paradigm (OOP). Students are encouraged to define and use objects whenever possible. Python's standard library seems nothing but objects. Java is the same. Newer technologies, like SOAP/Microsoft .Net/blahh are the apex of this concept.

    When I refer to the OOP, I mean the drive to decompose all programming into components, not necessarily the individual concept of having classes with methods and constructors and context-sensitive results, etc

    Application developers accept the OOP as the only way and consider those who refuse it to be uncivilized coder barbarians. Clearly, one can only bring sanity to programming via the OOP. But what is it really bringing?

    Most of the ideas that the OOP promotes are good programming practice anyway. That is absolutely not what I hate about the OOP.

    In the very ideal cases, you can create a reusable object/module that other people can enjoy. This is very rare, though. UNIX is a good example of an easy to use interface that allows for massive code reuse. The Win32 API, while affording code reuse, has a miserable interface that makes Windows programming a chore.

    Without going into a huge tirade; Modularity on that level is good. It's worth it to struggle with the interface, because the alternative is 100 man-years worth of functionality that you need to implement. On a much reduced level, trying to deal with the OOP just doesn't seem worth it.

    The problem with the OOP is that it encourages all code to be tiny little modules with it's own unique domain, which helps complicate the code both visually and in terms of execution.

    For every beautifully designed reusable component, you have a thousand more that are confined to a single project and do nothing but add complexity and visual noise to an otherwise simple idea.

    The Objects Everywhere philosophy seems to promote complexity, rather than simplicity. The less code, the easier it is to understand, the better off it'll be. Python does achieve many of these goals, but I can't understand why the push to OO'ize it all.

    Bad programmers can write bad code no matter what, and there's a vast army of bad programmers out there, but I'm not sure I've ever seen good code that employs the Objects Everywhere ideal.

    Does this make sense? What are your thoughts?

  7. He didn't. by Alan+Daniels · · Score: 1

    Don't know where you got this, but he didn't start with Pascal. Pascal is *very* type-strict, but Python doesn't even require you to explicitly declare variables! He started off with ABC, a small language he had designed earlier for the purpose of teaching beginners how to program (similar to BASIC in that sense). That is essentially why Python uses indentation to denote block rather than begin's, end's or braces, and why statements end with a newline rather than a semicolon: Sensible and intuitive to a beginner, especially since it promotes good coding style (or enforces it, depending on your point of view), but a little odd for a programmer already fluent in languages such as C, Awk, Perl, etc.

    Python is my favorite language, btw.

  8. Re:Performance by diaphanous · · Score: 1

    Actually neither type inference or static typing is required for a compiled implementation of a language. Common Lisp requires neither, though you can declare type information for greater efficiency. Instead of variables having an intrinsic static type, values have a type, and variables can refer to any kind of value. Typically the type of the value is encoded in the reference to it. So you might use the top three bits of a word to encode the type and the lower 29 to be a pointer to the value. Explicit declared typing information does help the compiler though- you can sometimes double the performance of a compiled Common Lisp program by using type declarations.

  9. Re:Indentation? by Jason+Earl · · Score: 2

    Good programmers indent nested blocks, but that's just to make the code easier to read. The parser doesn't care.

    That's really the beautty of Python's whitespace blocks. Both the programmer and the parser are looking at the same cues for block nesting. I am sure you have debugged C code that was missing a brace (or worse that had one misplaced) but was still indented "correctly." Your mind thinks that everything is hunky dory because the code "looks" right. This doesn't happen very often if you are a skilled C coder (with an intelligent text editor), but it does happen. And it happens a lot with newbie programmers. I was teaching my little brother Perl at one point, and he had all sorts of trouble with braces. However, when we switched to Python there was no longer any need for him to think about which braces matched up. I didn't believe that Python's significant whitespace was a good idea either, at first, but I am a believer now.

    Oh yeah, and since the Vim % command (jump to matching bracket) doesn't work with Python code, do you know of a macro to replace it?

    I am not a vi user, so I can't help you there.

  10. Incompability w/ GNU GPL: Any chance to resolve it by juhtolv · · Score: 1

    It is well known fact, that the latest versions of
    Python has licence, that is incompatible
    with GNU GPL. I know that RMS himself has tried to
    negotiate to rectify that problem. But what is
    current situtation? Do you see any chance to resolve the problem? How likely is it, that the
    problem will be resolved?

    --
    Juhapekka "naula" Tolvanen - http://iki.fi/juhtolv
  11. garbage collection and Python by Panix · · Score: 1
    Guido,

    I am a long time Python developer and fanatic. I have long enjoyed using python because of its Object Oriented nature and its faster and more open development process than its main competitors.

    While I believe Python is a great language, there is one thing that I really am missing from Python. Currently, Python uses a very antiquated reference counting method that is less than ideal. Are there any plans to re-implement the garbage collection mechanism for Python in the future? May I suggest using the more advanced generational methods of garbage collection?

    Good work so far, and thanks for all you have done!

    Jonathan LaCour

    Developer, Student

  12. standard packages and organization by Panix · · Score: 1

    Guido,

    Python is great, and I use it all the time, but I have an annoyance that I would love to see corrected.

    Currently, Python's standard modules provide much functionality, but are a mish-mash of submitted modules that are largely uncategorized. Java provides a much better organization and naming scheme that could be carried over to Python.

    For example, when importing the Python HTTP modules (httplib), currently, I do one of the following:

    import httplib
    from httplib import *

    Java has a categorization structure imposed to make things a bit clearer. I would prefer if this same kind of structure was imposed in python. So, the above would then become something like one of the following:

    import python.net.http
    from python.net.http import *

    I think that this could really enforce a cleaner organization and make it easier to identify where modules belong, and what they do, just by looking at their organizational location.

    What do you think? =)

    Jonathan LaCour
    Developer, Student

  13. Other languages by NewWazoo · · Score: 2

    What other languages do you use? Why do you use them? Are any of them better than python? When can I expect Parrot to be released? ;-)

    TheNewWazoo

    1. Re:Other languages by mixmasta · · Score: 1

      Python has become my favorite language but one thing I miss from my Java work is the hierarchical class library. For instance networking classes are in .net, gui in .awt, etc.

      Any chance the flat module list will be sorted some time in the future? It is growing and becoming harder to read. Thanks

      --
      #6495ED - cornflower blue
  14. Python directions by getafix · · Score: 1

    Would you hold up the rewriting of python to use a stackless implementation because Jython or other implementations will not be able to implement it? Where is the line between pushing python forward, and holding it back so that it works nicely with everything else ?

    Thanks for a great language.

    1. Re:Python directions by jonathan_ingram · · Score: 1

      See the website for Stackless Python to see what you've been missing. It's not an official project, but looks to be fairly well advanced.

    2. Re:Python directions by brunson · · Score: 1
      You seem to start at the premise that a stackless implementation is better than a stack based one and that Python *wants* to move in that direction. Stackless implementations are usually faster, but you lose ease of recursion and reentrancy. This is the first I've heard of Python going stackless, have I missed something?

      When governments fear the people there is liberty.

      --
      09F911029D74E35BD84156C5635688C0
      Jesus loves you, I think you suck
  15. Re:Data Structures Library by AMK · · Score: 2

    Queues can be done using Python lists; linked lists could be done using tuples or lists. AVL trees and B-trees are available in persistent forms (through the BerkeleyDB library, for example), and there's a BTrees package inside the ZODB. PEP 218 proposes a built-in type for sets, but there doesn't seem to be much agreement on what people want from a set type. Some people want fast intersection operations and some don't care; some want; some people want an O(1) membership test and some people don't care; it seems difficult to write a set type that's equally speedy for all possible applications.

  16. Re:Garbage Collection by AMK · · Score: 2

    Note that Python 2.0 included a cycle-detection algorithm, so reference cycles do get cleaned up now. See the Modules/gcmodule.c file in the Python source distribution, and the GC module docs.

  17. Stackless Python? by Tumbleweed · · Score: 4

    Do you have any plans to merge Stackless Python with Python? If yes, when? If not, why not?

    1. Re:Stackless Python? by segmond · · Score: 2

      I dobut he will, stackless is amazing, but I dobut it, I mean, there are many python implementations with many nifty things, how about Jpython? When does it stop? But I sure look forward to it tho, as far as it doesn't bloat it. :)~~

      --
      ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
  18. Re:Komodo by crisco · · Score: 2

    Since the original question referenced VB and Kylix I'm assuming the poster wants a 'GUI builder' type of IDE. I believe the most common Python approach to GUI widgets is through Tk. In that case the question might be, are there any Tk GUI builders that handle Python. I don't know the answer, I'll leave the searching as a reader exercise. There are a couple of basic IDEs for Python, the Windows version even comes with the install. These are about on par with Komodo, faster but with different features.

    Chris Cothrun
    Curator of Chaos

    --

    Bleh!

  19. Re:Indentation? by andrew+cooke · · Score: 1

    Incidentally, Haskell can also use indentation to indicate structure.

    --
    http://www.acooke.org
  20. Re:Ruby by Luke · · Score: 1

    I was asking about Guido's thoughts.

    I've already downloaded the source and compiled it on Cygwin. Flawless and easy install.

  21. Re:Ruby by Luke · · Score: 1

    Where do you think I got the source?

    It wasn't from your particular link, however, but I thank you for your gracious help.

  22. Ruby by Luke · · Score: 5

    Thoughts on Ruby?

  23. Getting your company to use Python vs. ... by buffy · · Score: 1

    Given Python's more limited exposure to the commoners, I've had varying amounts of success getting companies that I've worked for to actively use Python. Those that I have convinced, have grown to love it, and all is good with the world.

    What are the five most compelling arguments that _you'd_ offer to a company doing web development, system administration, etc... to use Python over other interpreted languages such as Perl, TCL, etc...

    Thanks!

  24. Emacs, Python, and Tabs by Anonymous+Coed · · Score: 1
    b) If you move control blocks horizontally (e.g. after removing a preceeding conditional), your editor (EMACS with python-mode for me) may introduce subtle errors when re-tabbing.

    Nah. Not if you have emacs configured correctly. Unfortunately I'm in Windows right now (long story) so I can't refer to my own Emacs settings. If you have a non-ancient version of Python mode, Emacs actually handles the Python whitespace rather well.

    And make sure when you move a block horizontally you make the block the emacs region then hit (I think) Ctrl-C then < or >. It's also on the Python mode menu.

    One good tip for maintaining sanity in a professional Python dev shop is to have EVERYONE USE TABS, always, all the time. One tab character == 1 Python indentation level. Then each person can set their tabs to 4 or 8 or whatever space for visual display, and everyones happy. Just make sure peoples editors are set to keep those as tabs and not convert back to spaces. If you set up Emacs properly (very easy) then this becomes a no-brainer. Hitting Tab on a line should (almost always) produce the right indentatin for a given context.

    Mixing up 4-spaces-as-indentation and tabs in a single file is a recipie for disaster (subtle bugs.) Aside from these issues, I actually like Pythons use of whitespace. I find it easier for long term maintainability not to mention the initial conceptualization / prototyping.

    Email me if you need those .emacs settings to work with Python and tabs properly.


    ---

  25. Thoughts on US vs Europe? by hanwen · · Score: 1
    I noticed that you left our beloved country and went to the US.

    I was wondering: why did you do it? How do The Netherlands (or Europe for that matter) and the US compare? Don't you miss the good bakeries, cannabis and licquorice? Do you experience Americans as being shallow (I've heard that comment more than once)? Or is this just a case of "Cherchez la femme?"

    That's a lot questions together, but I'm not so much interested in specific answers. I'd like to hear your general experience of US vs. Europe.

    --

    Han-Wen Nienhuys -- LilyPond

  26. microthreads, stackless python by XNormal · · Score: 2

    Is there any chance that stackless and microthreads might be integrated into the main python distribution?

    -

    --
    Stop worrying about the risks of nuclear power and start worrying about the risks of not using nuclear power.
  27. Why is Python not whitespace-ignorant? by dido · · Score: 1

    In my opinion, one of the most awful features of Python as a language is the fact that it thinks of whitespace as a highly significant feature in programs, so much so that you always have to properly indent all blocks of code that are under a particular control structure (such as if statements or for loops), instead of having a 'begin'-'end' token pair to do the job, such as what we have in C, Perl, Java, Pascal, and almost every other block structured programming language I know about. It takes away the programmer's freedom to style his or her code, forcing them to conform to somebody's idea about how programs ought to visually look like. I've heard of "bondage and discipline" languages, but this is arch-B&D... not even Pascal is so anal!

    --
    Qu'on me donne six lignes écrites de la main du plus honnête homme, j'y trouverai de quoi le faire pendre.
    1. Re:Why is Python not whitespace-ignorant? by Valdrax · · Score: 2

      There have been a few other posts about this. See my earlier response to another post about that here.

      I'll answer your post with a question. Why should a programmer be free to style their code anyway they want?

      The point of a programming language is to communicate instructions to a computer in human-readable format. I still maintain that people who complain about being forced to write readable code are the ones who write the most unreadable code. TMTOWDTI, Perl's motto, is the main reason that when the first Obfuscated Perl Code contest was announced, many Slashdotter's joked that it was redundant. Consistent style is a necessity for maintainability. It helps to allow others (and maybe yourself a year later) to understand what you were doing when you wrote a piece of code.

      Honestly, if you think everyone should be able to write code in whatever style they see fit, you've never worked on a large project before. Languages with more freedom just force people to place other personal standards on how their code must be formatted within their project or lose readability of code as multiple programmer styles conflict. Python forces a consistent standard across all development, making it an great relief to maintain.


      --
      If it's for-profit but free, you're not the customer -- you're the product (e.g., the Slashdot Beta's "audience").
  28. Conflict with GPL by MAXOMENOS · · Score: 5
    The Free Software foundation mentions the license that comes with Python versions 1.6b1 and later as being incompatible with the GPL. In particular they have this to say about it:

    This is a free software license but is incompatible with the GNU GPL. The primary incompatibility is that this Python license is governed by the laws of the "State" of Virginia in the USA, and the GPL does not permit this.

    So, my question is a two parter:

    1. What was your motivation for saying that Python's license is governed by the laws of Virginia?
    2. Is it possible that a future Python license could be GPL-compatible again?


    ObJectBridge (GPL'd Java ODMG) needs volunteers.
    1. Re:Conflict with GPL by maw · · Score: 2

      It was Guido's former employer, CNRI, which caused the license to be covered under the laws of Virginia. As Guido was working for CNRI, CNRI holds the rights for a significant portion of Python. If and when there is no longer any CNRI code in Python, most likely the license will be changed to something less GPL unfriendly.
      --

      --
      You're a suburbanite.
    2. Re:Conflict with GPL by segmond · · Score: 2

      Does the license matter? It is not like your source code or bytecode is subjected to the license. I say, if you are so GPL nuts, let the free software foundation write their own implementation.

      --
      ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
    3. Re:Conflict with GPL by jameson · · Score: 1

      But one of Python's features is that you can use it as an embedded scripting language. However, 1.6.0 and 2.*, not being compatible with the GPL, can't be used for embedding on GPL projects, so people will have to continue using 1.5.2.

    4. Re:Conflict with GPL by bobv-pillars-net · · Score: 1

      I've lived in Virginia for twelve years and to date nobody has offered to me a reasonable explanation of the difference between a state and a commonwealth, apart from the spelling.

      --
      The Web is like Usenet, but
      the elephants are untrained.
    5. Re:Conflict with GPL by gunga · · Score: 1

      You don't have to be "GPL nuts" to find this question interesting

      Considering that Python's license is almost GPL-compatible, it would be interesting to know the reason why they chosed not to take the final step toward a fully GPL compatible license

      I think there are to many license in open-source and free software. I'm sure there are situation when neither the GPL nor the BSD licences are good choices, but then you've got to make the reasons clear. You're not talking to lawyers but to hackers most of the time

    6. Re:Conflict with GPL by Spooge+Demon · · Score: 2
      Technically Virginia is a Commonwealth, not a State (nor "State" for that matter).

      --

  29. Re:Python 3000 by Xar · · Score: 1

    Python can spawn multiple threads, yes; but Python can only interpret bytecodes in one thread at a time. What does this mean? Well, your C extension can go about its merry way in its own thread, but the moment you are back in Python-land everyone is competing for the one and only interpreter thread. As I said in my initial post, it's a workaround. It is well known that Python does not completely and properly support threads, as Tcl (and many other script languages) does. Guido has said this is a deficiency in the current C implementation and will be addressed in the future.

  30. Re:Python 3000 by Xar · · Score: 1

    Perhaps I could sum up the C API aspect of my question as follows:

    JPython rocks. Working with JPython in Java rocks. When, oh when, will the C implementation of Python compare favorably to the Java version?

    None of you who have worked with both C and Java Python can tell me that there is any comparison at the API level. JPython rocks all over CPython in that regard.

  31. Re:Python 3000 by Xar · · Score: 1

    The Python interpreter is NOT multithreaded. The interpreter can manage, and spawn, threads, but when interpreting the Python P-code itself there is one and only one thread. A "global interpreter lock" is not multithreading; it's a kludge. Guido has said as much in the past, and hinted that this would be addressed in Python 3000.

    Reading the Zope list, and searching the archives, you will see Python's poor threading support bemoaned repeatedly as a roadblock to scaling a single Zope process on multi-processor systems.

  32. Python 3000 by Xar · · Score: 5

    It's been a while since I've seen any mention of Python 3000--aside from the recent April Fools joke, that is. I love Python as a language, and use it both professionally and personally. But, Python's current implementation is lacking; the interpreter is not multi-threaded, causing large Python applications (such as Zope) to implement various workarounds that only partly address the problem; and the C API is rather...unpleasant. Working with the Tcl C API in an embedding situation is much, much better, IMO. Will Python 3000 address any of these concerns? Any information on a timeline, or current status?

    1. Re:Python 3000 by segmond · · Score: 2

      From someone who has used the Python C API, I have to disagree with you, in no way do I find it unpleasant, it is so easy to work with, compare it to Perl C extension API, I haven't played with TCL C API, but you might be comparing apple and oranges, as we know tcl and python are on two different levels. A comparasion with Perl and Ruby will be more appopriate.

      --
      ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
    2. Re:Python 3000 by smallpaul · · Score: 1

      This post is factually incorrect. The Python interpreter is multithreaded. It does not have "free threading" but it does hae threads.

      The C API is actually a joy to work with compared to Perl or Java. TCL is a very simple language with very simple data types (i.e. no built-in ojbects) and that makes it's embedding API very simple. Python's C API is pretty damn nice for such a relatively sophisticated language.

      Python is not going to be rewritten from scratch. Guido has stated that this isn't a goal anymore. Various bits like the API and the threading may get better over time incrementally if people with the right interest pitch in.

  33. Why do you care so much for GPL compatibility? by Carl · · Score: 1

    It seems that you are personally involved in getting the new Python license GPL compatible so that Python can be mixed with code released under the GPL.

    The Apache people seem to have given up on ever getting their license compatible with the GPL since it seems to much work to get the language about the trademarked words right. So they just accept that people writing GPLed software can never use code distributed under the Apache license. It does not seem to hurt the Apache project to much.

    Why do you care so much about Python being GPL compatible? And what work should still be done?

    I loved the original CWI license by the way, it was short and to the point. Is there any way to get that back as standard license? And is was GPL compatible as a nice bonus.

  34. How will nested scopes affect performance? by MSG · · Score: 2

    First, I feel obligated to state that I think Python is totally tits. I love it. Thank you.

    Reading "What's New in Python 2.1", I'm curious about nested scopes. Given that name lookup has always been the cause of poor performance in Python (or so I've heard), it would initially seem that introducing nested scopes would further reduce the speed at which Python scripts run if you use this feature.

    Is there any information available about Python's performance with this addition?

  35. Structured Design. by Xerithane · · Score: 5
    First off, as a disclaimer I have never actually written anything in Python. But, I have read up on virtually all the introduction articles and tutorials so I have a grasp on syntax and structure.

    I have been doing C development for 9 years now, and I know a plethora of other languages including shell scripting, perl, PHP (for scripts). Now, each language uses 'normal' grouping for control structures (if, for, etc).

    What was the logic behind creating a whitespace-based syntax rule? And why do you feel it is good, please refrain from the readability answer because that is all I get from those people I know who know Python.

    I find, because of my background, it is much easier to read code that uses braces ({}) than whitespace because my mind automatically looks for them. After maintaining legacy code that extends a life span of 20 years from it's first line of code, I have some concerns about the longevity of any Python code. So, my second question is, how well do you see Python holding up for 20 years and why do you think it will hold up that long?

    Thanks.

    --
    Dacels Jewelers can't be trusted.
    1. Re:Structured Design. by NMerriam · · Score: 2

      What was the logic behind creating a whitespace-based syntax rule? And why do you feel it is good, please refrain from the readability answer because that is all I get from those people I know who know Python.

      Well, that's the answer, i'm not sure why it isn't acceptable. One of the main stated goals with Python is that they didn't want a language that had completely different formatting depending on who wrote it, so they made formatting part of the language. This makes it much easier for non-programmers (like me) and beginning programmers to pick it up.

      I find, because of my background, it is much easier to read code that uses braces

      but someone with no programming backgound wouldn't have that bias, so if you're inventing a new language, why feel hindered by older syntactic conventions?

      ---------------------------------------------

      --
      Recursive: Adj. See Recursive.
    2. Re:Structured Design. by jekk · · Score: 1
      Well, here's MY attempt to defend the whitespace-based syntax.

      Would you allow a junior programmer joining your team to write code like this?

      int someFunc(int x) {
      if( x < MIN_VALUE ) {
      return x;}
      else { int i, v, new_x=0; for( i=0; i<x; i++ ) {
      &n bsp;v = process(i);
      new_x += v;
      }
      return new_x;}
      }

      I certainly wouldn't. In c (or c++, or java, or whatever language that snippet was written in), whitespace is significant, but it is significant ONLY to the human reading the code, not to the compiler.

      If I could, I'd ask the compiler (or the source-code-control checkin program) to require that the indentation match the braces. That would prevent stupid stuff like the above, and also prevent the more insidious errors like this:

      int someFunc(int x) {
      if( x < MIN_VALUE ) {
      re turn x;
      } else {
      in t i, v, new_x=0;
      fo r( i=0; i<x; i++ )
      &n bsp;v = process(i);
      &n bsp;new_x += v;
      re turn new_x;
      }
      }
      where my failure to use {} around the for() clause has created an error (ie, new_x += v should be inside the loop, and you can TELL that from the indentation).

      So in python, you get exactly this feature. The language verifies that the ACTUAL block structure of the compiled code equals the INTENDED block structure as indicated by the programmer:

      def someFunc(int x):
      if x < MIN_VALUE:
      re turn x
      else:
      ne w_x=0
      i= 0
      wh ile i < x:
      &n bsp;v = process(i)
      &n bsp;new_x += v
      re turn new_x

      In my opinion, the python code will hold up BETTER than over long life spans than c-style code, at least if you consider only the effects of whitespace-based block structure. I say this because the use of indentation to indicate block structure is older and more widespread than the use of braces for that purpose -- compare Algol, Lisp, APL, and nearly everything else except early (column-sensitive) Fortran and assembler.

      Of course you ALSO said that you liked having the braces, because it makes it easier for you to read. Fortunately, braces ARE allowed in python! The following example demonstrates their use. ;-)

      def someFunc(int x): #{
      if x < MIN_VALUE: #{
      re turn x
      #}
      else: #{
      ne w_x=0
      i= 0
      wh ile i < x: #{
      &n bsp;v = process(i)
      &n bsp;new_x += v
      #}
      re turn new_x
      #}
      #}

      -- Michael Chermside

    3. Re:Structured Design. by ChadN · · Score: 2

      There is a tool (whose name I've forgotton, unfortunately), that adds #{ and #} to python files as block delimiters (consider it as optional bracket syntax).

      The tool can convert back and forth to allow for use in indentation hostile environments. :) Can anyone give the name of the tool I'm thinking of?

      --
      "It's overkill, of course. But you can never have too much overkill." - Anonymous Slashdot Coward
    4. Re:Structured Design. by jonathan_ingram · · Score: 1

      Almost everyone that writes in languages such as C indents their code to reflect the structure of the code -- this means that information about the structure is in 2 different places -- the code itself, and the indentation. When they get out of whack, the compiler looks at the code, and the human looks at the indentation. Python removes this problem by caring *only* about indentation.

      You might mutter a while about whitespace the first few times you write a Python program, particularly if you've come from a C or Perl background. It's when you come back to a Python program 6 months later, and find that you can still understand it perfectly, that you realise the benefits of the stylistic sanity Python enforces.

      Perl might be trying to be more like a natural language -- but natural languages are not natural for algorithmic specification.

    5. Re:Structured Design. by ianezz · · Score: 1
      At least with /Perl/PHP/Java/Pascal*shudder*/Fortran you can run it through a formatter to get good formatted code

      That's the point: since formatting has an effective impact on the interpretation of the code, coders are forced to Do It Right(TM), in a way that satisfies both the interpreter and an human eye. It's sad to enforce good habits, but unfortunately there are several coders out there not even knowing what the word "indent" means at all (not to mention the religion wars on where opening braces should be put - on the same line of the conditional/loop/declaration? On a line on themselves? Furtherly indented or not?).

      Starting from this point, writing a reindenter for Python is not much harder than writing one for every other language.

      I really see two main issues here:

      • printings on paper may be less readable (think of a piece of source spawing on several sheets: it's easier to measure indentation or to search for a closing mark? I don't know).
      • tab stops: in the *NIX world, tab stops are placed every 8 characters. End of discussion. In the Windows world (and perhaps others) there is the bad habit of "tab stop width of the day" (but it undoubtly IS a bad habit, since it makes sources unreadable for people not having the same settings on the editor - unless they are passed by a reindenter). Unfortunately, there is no way to enforce this (and perhaps this will cause some headaches to coders when hunting down the problem described in the last bug report...)
    6. Re:Structured Design. by ianezz · · Score: 1
      Now - find an algorithm to indent that.

      If Python can parse it nonambiguosly, even a reindenter can do it (even if this means that the reindenter will have to know a lot more of Python's semantics as a C/C++/Java reindenter has to know), so it is definitively possible.

      who says that his indentation style is 100% right

      AFAIK, a block may start when the last nonblank character on a line is a ":", and a block (or more) ends at the first nonempty line which is less indented than the first line of the block. Python probably remembers the indentation of each opening line in a block, so it is able to deduce how many nested blocks it has to close. Simple and straight. So there isn't really a style issue here, since the only rule is "indent blocks", and the only pourpouse a Python reindenter will accomplish would be changing the number of spaces used for indentation (i.e. from 8 to 4 or vice-versa), and the nice side effect is that the indentation always reflects the block structure (which is not necessarily true in C, C++, Java and other languages - having been mantaining several thousands of LOC written in these languages for years I can say that it's a PITA).

      Of course, if you use an editor like Emacs with python-mode, editing Python sources requires no care at all.

      BTW: if you use 2 spaces to indent because you have a lot of nested blocks, your code is probably broken or redundant and you should split it in simplier pieces.

    7. Re:Structured Design. by Valdrax · · Score: 2

      I will admit that that method, dating back to Ada, Pascal, and the venerable ALGOL, does have its merits for long pieces of code. Typically, it enforces spacing as well, since single-line statements just don't look right in this style of language or may be against the grammar.

      I like Python's style and I like the ALGOL-derived style as well.

      --
      If it's for-profit but free, you're not the customer -- you're the product (e.g., the Slashdot Beta's "audience").
    8. Re:Structured Design. by Valdrax · · Score: 5

      What was the logic behind creating a whitespace-based syntax rule? And why do you feel it is good, please refrain from the readability answer because that is all I get from those people I know who know Python.

      I fail to see why there would be any other reason. Furthermore, I fail to see why there should even need to be a better reason. Why do you have whitespace at all? There are only 2 real answers: easy parser writing and human readability.

      Python's style makes it easy to see blocks of logic. It also forces you to think about how your code is organized by exposing these blocks to you at all times. Braces, parentheses, brackets, etc. are easy to lose track of in complex single-line statements. You have to spend too much time thinking about whether or not you've got your puncuation matched up properly. Python eliminates this confusion by exposing logical blocks. Besides, properly formatted and readable C code should already be spaced out like a Python program. Python just eliminates the redundant punctuation.

      Typically, the people who complain the loudest about enforcing spacing in syntax are the same people who write those tangled, dense, single-line statements in C and Perl that inspired their respected obfuscated code contests. You don't need the ability to cram 5 lines of Python in 1 line of Perl. It just hurts maintainability, and there's really no compelling argument for keeping source code dense and compact anymore if it doesn't add speed and remove bloat. (Forgive me if I have unfairly tarred you with this brush, but this has been my general experience.)

      (In response to another post:)
      Also, I've never seen a source-control system mess with the spacing of a file before. That's just odd. Be consistent with using either spaces OR tabs and your Python code will be much easier to store. I'm not saying it doesn't happen. I'm just saying that bugs in certain tools that weren't written with Python in mind shouldn't be a black mark against the whole language.

      --
      If it's for-profit but free, you're not the customer -- you're the product (e.g., the Slashdot Beta's "audience").
    9. Re:Structured Design. by Malcontent · · Score: 2

      I prefer the (new) php style of using keywords instead of spaces or brackets. I find it easier to keep track of multiple levels of indentation.
      Example:
      if ($foo):
      while ($fee):
      buncha code
      endwhile;
      endif;

      If the buncha code fills up your screen it's easy to grok what's going on at the end of control structures. For every control structure php provides a keyword for the end.

      --

      War is necrophilia.

    10. Re:Structured Design. by Malcontent · · Score: 2

      "Wow. Imagine a Beowulf Cluster of morons."

      Oh man I can't resists...

      Microsoft
      Where I work
      Slashdot
      United States of America
      Washington DC

      --

      War is necrophilia.

    11. Re:Structured Design. by kubalaa · · Score: 1

      I'm looking to learn python but the whitespace-only is a big turn off. How, for example, do you do the equivalent of jumping to balanced brackets in vi? What if you want to indent code for readability without it meaning something to the parser? What if you want to split a statement onto multiple lines for readability?

      --

      "If you look 'round the table and can't tell who the sucker is, it's you." -- Quiz Show

    12. Re:Structured Design. by jameson · · Score: 1

      There are two problems related to this, though:

      a) If you generate the code, you will always have to keep track of your blanks.
      While this certainly is good practice for debugability, it's not pleasant as a requirement.

      b) If you move control blocks horizontally (e.g. after removing a preceeding conditional), your editor (EMACS with python-mode for me) may introduce subtle errors when re-tabbing.

      Sure, I'd write my code with similar indentation if it wasn't enforced anyway, but I prefer not being forced to do things unless really neccessary.

    13. Re:Structured Design. by smallpaul · · Score: 1

      This argument for python white-spacing could also be applied to any/all of the languages that required statments to begin at a certain column. We all know how productive that requirement was.

      Your argument is silly for two reasons. First, the column-oriented languages were designed to make life easier for the computer, not for the human.

      Second, actual programmers used those languages and hated the column-orientedness. Tens or hundreds of thousands of Python programmers use Python and like the whitespace rules. It is only people who haven't used it (like the original poster) who complain that it has theoretical problems.

      It is extremely annoying to have people who haven't tried it claim that it can't work (even though it demonstrably does) because it is vaguely reminicient of other languages where a totally different feature did NOT work.

    14. Re:Structured Design. by milesegan · · Score: 1
      Typically, the people who complain the loudest about enforcing spacing in syntax are the same people who write those tangled, dense, single-line statements in C and Perl that inspired their respected obfuscated code contests. You don't need the ability to cram 5 lines of Python in 1 line of Perl. It just hurts maintainability, and there's really no compelling argument for keeping source code dense and compact anymore if it doesn't add speed and remove bloat. (Forgive me if I have unfairly tarred you with this brush, but this has been my general experience.)

      It's also a hassle if you're dynamically generating and evaluating code, which is a very, very handy technique in some situations. It's also a problem when you're cutting and pasting code from a newsgroup or email into an editor. It's ALSO a problem if you have several people editing the same source files with different tab settings in their editors. I can't tell you how many times I've broken a script because I've made a quick hotfix with a handy editor that didn't indent the code with the RIGHT whitespace.

      I used to think that python's use of whitespace for syntactic grouping was one of it's strengths, but, over the last three years, I've slowly started to see it as one of it's greatest weaknesses. At least the weird scoping is going to be fixed soon!

    15. Re:Structured Design. by Abreu · · Score: 1
      What if you want to indent code for readability without it meaning something to the parser? What if you want to split a statement onto multiple lines for readability?

      Easy, just use the escape character (\)

      Please RTFM and try writing something simple in Python before disqualifing it.

      I assure you will be hooked by the time you finish.

      ------
      C'mon, flame me!

      --
      No sig for the moment.
    16. Re:Structured Design. by CoreyG · · Score: 1

      This argument for python white-spacing could also be applied to any/all of the languages that required statments to begin at a certain column. We all know how productive that requirement was.

      I think that is where a majority of the criticism lies. Why should I be forced to seperate my code like that? Is it intuitively obvious to a reader that whitespace denotes scope context? Crazy requirements like this manifest themselves in other places, make files being a prime example. (It's whitespace, why does the make file require tabs?)

    17. Re:Structured Design. by smittyoneeach · · Score: 1
      Minimalism?

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    18. Re:Structured Design. by sam_penrose · · Score: 1

      Your objection is that you find it harder to read without the braces, so others who find it easier to read without the braces should not talk about readability? Hhmm...

    19. Re:Structured Design. by crealf · · Score: 1
      But, it goes into the whole thing of: If the whitespace goes, the code is useless. Yes. If you use crappy tools you're in big trouble. I have a solution: type the same code twice in two different editors, two different OS, two different tools, on two different computer. Do you find this too much a burden? Python programmers find too much a burden typing { } or begin/end again, and again, and again, and again, and again, and again, and again, ... ad nauseam ; just in case someone, somewhere, might be uninformed enough to start using defective tools without a backup or a test.

      I agree with you, how when you check in it should check the indentation.. or compile, whenever - and warn (not error, it isnt.) that your indentation sucks.

      Badly indented Python code has 99% chances to fail on parsing, with a SyntaxError.

      I'd love to see something like: Warning: hello.c, line 81: Your code is structured like a monkey wrote it. Please learn how to indent.

      There are the options '-t' and '-tt':
      -t : issue warnings about inconsistent tab usage (-tt: issue errors)

    20. Re:Structured Design. by crealf · · Score: 1
      The reason why it is not fully acceptable, and satisfies my curiosity into the language is that after working on projects where code is passed around many different systems and version control, etc often times formatting gets botched. It happens, a lot.

      The only problem is probably MS Visual Tools (and some other Windows editors) using Tab=4 spaces. Configure them to be 8, or to use only spaces. If you don't, mixing MSTools and (X)Emacs would be quite annoying anyway.

      Can you point out another tool than an editor, that willingly would modify spacing ? It would mess multi-lines strings really bad.

      The closest thing that I can think of is it's a design flaw.

      It's a choice. Guido choosed to offer the Python programmers a clearer syntax, at the expense of people using broken tools.

      Besides if you really want block based local parsing, use "pyident.py" or one of the other simple easy solutions.

    21. Re:Structured Design. by crealf · · Score: 1
      May not be the 70's anymore, but even with backups accidents do happen. I am not saying it ever would happen, I'm just saying it seems silly to actually have a language where destroying all whitespace would destroy the code.

      If you alter the source code, then it can be unusable. An accident that would only happen to change whitespace magically? This fear is referred as the "Alien whitespace eating nanovirus" in the Python community. The answer is that Pythoneers are so brave they don't fear this Damocles sword, and still go on using Python. Praise them!

  36. Why such weak lambdas? by nosferatu-man · · Score: 1

    Why include a lambda form at all in it's current, useless, state? Was some Schemer holding a gun to your head, or what?

    Oh, and many many thanks for a beautiful language.

    (jfb)

    --
    To spur "enterprise Linux," Big Bang, the distributed two-phase commit.
  37. Re:Jython by nosferatu-man · · Score: 1

    More to the point, it's the primary reason (at least as far as I can discern) for not including the beautiful stackless patches into the core distro. Which is a shame, as Stackless Python is a thing of beauty.

    Peace,
    (jfb)

    --
    To spur "enterprise Linux," Big Bang, the distributed two-phase commit.
  38. Re:Python's 2 biggest shortfalls by nosferatu-man · · Score: 1

    It's a feature of some object-oriented-scheme-like languages (Dylan, ScriptX), that might be expressed in Python.

    Let's not forget the language that made multiple dispatch popular (for certain values of popular): Common Lisp. CLOS is still the best expression of multiple dispatch around (although Dylan sure is nifty.)

    Peace,
    (jfb)
    --
    To spur "enterprise Linux," Big Bang, the distributed two-phase commit.
  39. Re:Language Specification by Grey · · Score: 1

    Note Exactely python now has ++, --, etc. how every they are a new feature, (1.6 or 2.0) thus older python implemenations don't have them. as a side now python is quite downward compatable I think it is almost 100% between 1.5.2 and 2.1 and not much is going to change between 2.1 and 2.2 which is much better than say JAVA 1.0 and 1.1, or even java 1.1beta3 and 1.1

    --
    Grey (Chris Lusena)
  40. GUI? Tkinter? by Lumpish+Scholar · · Score: 3

    (It has to be asked every once in a while.)

    Any movement away from Tkinter, and toward something else, as the pretty-much-standard programming interface for graphical user interfaces?

    Any movement towards a Tk library that *doesn't* use Tcl?

    --
    Stupid job ads, weird spam, occasional insight at
  41. Scare Quotes by Nightpaw · · Score: 1

    (nor "State" for that matter)

    Good call.

  42. Hi, I've never heard of you by Migrant+Programmer · · Score: 1

    Do *you* think you need an introduction?

  43. Re:Performance by nd · · Score: 1

    I don't think that's feasible due to the runtime nature of Python. It would almost certainly require a type of "engine" to handle these features (think about all the cool things you can do with classes that aren't possible in C++), which isn't much better than byte code.

  44. Legacy vs. Ease and Cleanliness by JohnZed · · Score: 2

    Programmers frequently praise Python for its generally clean syntax, its ease of use (as in CP4E), and its "Batteries Included" philosophy. As a PyUser myself, I have to agree that these are fantastic features.
    I'm interested, though, in the conflict between library design and legacy habits. Would you suggest that C-isms like "popen2", "execlp", "sys.argv", and "socket(AF_INET, SOCK_STREAM)" really belong in a "clean" language in the long run?
    Is there any chance that we'll someday see a standard library extension that (much like Java's libraries) allows developer to program in English rather than UNIXglish?
    Thanks!
    --JRZ

  45. Re:Performance by listen · · Score: 1

    In order to do this, you would need
    either some pretty amazing type inference, or variables with declared static typing. There is some work on this (Types-SIG). The main change would be that you can't change the type of a var at runtime, eg
    a = "Popsicle"
    a = len(a)

    would be disallowed, as a would be presumed to only hold strings. This doesn't happen too much anyway, as it is confusing..

  46. Ruby by jilles · · Score: 2

    I've recently come across Ruby and I must say that at first site it has all the features (after all it was inspired by python) that made python a success and some more. What are your impressions of this language and would you be willing to give up python for it or some other language?

    --

    Jilles
  47. Python and UML by Rocky+Mudbutt · · Score: 2

    I have seen a couple of Java based Unified Modeling Language tools but no Python support or implementation. It would seem natural to develop in python based on UML, so this must be a large gap in the python suite. What do you think of designing with UML and implementing in python?

    Thorn is an opensource UML editor written in Java with JPython scripting but no python code generation.

    ArgoUML is an opensource UML editor written in Java with no current python code generation

    --
    Ethics II Axiom 2. "Man thinks." B. Spinoza
  48. macro viruses by Dr.+Tom · · Score: 2

    i notice that the release of 2.1 isn't signed or even checksummed. what will you do in the future to ensure that mirror sites don't supply versions infected with macro viruses or changes to the core? nobody has time to audit a 4 meg download, and everybody runs "configure" right away (downloading an executable and running it -- idiotic, eh?).

  49. Re:Data Structures Library by churchr · · Score: 1

    What kind of data structures do you want? Python has integrated support for dynamic arrays and dictionaries. You can get matrices and some other data structures as part of the mathematics extensions.

  50. Re:Python and Tabs by rhaig · · Score: 1

    def perm(l): # Compute the list of all permutations of l if len(l) <= 1: return [l] r = [] for i in range(len(l)): s = l[:i] + l[i+1:] p = perm(s) for x in p: r.append(l[i:i+1] + x) return r

    If that had been perl and the newlines had been squashed, it would be much easier to decipher, and it would actually run as is.

    --
    "We are not tolerant people. We prefer drastically effective solutions"
  51. Blind people? by rhaig · · Score: 2

    I have some friends that are extremely talented programmers that find python very difficult to use because it relies on whitespace for code block delineation. They're blind. With that in mind, is it still a great idea to use whitespace (not braces) just so the code will all look alike?

    --
    "We are not tolerant people. We prefer drastically effective solutions"
  52. Re:does Python need a CPAN? by pthisis · · Score: 1
    They're working on it. Python 2.1 includes module metadata, which is a first step toward creating an automated CPAN-style module repository.

    Sumner

    --
    rage, rage against the dying of the light
  53. Re:Komodo by Pengo · · Score: 2

    Have you actually used Komodo?

    even compared to Visual Basic it really sucks... like.. REALLY sucks. I would be embarrased to ship a program built with that IDE builder.


    --------------------
    Would you like a Python based alternative to PHP/ASP/JSP?

  54. Python IDE by Pengo · · Score: 3

    Do you know if there are any projects on it's way to compete with Kylx or Visual Basic based on Python.


    --------------------
    Would you like a Python based alternative to PHP/ASP/JSP?

  55. Performance by debrain · · Score: 4

    Is it possible to make Python as fast as C/C++? In particular, is there a way to compile Python into system code (as opposed to byte code)? If there isn't, will there ever be?

    1. Re:Performance by segmond · · Score: 2

      No, Python is interpreted, it is a tradeoff, the speed you get from python is in terms of development, for very large projects you might see one line of python code for ten lines of C code or one line of python code for 5-7 lines of C++ code. Take your pick. Nevertheless, Python has an API that allows you to invoke functions written in C and C++. As programmers, you know the 80/20 rule, 20% of your program takes 80% of the time, you can code that 20% in C/C++, and the rest in python, then with the API call that 20%, thus saving incredible time in development.

      --
      ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
    2. Re:Performance by StandardDeviant · · Score: 1

      It's an interpreter-based language. You can tweak all you want but there is a finite limit to how fast it will ever be. In any case for most of the problems it is meant to solve it is fast enough (i.e. you'll need C (or Fortran) extensions to do fast numerical code, like if you have a 512K by 512K matrix to do a transform on, and this has been done with NumPython; you'd probably never write a device driver in Python; but for writing a network client or GUI it's plenty fast (eons of time are spent waiting for a byte from the wire or an action from the user)). These same factors apply to Perl/Java/etc. just as much.


      --
      News for geeks in Austin: www.geekaustin.org
  56. Re:Python and Tabs by jonathan_ingram · · Score: 1
    Note that you don't have to use tabs... as long as the columns match up, you can use as many spaces as you want. Here's an exaple from the Python language documentation that demonstrates this:

    def perm(l): # Compute the list of all permutations of l if len(l) <= 1: return [l] r = [] for i in range(len(l)): s = l[:i] + l[i+1:] p = perm(s) for x in p: r.append(l[i:i+1] + x) return r

    See the Python documentation for more information.

  57. Re:Python and Tabs by jonathan_ingram · · Score: 1
    Note that you don't have to use tabs... as long as the columns match up, you can use as many spaces as you want.

    See the Python documentation for more information.

  58. Re:Python and Tabs by jonathan_ingram · · Score: 1

    Very true. I guess Python and Slashdot don't mix. Interestingly, I'm fairly sure I didn't post this -- I previewed, not submitted. Oh well, that's what I get for following instructions... (and why doesn't Slashdot let you use the PRE tag, anyhow?).

  59. Re:self by Patrick+Lewis · · Score: 1

    I'm may be replying to a troll, but you don't have to use self. You can use this, s, or thisfoolreferencethaticanneverremenberthenameof. self is merely a convention. If you don't like it, don't use it.

    --
    "If I am such a genius, how come that I am drunk and lost in the desert with a bullet in my ass?" --Otto (Malcom ITM)
  60. Thoughts about REBOL? by netless · · Score: 1

    especially new REBOL/View.

  61. Re:Indentation? by Mickut · · Score: 1
    I didn't know one a few minutes ago, but here's something that might do the trick: http://kuntsi.com/hacks/python_percent.vim (Could't post the code, got hit by lameness filter)

    Feel free to make it better.

  62. Re:Did you approve of the Parrot joke? by cmg · · Score: 1

    I really hope this is a joke.

    Lots of language names have been jokes or plain silly. C C++ C# Java

  63. Implementing Everything in Python by jfunk · · Score: 2

    I recently started using Python and I now use it for everything, including an interactive shell. Thanks.

    One thing I see in Python-land is that there is a tendency to implement everything in Python. I just submitted a design for a program that I want to write in Python and I used Sketch for diagrams, despite having CorelDraw for Linux right here. It seems that no Python programmer is happy with having a component written in another language. Many other languages don't interoperate as well as in Python but those programmers seem happy with mixing Perl and C, for example. Look at Zope. It has it's own web server. I know it's faster, but why do you think this is happening with Python specifically?

  64. Strangest use of Python by Salamander · · Score: 5

    What use of Python have you found that surprised you the most, that gave you the strongest "I can't believe they did that" reaction?

    --
    Slashdot - News for Herds. Stuff that Splatters.
  65. Re:efficient compilation and standardization by segmond · · Score: 2

    I personally believe that Python bytecode is very efficent, take the case of Java bytecode, it is just as efficent, to over optimize it will put very serious constraints on what python does and can do, it is a simple tradeoff, the speed in python all lies in RAD.

    --
    ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
  66. Re:Data Structures Library by segmond · · Score: 2

    You have all the data structures you need, perhaps your skills are lacking. A list is already given with you, with that list you can implement a stack, queue, etc using the existing methods! A dictionary is given to you, with which you can implement a set/hashtables, the only thing that isn't native is trees, which is very easy. What I will like to see tho, is a Collections framework just as in Java, that would be cool.

    --
    ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
  67. Re:[j | c]Python by segmond · · Score: 2

    I think it is very wonderful, I can't stop talking about JPython, the best of both worlds, mixing python and java, coding with pythons wonderful fun interpretter environment, and getting to use stable java libraries. Saves so much time with the java compile cycle, yet, you can write your java servlet or a swing application in python. Guido probably doesn't care, his work is python, but this shows java's potential.

    --
    ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
  68. self by segmond · · Score: 2

    The most annoying thing in python for me, is when walking with classes, and having to reference all local variables and method with the self class. self.It self.gets self.annoying self.and self.I self.believe self.it self.reduces self.readability. As you can see, lots of "selfs" over your screen is annoying, I know that there is a hack out there to remedy that, but is there any immediate plan to fix that in the future?

    --
    ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
  69. wxPython by segmond · · Score: 3

    Is there any plan to adopt wxPython (www.wxpython.org) as the GUI standard? The Tk interface looks butt ugly, and I am sure you have heard that many times, what do you see as the advantages and disadvatages for using wxPython over Tinker?

    --
    ------ Curiosity killed the cat. {satisfaction brought it back | it didn't die ignorant | lack of it is killing mankind
  70. Remapping % in Vim by khslinky · · Score: 1

    You should be able to remap any key in command mode with 'map'.
    For example:
    map % dd
    would make it so that typing % in command mode deleted the current line. You can get just about any sequence of keys that you want in there in place of 'dd'. You can even put in control characters by typing ^V before them (where ^V is actually control-V):
    map % ihello there you^V
    would show up in your .vimrc as
    map % ihello there you^]
    and would change the % so that it entered insert mode, printed "hello there you" and escaped back to command mode.

    1. Re:Remapping % in Vim by khslinky · · Score: 1

      Oops. Should be an escape after the ^V.

    2. Re:Remapping % in Vim by fm6 · · Score: 2
      Brilliant! Use map to call a macro! Never would have occurred to me!

      Now all I need is a macro to actually do the function I described! That's the easy part, of course!

      __

  71. Jython and Serious Tool Support by nawkboy · · Score: 1

    I am interested in using the approach of prototyping in Jython and then extending performance bottle necks in Java. The problem with this approach appears to be that when moving to Jython I loose so much of the tool support available in Java. What advanced toolset support is available for a Jython/Java combination that integrates into a nice cohesive environment without sacrificing too much functionality in one language or the other? Areas of interest include UML, editing coupled with UML (think TogetherJ), solid graphical debugger that can walk though Jython/Java combinations (preferably remote as well as local), build system(ant?/make?), unit test frameworks (can xUnit be made to easily cross Jython/Java boundaries?) and application servers. The jython web site list different tools available but fails to provide much guidance as to which tool combinations work well together.

  72. Re:Language Specification by steve9000 · · Score: 1



    Python has no ++ nor -- operators.

    v2.0 introduced +=, *= et al for conciseness
    and optimisation.

    Guido has publicly stated that ++ and -- won't
    go into python.

    Stephen.

  73. Every language needs a CPAN. by Malcontent · · Score: 2

    This is the greatest contribution of the perl community. A true example of code re-use.

    --

    War is necrophilia.

  74. Practical Vs. Ideal by xeer0 · · Score: 1

    Is there anything in Python that you would like to fix, but for whatever reason you can't (i.e. it would break to much existing code, everybody else hates it or it's just not 'right')? If so what is it and why can't it be fixed?

    (BTW, I'm not saying anything is wrong, just curious...)

    --
    "Hey... don't be mean." --Buckaroo Banzai
  75. [j | c]Python by seanw · · Score: 5


    How do you see the relationship between jPython (the java implementation) and standard cPython (the original C language version) evolving? And do you see the advantages of either one (i.e. portability vs. speed) becoming especially pronounced in light of the recent trend toward distributed software (ala the MS .NET initiative)?

    sean

  76. Question by NullGrey · · Score: 1

    Hey, could we get an interview with Neal Stephenson?

    --
    +-- (Score:-1, Moderator on Power Trip)
  77. Licensing issues by jameson · · Score: 1

    What is being done to resolve the current licensing dispute between the FSF and CRNI?

  78. Re:Python by questionlp · · Score: 1

    Does anyone know the speed of the unladen African Python?

  79. Re:Language Specification by smallpaul · · Score: 1

    There are two different issues here. One is standardization. The other is change.

    Standardized languages change. In fact, during the standardization period that they probably change more than unstandardized languages. After standardization they still change, just more slowly. For instance "C" has recently undergone a revision. If you depend on new features from a new C compiler, your code won't work with older ones. C'est la vie.

  80. Static typing by Peter+Eckersley · · Score: 2
    Python is a really snazzy language, but one limitation to its flexibility is the absence of static typing.

    It seems that (optional) static types would enable the creation of practical python compilers, and could also provide much more in the way of pre-execution error detection.

    I've heard rumours that static typing might be in the pipeline for Python. Is there any truth to these rumours, and if so, how might they be implemented?

  81. Why "None"? by po_boy · · Score: 3
    First, thanks for Python!

    I have long wondered why the value None in python is named "None". It's pretty common in other languages to call that thing (or something very similar) "NULL". Were you trying to differentiate None and NULL in some way, or do you just like the way "None" sounds as you read code?

    1. Re:Why "None"? by Phredward · · Score: 1
      While I too wonder what Guido's motivations are, I'd say the answer to this question is probably, "it's a different type". None is usually one possible value of an option, where NULL refers to a null pointer (or possibly the value of a variable of type void, tho technically, i think, there is none).

      For example, in SML (because I know it). an int option would have the possible values of NONE, or SOME (any int here).

      and int ref (which is more or less a pointer to an int) would have possible values of (any int here) ref. NULL would be equivelent to an int ref option of value None. Whereas None is just, well, None.

  82. does Python need a CPAN? by po_boy · · Score: 5
    One of the reasons I still write some things in PERL is because I know that I can find and install about a zillion modules quickly and easily through the CPAN repository and CPAN module. I'm pretty sure that if Python had something similar, like the Vaults of Parnassus but more evolved that I would abandon PERL almost entirely.

    Do you see things in a similar way? If so, why has Python not evolved something similar or better, and what can I do to help it along in this realm?

  83. Politeness by eAndroid · · Score: 2

    I know first hand that you have an uncanny ability to remain calm and level-headed. I emailed you once a flame--it even contained several instances of "DIE"--that while done with some jest was quite insulting. Your reply was not only civil but combined with the fact that you even bothered to reply left me feeling quite embarassed (and rightly so).

    What is your secret for keeping your cool when discussions get heated, particularly when techies tend to be very loyal to their causes?

    --

    I can't spell or type, but that doesn't mean I'm unusually stupid.
  84. Honestly, now by Devil's+Avocado · · Score: 2

    Don't you ever get sick of talking about Python? Are there times when you just want to talk about your collection of scotch-tape dispensers or your love of shuffleboard? Do you feel sad that people pidgeonhole you as "Guido van Rossum, the Python guy" or "Guido van Rossum, the father of Python", when perhaps you'd prefer to be "Guido van Rossum, the ballet dancer" or "Guido van Rossum, the Buddhist monk"?

    In all seriosity (?) are there times when you overload on Python and just have to get away for a while?

    -DA

  85. Re:Perl? Bah! by Camel+Pilot · · Score: 1

    Or for converting all your Python scripts into Perl.

  86. where did you get those glasses? by JEDi_ERiAN · · Score: 1

    damn, these things rock. where'd you get em man?

    http://www.python.org/~guido/images/Guido@200dpi.j pg

    E.

    -

    --

    -
    This Post has been brought to you by the letter "E".
  87. Re:Development of Language Bindings by Danh · · Score: 1

    This review of Python IDEs by David Mertz is the most recent I know of.

  88. Development of Language Bindings by Rexifer · · Score: 4

    How closely does the primary Python development team interact with the other language binding efforts (mainly Jython)? Anyone who's hung out in Slashdot seems to have a rabid attachment towards their native tounge, so to speak, and I've found it refreshing that the Python community "plays nice". Is there a lot of cross-pollenation(sic) between the groups?

    Thanks.

  89. Video Interview by mccormi · · Score: 1

    For a video interview of Guido van Rossum at Python 9 check this out at Technetcast

  90. Garbage Collection by Fnordulicious · · Score: 1

    Is Python going to continue using a simple reference counter a la Perl, or will it be improved to use a more modern garbage collection system such as the venerable mark-sweep or even a generational system?

    I ask this because I'd like to see a real garbage collector in a scripting language. I was sorely disappointed when I found that Python was using basically the same crufty reference counting mechanism as employed in Perl, supposedly because it was 'fast and easy to implement'. But the deficiencies of reference counting collectors are well known, the most obvious being the incapability of a reference counting collector to deal with cyclic garbage.

    The main excuse for using a reference counter, particularly in a scripting or interactive language, is that it is a simple algorithm and is very fast in comparison to other collectors. However the cyclic garbage problem is a subtle and nonobvious source of leaks in programs, particularly ones which have a long life and relatively extensive creation/destruction cycles.

    A number of successful workarounds for handling cyclic garbage with reference counters have been proposed and implemented. One simple solution is to implement an 'ephemeral' collector in addition to the reference counter, one which uses a more complex algorithm such as mark-sweep, one able to handle cyclic references without problem. The collector is termed ephemeral because it operates only on regions of store which are not in current use, thus avoiding synchronization problems with actively mutating data.

    The following are references to papers by Paul Wilson of the University of Texas, Austin. He has written two important surveys of the fields of garbage collection and automatic storage allocation, two sides of the same coin of automated memory management. I would recommend that whoever is maintaining the collection mechanism of Python spend some quality time with both of these papers and then follow some of the bibliographic references to get an idea of more optimal solutions to the automatic memory management problem.

    ftp://ftp.cs.utexas.edu/pub/garbage/allocsurv.ps
    ftp://ftp.cs.utexas.edu/pub/garbage/bigsurv.ps

    Another good place for links on garbage collection is the somewhat imprecisely labeled section on Memory Management in the Open Directory Project, http://dmoz.org/Computers/Programming/Memory_Manag ement

  91. Metaobject Protocol? by Fnordulicious · · Score: 1

    Is Python ever going to include some form of metaobject protocol such as the MOP included in CLOS, the Common Lisp Object System?

    A MOP allows a programmer to fine tune the object system implementation, adjusting such things as inheritance systems (multiple vs single), instantiation mechanisms (and hooks), class inheritance list resolution, and other details of the OO system. It'd certainly be interesting to see another language implement a MOP, particularly one designed for OO from the start, as Python has been.

    The only major drawback to implementing a MOP is that the object system usually needs to have much of its internals carefully picked apart so that the ugly bits aren't accidentally accessible to the user, but the useful parts are.

    One reference for CLOS's MOP is the following URL:
    http://www.elwoodcorp.com/alu/mop/index.html

  92. Boa Constructor! by Choron · · Score: 1
    Somebody wrote about Komodo already, but there are more:

    - Boa Constructor, free, still in alpha but pretty neat.

    - BlackAdder, Commercial, still in beta.

    I've used Boa Constructor to build some prototypes, while I have a few crashes from time to time in frame design mode, it's great to build a quick GUI in no time. - Wing IDE , commercial.

    --
    "Naughty, naughty, naughty, you filthy old soomka !"
  93. Re:Data Structures Library by GrEp · · Score: 1

    Linked lists, queues, deques, priority queues, AVL trees, Red-Black trees, B-trees,graphs,sets,digraphs, and any other useful data structure that you would like encapsulated.

    bash-2.04$

    --

    bash-2.04$
    bash-2.04$yes "Don't you hate dialup connections?"| write USERNAME
  94. Re:Data Structures Library by GrEp · · Score: 2

    Python is about simplicity of expression. When doing advanced programming it is nice to have a large set of encapsulated data structures. After coding a data structure 5-6 times it ceases to be instructional.

    You can look up data structures anywhere, but developing clean algorithms takes "skills".

    bash-2.04$

    --

    bash-2.04$
    bash-2.04$yes "Don't you hate dialup connections?"| write USERNAME
  95. Data Structures Library by GrEp · · Score: 5

    I love python for making quick hacks, but the one thing that I haven't seen is a comprehensive data structures library. Is their one in development that you would like to comment about or point us to?

    bash-2.04$

    --

    bash-2.04$
    bash-2.04$yes "Don't you hate dialup connections?"| write USERNAME
  96. Python's 2 biggest shortfalls by brunson · · Score: 1
    First, let me say I am a huge Python fan and advocate. It is my language of choice and I use it to develop applications both at home and professionally. That said, I see two major weaknesses in Python. First, the lack of function overloading based on parameter signature is, in my opinion, a missing piece of functionality that would be a huge boon to Python's OOedness. Secondly, Python's thread support is almost worthless without a multi-threaded interpreter. Can you speak to when and if these two major shortfalls will be addressed? Oh, and just for the counters: Perl Sucks, Python Rules. :-)

    When governments fear the people there is liberty.

    --
    09F911029D74E35BD84156C5635688C0
    Jesus loves you, I think you suck
    1. Re:Python's 2 biggest shortfalls by SimHacker · · Score: 1
      But there is another technique similar to operator overloading called "multiple dispatch". It's a feature of some object-oriented-scheme-like languages (Dylan, ScriptX), that might be expressed in Python. But I don't know how useful it would really be, considering efficiency and how it would complicate the language, and there are many other ways to accomplish the same effect.

      "Multiple dispatch is one of the most powerful and elegant features of Dylan."

      It's been implemented in Perl.

      It might be implemented as a Python module, without sullying the language itself.

      Multiple Dispatch as Dispatch on Tuples

      Many popular object-oriented programming languages, such as C++, Smalltalk-80, Java, and Eiffel, do not support multiple dispatch. Yet without multiple dispatch, programmers find it difficult to express binary methods and design patterns such as the ``visitor'' pattern. We describe a new, simple, and orthogonal way to add multimethods to single-dispatch object-oriented languages, without affecting existing code. The new mechanism also clarifies many differences between single and multiple dispatch.

      Go to town!

      -Don

      --
      Take a look and feel free: http://www.PieMenu.com
  97. mod this up up up by vio · · Score: 1

    My issues are mainly with the lack of a good multi-threaded interpreter (damn global interpreter lock!!!). Unfortunately, it's my understanding that Guido & Co. don't really think much of threading to begin with...

  98. Re:State vs. Commonwealth by bobv-pillars-net · · Score: 1
    So I was right. No legal difference, only an historic one based on semantics.

    Thanks for the reference, tho...

    --
    The Web is like Usenet, but
    the elephants are untrained.
  99. Re:Python's Relation to Knuth's Conjecture by OmegaDan · · Score: 2

    I've actually written a porn bot in python/glade ... "beelzebot" ... :) Its an automated usenet porn downloader/decoder.

  100. Re:Python's Relation to Knuth's Conjecture by OmegaDan · · Score: 2

    When its done :)

  101. Seemless GUI please. by supersnail · · Score: 1
    There are currently a dozen or so GUI modules supported by Python on some or all platforms.

    Couldn't we just standardise on one and integrate it more fully into Python.

    The venerable TK is good but looks out of place in a Python program. QT is execellent but will they let you package it as an integral part of Python?

    I know this debate has been going on since python slithered out of its egg, but, I think the lack of integrated GUI is Pythons biggest (only?) drawback.

    --
    Old COBOL programmers never die. They just code in C.
  102. Re:Language Specification by patnotz · · Score: 1

    My mistake. I meant "+=", "-=" etc. operators. Sorry.

  103. Language Specification by patnotz · · Score: 3
    While I love many things about python, one thing bothers me. It seems that it's the interpreter that defines the language rather than a language defining how the interpreter should act. One example is the "++", "--" etc. operators and another is the functionality path module. I often write scripts with 2.0 at work only to find thy don't run on my Debian 2.2 system at home (stable Debian's python is 1.5.2).

    Are there any plans to set some kind of standard language specification that will hold for a while?

    1. Re:Language Specification by xehprom · · Score: 1

      I think there's a simple language specification, and that is to be backwards compatible. That simple. What works on Python 1.4 should work on 1.5.2 and will also work with 2.0.

    2. Re:Language Specification by shredwheat · · Score: 1

      If everyone isn't already confused enough. Let me counter with the truth..

      Python does __NOT__ have ++ or -- operators. They were proposed, but Guido frowns apon them, and it is unlikely they will ever appear.

  104. Fat snakes don't hunt by graybeard · · Score: 2

    I learned Python from the "Internet Programming" book, and I love the lean and mean Python. Because of the recent burst of development, it seems to me that lots of new features are being stuffed into the language. Is my perception correct? Is there a danger that Python will forfeit two of its best features, simplicity and cohesiveness, merely to appease a few complainers?

  105. Python GUI by Cowboy+Bill · · Score: 1

    I have experimented with jpython/Swing, Tkinter, java/Swing and Visual Basic. Due to some reason or the other I have always ended up using the last two options, though I always use python for all other command line programs. My dream application is a la java/Swing style Delphi + Python which ofcourse is as portable as any python program. Why is such a product not there in the market yet?

    --
    --> Your Wisecrack Here
    1. Re:Python GUI by ewestra · · Score: 1

      Have you tried wxPython?

  106. Python Bytecode interpreter by Cowboy+Bill · · Score: 1

    While distributing python programs, if python programs are compiled to PVM (like JVM), why do we need python installed to run the application? All we need should be a bytecode interpreter for that particular platform. Right?

    --
    --> Your Wisecrack Here
  107. Python's Relation to Knuth's Conjecture by matroid · · Score: 2

    In the upcoming volume IV of Knuth's TAOCP, Seminumerical Searches for Hoaring Triplets, he conjectures the following about the Theory of Programming Languages:

    Computers are ultimately a tool for their users. As such, modern programming languages should allow the users of these inherently unwieldy tools means of effective and efficient control. In volume 1 of TAOCP, we proved that all computer uses fall into one of two categories: searching for pr0n and viewing pr0n. Thus, any modern computer language should have as its core requirement the shortest semantic expressions for searching and viewing pr0n. (As usual, I will cheerfully pay $2.56 to the first finder of any pr0n that I have not already found).

    Along these lines, I pose the following questions:

    1. How effective is python at finding me pr0n?
    2. What is the shortest python program that you know of that will allow me to veiw such pr0n?
    3. Do you have any good pr0n?
    4. Of Donald Knuth?

    Thank you.

  108. What is *your* idea of Python and its future? by Scarblac · · Score: 5
    There are a lot of "golden Python rules" or whatever you would call them, like "explicit is better than implicit", "there should be only one way to do it", that sort of thing. As far as I know, those are from old posts to the mailing list, often by Tim Peters, and they've become The Law afterwards. In the great tradition of Usenet advocacy, people who suggest things that go against these rules are criticized. But looking at Python, I see a lot more pragmatism, not rigid rules. What do you think of those "golden rules" as they're written down?

    What's your idea of the future of Python? Since the PEP process, a lot of new feature ideas have been put forward, and a lot of people feel uncomfortable with quick change to a good language (Python 2.1 is again excellent though, congrats). Do you think or hope Python will be finished one day? If not, isn't the alternative an endless string of added features? "Python 3000" was an idea of a sort of ideal Python that would be worked on, but as I understand Python will now evolve more gradually.

    --
    I believe posters are recognized by their sig. So I made one.
    1. Re:What is *your* idea of Python and its future? by sam_penrose · · Score: 2
      Tim Peter's The Zen of Python, reads:

      Beautiful is better than ugly.
      Explicit is better than implicit.
      Simple is better than complex.
      Complex is better than complicated.
      Flat is better than nested.
      Sparse is better than dense.
      Readability counts.
      Special cases aren't special enough to break the rules.
      Although practicality beats purity.
      Errors should never pass silently.
      Unless explicitly silenced.
      In the face of ambiguity, refuse the temptation to guess.
      There should be one-- and preferably only one --obvious way to do it.
      Although that way may not be obvious at first unless you're Dutch.
      Now is better than never.
      Although never is often better than *right* now.
      If the implementation is hard to explain, it's a bad idea.
      If the implementation is easy to explain, it may be a good idea.
      Namespaces are one honking great idea -- let's do more of those!

  109. Jython by Scrymarch · · Score: 1
    FYI: JPython is now called Jython ... details at http://www.jython.org. The name changed for some painful license reasons, but it was very much a bloodless coup and much of the community seems to have moved over.

    Oh, and I believe Guido has actually taken JPython into account into the past, he's written at least one evangelical article describing it as a good match with Java.

  110. More follow up by Scrymarch · · Score: 1

    What's your favourite colour?

    1. Re:More follow up by Abreu · · Score: 1
      Blue!!
      NO! Red!!
      NO! AAAAAAHHHH!!!

      ------
      C'mon, flame me!

      --
      No sig for the moment.
  111. Re:Python by Goldberg's+Pants · · Score: 1
    20

    ---

  112. Re:Perl by Goldberg's+Pants · · Score: 1
    You might as well ask Mother Theresa what she thinks about Howard Stern.

    That's a great idea. Anyone got a ouija board handy?

    ---

  113. What is bad about python ? by gsf · · Score: 2
    Every language has good and bad points. The python documentation and website contains a lot of advocacy articles, which point to all the goot things (TM) in Python, but no mention of the bad points.

    What are the bad points in Python ?
    What kind (or size) of project should not be written in Python ?
    When should one use a different language ?

    Thanks.

  114. Which "perfect couple" (views on OCaml/Python)? by kalifa · · Score: 1

    In 1998, you had written an article titled "Java and Python: a perfect couple", in which you envisioned jpython as a killer development environment, arguing that the complementarity between a modern scripting language (Python) and a modern system language (Java) was a natural continuation of what had previously happened with the huge success of the C/sh couple under Unix and of the VB/C++ couple under Windows. The Java/Python couple would become the next "perfect couple", more modern, and multiplatform.

    It didn't happen. In part because Java still hasn't lived to its first expectations, and also because Python, although you still seem reluctant to admit it, is powerful enough to replace/rival with Java in many areas.

    Still, the modern/multiplatform "perfect couple" language programming concept is more relevant than ever. What are your views/hopes on this today? In particular, somebody had attempted, with Vyper, to implement an OCaml-based Python interpreter. OCaml has most of the technical virtues of Java, can also please the adepts of functional programing, and, perhaps more importantly, has high performance compilers which Java does not have. Thanks to this performance gap, the distinction between OCaml and Python is much clearer than it is between Java and Python. So, if Vyper, or a similar project was reactivated and successful, would you support it, and would you consider getting involved in it, perhaps even considering dropping in the long term the C-based interpreter?

  115. Future of CP4E (Computer Programming For Everyone) by bastia · · Score: 1

    With the move away from CNRI, the Python development team now has private sector employers who presumably demand development time on their projects in addition to the Python core. Since your current employer does not produce educational software, one can only assume that you and your team don't spend much time working on CP4E. In fact, the CP4E page says "The project is now in limbo; we're still interested, and we're still working on IDLE, but we aren't actively pursuing the other goals of CP4E."

    How important is CP4E and its goals to you personally? Was it just an neat idea to try to get funding, or are you personally committed to furthering the vision presented in that proposal? Should we expect to see you involved with similar efforts in the future, or are you simply happy to have planted the idea in other programmers' heads?

  116. Why not Parrot? by ellem · · Score: 1

    --Ever even think about mixing it up with Perl?
    ---

    --
    This .sig is fake but accurate.
  117. Re:A threat? by NoahSpurrier · · Score: 1

    Except that Perl is more like a highly addictive, carcinogenic drug than a cup of tea. Friends don't let friends write Perl...

    Although I'm open minded enough to look forward to seeing what comes out of Perl 6.

    Ruby is nice, but it's not pretty enough.
    I'm a happy indenter with Python.
    The TAB key is your friend.
    Don't fear the whitespace.

  118. Re:Did you approve of the Parrot joke? by cmat · · Score: 1

    I've seen this attitude towards Open Source software, which can be summed up somewhat like this: "If people that advocate OSS want to gain marketshare they better play by the rules", or "I can't get my boss to use OSS in our department because he thinks it's a toy, and not a commercially viable tool".

    I think that it's more the other way around. OSS I don't think was ever a movement to "take over" the corporate world, and I think it's been sensationalized to much as such. Rather, I believe the philosphy of OSS and the Free Software Foundation has always been more "if the tool gets the job you need done, use it. Oh, and publish your source so you can benefit from others looking at it, and others can beneift from looking at your code and learning".

    Anyways, it's totally off topic, but I needed to rant a bit. ;)

    --
    -- Humans, because the hardware IS the software.
  119. Design thoughts... by cmat · · Score: 1

    Hi Guido,

    As a language designer, why did you decide to start off with Pascal as a base for Python? What sort of things did you like about Pascal's syntax and structure which helped this decision? And now looking back, has Python expanded and changed so much that you would have changed this initial design consideration?

    Cheers! Chris

    --
    -- Humans, because the hardware IS the software.
  120. Python v. Perl by TheLocustNMI · · Score: 1
    Perl vs. Python. What is your take? It's a common argument, and I'd just like to hear it from the horse's mouth (er, rather the snake's mouth).

    I personally am a Python man myself, but only after attempting Perl on a project, becoming frustrated, and then writing the app in Python instead, in a fraction of the time (and NOT knowing Python at the beginning).

    Python is gaining much ground, especially in the realm of embedded scripting. Does Perl stand a chance in the future?

  121. Indentation? by fm6 · · Score: 2
    Every other programming language I know uses some kind of visible token to indicate code blocks -- curly brackets, begin/end, whatever. Good programmers indent nested blocks, but that's just to make the code easier to read. The parser doesn't care.

    In Python, indentation is the token. What's the rationale for this? Do you get a lot of flack from people who prefer the old-fashioned way?

    Oh yeah, and since the Vim % command (jump to matching bracket) doesn't work with Python code, do you know of a macro to replace it?

    __

  122. Follow-up Questions by FortKnox · · Score: 2

    Follow-up questions are:
    What's your favorite Monty Python Quote and Movie?

    --
    Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
  123. Re:Politeness - MOD THIS UP!! by Abreu · · Score: 1
    Where are the moderation points when you need them!

    ------
    C'mon, flame me!

    --
    No sig for the moment.
  124. Re:Perl by SimHacker · · Score: 1
    Pulllease. Guido has better things to do with his valuable brain cells that wasting them thinking in or about Perl.

    You might as well ask Mother Theresa what she thinks about Howard Stern.

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  125. Python for AI programming by SimHacker · · Score: 1
    How would you rate Python for artificial intelligence programming? Both in the classic sense (as Lisp programmers use the term), and the modern sense (as game developers and players use the term)? Was Python intended to be used for AI programming, or to cover everything else you can do in Lisp? How could Python be improved to satisfy AI research programmers, as well as game developers? Are there many Lisp programmers who have happily switched to Python? What complaints or requests for improvement have you heard from them? Are there many game developers using Python as a scripting or game ai programming language? How has that worked out? What other high level tools incorporate Python as an extension language, the way Emacs uses Lisp?

    Mature AI programming platforms like the various Lisp Machines and Common Lisp have first rate interactive code development / debugging systems. This is because of the dynamic, reflective, interactive nature of the Lisp. C++ is nothing like that, so it has taken many years for tools like Microsoft Visual C++ to catch up with what Lisp Machines had in the 80's, but using millions of times more resources and not running any faster. Since Python is like Lisp in many ways, what kind of interactive visual Python code development and debugging tools are being developed and do you expect to see in the future? (Zope is a great example, but where do you see it headed?)

    -Don

    --
    Take a look and feel free: http://www.PieMenu.com
  126. python versus perl by sv0f · · Score: 2

    (1) who would win in a fistfight, you or larry wall?
    (2) who speaks more languages, you or (that supposed linguist) larry wall?
    (3) if you could eliminate one planet from the solar system (besides the earth), which one would it be?
    (4) how do you feel about the euro?

  127. Type Checking by DawnHorse · · Score: 1

    This is kind of funny, i reckon.
    When i program in C i have to write my own memory management,
    and when i write in Python i have to write my own type checking.
    (Usually it's an assertion at the start of a routine. It helps to catch me when i plug in the wrong thing, and also to document what type the parameter should be.
    Otherwise there is just Python's latent type checking: namespace look-ups, followed by assertion throwing if the name is absent.)
    So, what is more difficult: memory management or type checking?

    Often I stick to C's bedrock type system
    when i'd rather not have to deal with Python's ever shifting sands of types.

    What are your thoughts on this?
    Do you even beleive in having types?
    Do you see Python supporting types in the future?
    What coding style(s) do you employ to help with Python's weakly typed variables?

    --
    !#
  128. Can we get rid of the underscores? by darekana · · Score: 1

    The whole __init__ __setattr__ etc... lots of underscores, hard for new users to understand, hard to tell whether there are two or one underscore involved, difficult to understand whether or not they have special meaning etc. Could this system be replaced with say one leading underscore? "_init" etc...

    Yeah I know that would break everyone's code... but in the name of a clean educational language for everyone... please. :)

  129. Python by Floyd+Tante · · Score: 2

    What Is Python? Understanding Them : Pythons are relatively primitive snakes belonging to the subfamily Pythoninae within the family Boidae. Boidae, in turn, is one of 11 families in suborder Serpentes, The Snakes. Within the subfamily of pythons, arboreal pythons with heat-sensing pits along their lips (green tree pythons) are grouped seperately from terrestrial pythons that have heavy bodies and short tails
    (blood pythons). Each different type of snake eventually ends up with two names, one for the genus and one for the species. When isolated population exits that are still identifiable as the same type of snake, a third name, the trinomial, is added.
    The term primitive indicates that these snakes were some of the first snakes to evolve. Primitive snakes display features that link them to lizards. These features include a rudimentary pelvic girdle in the form
    of cloacal spurs, and lungs of equal sizes . Advanced snakes, like the rat snakes and whip snakes, have only one functional lung and no cloacal spurs.
    Pythons are divided into about 26 species, depending on which authority you accept. Pythons range in size from very big (Burmese and Reticulated pythons with the potential of over 20 feet and over 200
    pounds) to small (Children's pythons do not get much bigger than 24 inches '61cm' in length) . No matter what the size , they are all constrictors . Some burrow-hunting species have developed novel ways of
    using thei coils to catch prey within the confines of a burrow but they are still constrictors nonetheless . Most pythons are nocturnal hunters and some species have heat sensory pits along the edges of their lips
    to aid in finding warm-blooded prey .

    Pythons Versus Boas : Many people don't know the main difference between boas and pythons . Boas are termed ovoviviparous , this means their eggs inside the females are surrounded by a membrane
    instead of a hard shell like pythons . So when the boa babies born , babies break through the membrane to crawl away . Pythons are oviparous , this means the eggs are surrounded by a thin , parchmentlike
    shell . Female pythons will coil around their eggs and stay with them during the incubation period .

    Life Span : Over 20 Years But Much More In Captivity .

    Their Orginal Habitat : Africa , Asia and Australia , North America (A Little Amount) . All python snakes are tropical animals . They won't live under the temperature 22C (77F) . Under this fact the areas
    that they live must be near the deserts or tropical places like amazon . But mainly you can find them Africa , Asia and Australia , North America (A Little Amount) .

    Pythons As Pets : Pythons can be good pets if you care them enough .
    -- Floyd

    --
    -- Floyd
    1. Re:Python by BlowCat · · Score: 2
      Life Span : Over 20 Years But Much More In Captivity
      Wow, 20 years - it's pretty long for a programming language! I just hope that Guido will always keep it in captivity.
  130. Re:why do Brits think Python is funny? by wadetemp · · Score: 1

    And the creators of South Park were INSPIRED by Python's cartoon style.

  131. If you were stuck on a desert island... by wadetemp · · Score: 2

    ... what book would you bring, what CD would you bring, and what language OTHER than Python would you be using (assuming that your computer suvives the sand and wet.)

  132. Parrot and 3D by ahfoo · · Score: 1

    Apparently, Python has a gazillion uses, but 3D packages have been especially warm to it and I've read that it's particularly well recieved by Hollywood film makers.
    When I think of Perl, I think web pages. Of course Slashcode in particular comes to mind. So, does Parrot have any goals regarding interactions between the web and 3D.
    Perhaps you've seen that news announcement for the new Macromedia 3D tool for Director. I went and checked some demos on that and it was impressive animation considering it was coming over the web. Are there any possibilities that some combination of Perl and Python will produce similar tools?

  133. Question about the personal side by Bob+Abooey · · Score: 4

    How closely does the primary Python development team interact with the other language binding efforts (mainly Jython)? Anyone who's hung out in Slashdot seems to have a rabid attachment towards their native tounge, so to speak, and I've found it refreshing that the Python community "plays nice". Is there a lot of cross-pollenation(sic) between the groups?


    Yours,
    Bob

    --

    All the best,
    --Bob

  134. Will it every be C++Python? by jbarham · · Score: 1

    Two of Python's biggest strengths are its easy extensibility and its object-orientedness. When it comes to writing Python extensions in C++, however, I have to use Python's plain C extension API to wrap my C++ objects. While it's certainly functional, most of my extension code seems to be boilerplate and housework (e.g., validating arguments and keeping track of reference counts) that could be handled more transparently if Python provided a C++ extension API. I realize that there are third-party Python extension libraries such as Boost.Python for C++ programmers, but at this point I still prefer to use the C API despite its verboseness as it gives maximum control and allows me to make my extensions more "Pythonic" by, for example, allowing me to map C++ get/set method pairs to Python object attributes.

    All of which is a very roundabout way of asking if you are considering rewriting CPython in C++ or at the very least providing an "official" C++ API to Python's underlying object model?

    P.S. Thanks for a great language!

  135. Re:Did you approve of the Parrot joke? by GTRacer · · Score: 1
    Re: OS Language/App Names

    Ever think maybe O'Reilly makes efforts to promote colorful names? Makes their job of choosing cover art for the SAGAN billions and billions /SAGAN books they produce that much easier!

    GTRacer
    - Any week now...

    --
    Defending IP by destroying access to it? That makes sense, RIAA/MPAA. Go to the corner until you can play nice!
  136. Power Systems by GTRacer · · Score: 1
    I've been thinking of power/actuation systems for a Battlebot for some time now. I'm leaning toward a compact spherical robot and was wondering - electric or hydraulic?

    Oh, the other Rossum.

    Uhhh... I don't really have a programming question, I haven't gotten that far with the 'bot yet. Sorry!

    GTRacer
    - Long live Asimov!

    --
    Defending IP by destroying access to it? That makes sense, RIAA/MPAA. Go to the corner until you can play nice!
  137. Re:Oy, it hurts by MaxQuordlepleen · · Score: 1

    yes that was/will be/has been/warll a problem.

  138. Perl by ConsumedByTV · · Score: 1

    What are your thoughts on perl?

    Do you see perl as a threat to python?

    Or are is perl just another tool to get a job done like python?


    Fight censors!

    --


    "Not my manner of thinking but the manner of thinking of others has been the source of my unhappiness." - M
  139. BeOpen.com by RussP · · Score: 1

    What went wrong at BeOpen.com?

    --
    I watch Brit Hume on Fox News
    1. Re:BeOpen.com by RussP · · Score: 1

      And you are a pedant. We have democratic elections, so we are a democracy. We also have a constitution, which limits the rule of democracy, of course, but that does not mean that we are not a democracy. Your semantic distinctions are pedantic and pointless.

      --
      I watch Brit Hume on Fox News
  140. Does Python have too frequent revisions? by Bo+Vandenberg · · Score: 1

    I began learning python at 1.5 and was really excited by 1.6 then 2. now 2.1. Without taking away any admiration for all the rapid work that is being done on the language do you personally target a number of revisions in a year?

    Could Python ever move to an even and odd revision structure like Linux? Odd revisions for developers and even for businesses???

    Bosah

    Thank you very much for Python.

  141. Guido Hatzis by noz · · Score: 1

    Are you this man? If not, are you in any way related to him, and could you please explain.

    Hopefully this question covers the Australian fan niche.

  142. Python evolution by IanA · · Score: 1

    Do you believe Python is a 'do-it-all' language currently?

    If not do you believe it will ever get to that point in which it can be used for all purposes?

    What needs to be improved for it to be a 'do-it-all' language?

  143. Did you approve of the Parrot joke? by typical+geek · · Score: 1

    Did you approve of the Parrot joke about combining Python and PERL?

    I didn't especially like it, I think it hurts Open Source and reinforces the perception of Open Source software and funny and a toy.

    I work for a large corporation, and it's an uphill battle to incorporate Open Source software. I'm tryin to move several web servers from IIS to Apache, but without my manager's blessing, it's hard. Jokes like PARROT make it harder for IT personell to make a case for Python or PERL being ready for corporate use.

    I seriously think Open Source needs to rethink it's attitude if it wants to gain market share. IBM didn't became the monopolist it became in the 1970's by selling mainframes that made fart noises and having service reps wear joy buzzers, instead they had an image of an ultra serious, suit and tie wearing, dependable company. Now, I'm not advocating that kernel developers wear suits and tie for PR shots, or language developers don't chose more appropriate names (perhaps PYTH-96 instead of PYTHON?) but you have to admit such steps would give a lot more credibility to Open Source software.

  144. Python and .NET by bryanbrunton · · Score: 1


    Microsoft recently funded a semi-functional version of Python for .NET. However, there is still a lot of work remaining before Python can officially be said to be among the esteemed ranks of the .NET capable languages.

    Do you have any thing positive or negative to say about this port? More generally, do you have any opinion on the language neutral approach of Microsoft's common language runtime (CLR)?

    My personal opinion is the the CLR is neutering these languages. To you these languages inside the CLR, you have to use (1) common data types and (2) common class libraries. Those two items are major parts of speaking in a programming language. What you are left with is whatever bits of the language syntax that Microsoft (or the .NET language porter) chose to include. Its almost like every language in .NET is a scripting language. Python taken to a wild and crazed extreme!

  145. Why have only one "official" GUI toolkit? by ewestra · · Score: 1
    Hi. Let me start by saying that Python is amazing. I've been working with it for about a year now, and every project I've used it for has been outrageously successful. I'm constantly amazed at how easy and quick it is to program in Python...

    Now, one thing that has been bugging me for a while is that Python only has one "official" GUI toolkit (Tkinter), even though there are a variety of toolkits available. Each toolkit has its own strengths and weaknesses -- so why has Guido chosen to only mention one of these toolkits on the Python Language Website ? It seems to me that by having a single "de facto" standard toolkit gives the impression that no workable alternatives exist, which will lead many people to conclude (as I initially did) that Python is unsuitable for GUI programming -- simply because the "de facto" standard toolkit appears to be the only one available, and was unsuitable for the particular project at hand.

    Isn't this doing Python a dis-service? It seems to me that this idea of a single "standard" tookit smacks of a Microsoft-like attitude that there's only one OS/Word Processor/GUI toolkit you can use. With Python GUI programming, as with most things, there are many alternatives available -- each with its own advantages and disadvantages. So why not have a variety of supported toolkits, rather than supporting one to the exclusion of all the others?

    Thanks,

    - Erik.

  146. Suitable for what in 5 years? by sam_penrose · · Score: 1

    Twenty years ago, many of the tasks that Python is used for currently had to be done in entirely in C because the hardware they ran on was so much slower. Now, Python is used in very computationally demanding applications (bioinformatics, high-end animation, and many more) as a glue for software written in C, et. al. With hardware speeds doubling every 18 months or so, five years from now, programmers will have 10 times as much computing power available to them. With the "performance issue" an order of magnitude less important, what applications do you think Python will be used for then that it might not be now?

  147. Python in education by sam_penrose · · Score: 1

    With Computer Programming For Everbody on the back burner, what is your sense of the current state of Python in education?

  148. Most needed contribution? by sam_penrose · · Score: 1

    If you could ask the Open Source community for one contribution to Python's continued development, what would it be?

  149. Support? by Tsar+cr0bar · · Score: 1

    When will Python support for JavaScript and HTML? I would like to use it and create PHP web pages for my Apache computer. Now it make use only for FrontPage plug-in?

  150. Array slicing.. by dmouritsendk · · Score: 1

    Will Parrot maybe implement functions for array slicing? etc. array2@ = array@(1...3)(2..4) , that would be kinda cool .o)

  151. efficient compilation and standardization by janpod66 · · Score: 4

    What are the plans for the compilation of Python code to efficient executables? Python's object system is very dynamic, allowing anybody to add instance variables and methods to any object at any time--how are you planning on dealing with that during compilation? Performance-wise, how do you expect Python will compare to compiled CommonLisp or Smalltalk, which evolved along similar lines 20 years ago? And will there be a language standard, or will Python continue to be defined by what the C implementation does?

  152. Python wasn't designed for performance... by oodl · · Score: 1

    > Is it possible to make Python
    > as fast as C/C++

    In short, no, it's not possible.

    I keep seeing people interested in a Python compiler to speed up execution Python code.
    But I am dismayed by peoples on slashdot.org general lack of interest in Dylan, which is not only a WAY WAY COOL (TM) language, but a more powerful and more flexible language than Python and efficiently compilable into code that performs as fast as C/C++.

  153. Will TK still be the standard ? by makapuf · · Score: 1

    TK is the standard widget toolkit interface, but right now distributions and implementations are bundled with TCL on top of python : memory consuming, not so fast, and not so well suited. And some widgets are not present right now in TK standard distro. Are there plans to introduce a new (cross-platform and suited for python native data types) widget toolkit like wxpython as a new standard widget library ? Or an unified widget abstraction layer (read : specification) ? No Toolkit flamewar, please !