Domain: python.org
Stories and comments across the archive that link to python.org.
Comments · 1,513
-
Re:Bad release practices
As a good start, i recommend Django. It's a nice framework that takes care of a lot for you, but still lets you write Python. They have a few tutorials as well as a good community and an ongoing project, The Django Book. I transitioned directly from PHP to Python without any books. Most coding forms transition directly over to Python. As you learn more Python, you'll find shortcuts, e.g., the list constructs and lambda functions.
I also recommend reading over PEP 0008, the "standard" coding structure for the Python core libraries. It may seem restrictive limiting yourself to 79 character columns, but you get used to being able to read your code very quickly, especially if you come from PHP or Perl. (Tip: USE SPACES FROM THE START! You'll thank me later.) I can't underestimate the awesomeness of the interactive Python shell, either, especially for beginners.
There are also other platforms out there, Turbogears and Pylons being two notable ones. I think the Django documentation is a bit better, though.
You may also look up Web.py, which is as close to "drop and run" PHP as you'll get without going to pure CGI.
Python takes a little more care to set up at the server level, and you won't find may $1 hosts that support it. -
Re:ESR work
Would you explain copy_instance() to me? I have a little bit of developer credibility, and *I* can't figure it out: http://www.python.org/about/success/esr/
I have no idea, I'm not a developer.
Of course since ESR is such a crappy coder compared to you, UNDOUBTEDLY you understand the code at first glance.
See above.
Oh, and by the way, RMS has borrowed a few things for the GNU project. That's one of the reasons why Linus doesn't cooperate with the FSF.
But RMS a) has a huge body of his own code that ESR just doesn't have, b) RMS, he can be obnoxious, is not nearly as pompous and self-important as ESR, and c) RMS doesn't plaster his name over everything he does borrow. -
Re:ESR work
Would you explain copy_instance() to me? I have a little bit of developer credibility, and *I* can't figure it out:
http://www.python.org/about/success/esr/
Of course since ESR is such a crappy coder compared to you, UNDOUBTEDLY you understand the code at first glance.
Oh, and by the way, RMS has borrowed a few things for the GNU project. That's one of the reasons why Linus doesn't cooperate with the FSF. -
Re:itsatrap right?
You want to write windows programs? Last I checked you had two compiler options anymore: Microsoft and Microsoft. Even the cost of visual basic is going to be close to $100 US.
Uh, Free Microsoft Visual Express, Free Python on Windows, Free Ruby on Windows, MinGW...
If you run Windows on OLPC, I'd go for Windows XP Embedded. -
Quote much?
There were so many double-quotes in that write up that I thought it was a """paean to VMS""". It's nice to see that Python continues the practice.
-
Re:OthersI just finished getting Zenoss working on a test box two days ago (CentOS 4.3 VM -- not the Zenoss VM image, though). I'm currently testing it to monitor some Windows servers, as that is what we mostly have.
There were a few things missing from the manual installation docs. Here are the steps I used to get it up and running:
- rpm -Uvh perl-Socket6-0.19-1.2.el4.rf.i386.rpm
- rpm -Uvh perl-Crypt-DES-2.05-3.2.el4.rf.i386.rpm
- rpm -Uvh perl-Net-SNMP-5.2.0-1.2.el4.rf.noarch.rpm
- rpm -Uvh MySQL-client-standard-5.0.24a-0.rhel4.i386.rpm
- r
p m -Uvh MySQL-server-standard-5.0.24a-0.rhel4.i386.rpm - y
u m -y install net-snmp net-snmp-utils perl-Digest-HMAC perl-DBI - rpm -Uvh zenoss-1.1.1-0.i386.rpm
- rpm -Uvh Zenoss-Plugins-1.1.1-1.py23.noarch.rpm
- /etc/init
. d/snmpd start - /etc/init.d/zenoss start
- Go to http://zenosshost:8080/ and login admin/zenoss; change admin password
- Install on a Windows host, version 2.4 of Python
- Install on same Windows host, pywin32
- Install Zenwin
- Add the path to the Python executable to the System PATH environment variable
- Edit the Zenwin configuration files to point to the CentOS Zenoss host, and change the username/password in the config files to use the new admin password [WARNING - passwords stored in plain text]
- Install Zenwin as a service, running under an account in the local admin group on the windows host.
- Add the Zenwin service account username/password into to Zenoss web interface.
As for my opinion of it, it seems pretty cool so far, but I'm reserving my final opinion for when I've had a chance to play with it a little more.
-
Re:Not necessarily in order...
I visit many of the same sites that you do. Freshmeat is essential for keeping up with the OSS community. As a professional programmer, I also need to know what's new when it comes to Python, Ruby and Mono, since those are the languages or platforms I use most often. Sites like the Ruby Forum [http://www.ruby-forum.com/], Planet Python [http://planet.python.org/], and Monologue [http://www.go-mono.com/monologue/] make doing that very easy. And for future language developments, I'm always sure to read Lambda the Ultimate [http://lambda-the-ultimate.org/] and PLnews [http://plnews.org/]. And the comp.lang.misc newsgroup [http://groups.google.co.uk/group/comp.lang.misc/
] is also a good place for information, too. -
Re:One Question...
So, some major differences between Google and the dot-com boom are a) Google actually makes a considerable amount of money b) The Internet is substantially more stable than it was (initial fervor has subsided and things have shaken out and consolidated since then c) Google is packed full of the best people We had a visitor from Google a while ago (Pablo Cohn). The guy reports to Peter Norvig and has taught machine learning summer school to Guido Van Rossum. These guys are literally the modern superstars of Computing Science. In the Dot-com boom/bust, tons of money was gambled on any random person with a crazy idea. In contrast, Google is a collection of super talented people earn crazy money off their ideas.
-
Parrot!
Since we're all nerds, we shouldn't forget the best nerd April's fool joke ever:
http://www.python.org/parrot.html
Read it. It is worth it. -
Re:Barrier to entry
In the AI field, nobody has actually proven they know what they're doing yet, so you can't be too far behind!
As an amateur programmer who's dabbled with AI and game design, some things I found helpful and interesting were:
-Stephen Pinker's How the Mind Works and The Language Instinct (readable and entertaining)
-Douglas Hofstadter's Godel, Escher, Bach (brilliant but baffling, touching on a lot of topics, some of which are worth skipping over; not the best book to pick up lightly)
-Hofstadter's Fluid Concepts and Creative Analogies (more AI-focused, describing how you might model creativity on a computer)
-Chapman's Vision, Instruction and Action (obscure book by an MIT student who built an AI to play a Gauntlet-like game)
-Playing with the Python programming language, which is free, multi-platform, easy to learn and use, and has a good game library (Pygame) and a developer community. Look for the free online book "Dive Into Python" as one guide, or just start playing. Why use a super-efficient macho language at this point when the current limitation on AI isn't raw speed?
-Looking up a few of the famous real AIs and thinking about their limitations: ELIZA, ALICE, Cyc, and SHRDLU for instance. A version of Hofstadter's "Metacat" is available online along with the others, I think. Also look into real robots like Stanley, RoboSapien, Kismet, Cog, and Qrio, which may change your perception of what a robot can be like.
-Writing fiction! How do you think an AI should work? How would it deal with real-world problems? Reading SF is good food for thought too; what do you think of Asimov's Laws?
-Joining the Robitron discussion list for talk about AI by people associated with the Loebner Prize Contest, though often from a perspective I disagree with.
Let me know if you do get into this! Even if you don't build anything yourself, that material will help tell you what's been going on in the field and some of the ongoing debates. -
Building/installing Python RPM is trivial.
wget http://www.python.org/ftp/python/2.5/Python-2.5.t
g z
rpmbuild -tb Python-2.5.tgz
rpm -i /usr/src/redhat/RPMS/python2.5-2.5-1pydotorg
and you have yourself latest Python installed alongside bundled one, to be accessed as "python2.5" -
Re:R Hell
It should be noted that there are third-party projects to add the flexibility and newer versions you want, like CentOS Plus (includes PHP 5, Postgres 8, MySQL 5, and others) and PyVault (Python 2.4).
-
Re:Be Prepared?
Seriously: So what if "properly coded PHP" is still useful? It's not as useful or as easy to properly code as other languages, so why do you persist in using an inferior, defective language like PHP? Properly sealed lead and asbestos are "still useful" in constructing new houses, but you certainly should not use them! The fact that something's "still useful" does not negate the fact that it's still foolish to use it, if you have a better alternative.
-Don
-
Re:Pot calling the kettle black
You still don't get it. A pull parser is not the same thing as generators. Generators are a programming language construct which is extremely useful for implementing pull parsers, and modular telescoping XML processing pipelines, like the Kid templating system.
Go read the link about generators that I provided. Then please explain how you would implement generators in PHP. You can't, because it's a language feature that can't be implemented at the PHP script level. It required modifying how the PHP interpreter works. Let me say this again: it is impossible to implement generators in PHP code, no matter how good a PHP programmer you are -- you have to rewrite the PHP interpreter which is written in C, to implement generators. Generators enable your processing modules to run in parallel, each with its own return stack and local variables (i.e. co-routines). PHP absolutely cannot do that.
If you don't believe that, then you don't understand how generators work, so go back and read the article again. Then try to convince the PHP designers to add generators to PHP: good luck!
Python supports generators, because they are built into the interpreter. They are a fairly new feature from Python 2.3, described in PEP 255: Simple Generators. The Python interpreter C code had to be modified to support them, and it was done because generators are so useful (especially for processing XML).
Other more powerful languages like Scheme do not have to have their interpreters modified in order to support generators, because they already have more powerful programming constructs (like continuations) that can be easily and efficiently used to implement generators.
But since PHP does not support continuations or co-routines, it is absolutely impossible to implement generators (or Kid-like templating systems) in PHP, no matter how great a PHP programmer you are.
-Don
-
Re:Pot calling the kettle black
If the people at Zend don't understand the nuances of PHP's object system, then why should anyone else be expected to understand it? You must concede the point that the bug that caused them to cancel their ZActiveRecord plans was a stupid mistake caused by a misunderstanding of OOP, because Zend themselves got unexpectedly bitten by it, even after making excuses for the flawed behavior and claiming they would never fix that bug. Unless your name is John McCain, choose one side of the argument and stick to it. Either it's not a bug and it should not be fixed (and you should expect it to work that way and not make the mistake Zend did), or it is a bug and should be fixed (like all the PHP programmers have been clamoring for, which you will see if you read the comments on the bug). You can't have it both ways, Mr. Straight Talk Express.
Stop making excuses for PHP's horrible global namespace. There's nothing about "procedural languages" that requires global namespaces and all the problems inherent with them. Haven't you ever heard of "modules"? You must be totally ignorant of other languages, to make a statement like that. But then again, that's probably why you choose to use PHP, and foolishly leap to the defense of its flaws: because you don't know any better.
Your homework is to go read PEP 20, The Zen of Python. Python was designed and written by people who actually understand language design, but PHP wasn't. It actually makes a difference! Here is The Zen of Python for you to read right now -- every one of the principles flies in the face of PHP's foolish design. Pay special attention to the last one:
The Zen of Python
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!-Don
-
Bah, who the hell still uses perl?
Professionals use python
http://www.python.org/ -
They reinvented my idea of year 2001?
-
Re:VB is powerful but not respected
The power of VB doesn't lies in its methodology or programming techniques. But in ability to churn out an application faster to production. There is always a demand of non-critical business apps that are required for small production cycle. Here nothing can beat VB.
Maybe this was true in the very early 1990s. But not anymore. Python is a far superior language. It's just as easy to learn as VB, you get a far faster development cycle, and your applications are actually portable. -
Sun should take a lesson.
Most of Sugar, the OLPC's desktop environment, is written in Python. The source is here:
http://dev.laptop.org/git.do?p=sugar;a=tree
I just tried it out, and I am pleasantly surprised! It's amazing how much faster Python is for desktop applications than Java is. Even when using IBM's SWT for developing Java applications, they still feel far more bloated and slower-responding than OLPC's Python-based GUI applications.
I would have expected Python to be slower than Java, but apparently that is not the case. It could be that the layers upon layers that make up Swing really slow it down. Maybe it's time for Sun to take a page from OLPC's Sugar project, and develop a UI framework that is fast and easy to use. -
Re:Overly Complicated?
If you used include smtplib with a couple extra commands you could have made it platform independent, assuming that you didn't have access to a Unix box. Say a VMS Station or Windows server....
-
Re:Honeymoon is Over?> SOAP is not complicated; creating a SOAP client/server is *MUCH* simpler than creating an XML-RPC client/server if you are using the proper tools.
Using the proper tools, it seems, is the key to SOAP.
Tried it with Python lately? RPITA.
XML-RPC in python is a breeze, both server and client (client: 1 line to import the xmlrpclib library, one line to implement the server proxy, and one line for each call. like this:
import xmlrpclib
service = xmlrpclib.ServerProxy(r'http://example.com/')
result = service.getState(44)
and that's it.
if you want to be fancy,
(using '___ ' to simulate indentation )
import xmlrpclib
service = xmlrpclib.ServerProxy(r'http://example.com/')
try:
___ result = service.getState(44)
except:
___ print "didn't work" # or some variation
And that's hard how?
Anyhoo, go visit
http://docs.python.org/lib/module-xmlrpclib.html
and
http://docs.python.org/lib/module-DocXMLRPCServer. html
Enjoy! -
Re:Honeymoon is Over?> SOAP is not complicated; creating a SOAP client/server is *MUCH* simpler than creating an XML-RPC client/server if you are using the proper tools.
Using the proper tools, it seems, is the key to SOAP.
Tried it with Python lately? RPITA.
XML-RPC in python is a breeze, both server and client (client: 1 line to import the xmlrpclib library, one line to implement the server proxy, and one line for each call. like this:
import xmlrpclib
service = xmlrpclib.ServerProxy(r'http://example.com/')
result = service.getState(44)
and that's it.
if you want to be fancy,
(using '___ ' to simulate indentation )
import xmlrpclib
service = xmlrpclib.ServerProxy(r'http://example.com/')
try:
___ result = service.getState(44)
except:
___ print "didn't work" # or some variation
And that's hard how?
Anyhoo, go visit
http://docs.python.org/lib/module-xmlrpclib.html
and
http://docs.python.org/lib/module-DocXMLRPCServer. html
Enjoy! -
Re:'ivory tower academics...' oh please
The ONLY people who think Java is in decline in favor of Ruby or Python are the ivory tower academics who aren't actually developing large scale enterprise applications.
Hmm... heard of a game called 'EVE Online'? Their server -- which serves provides an entire 3D universe to over 33000 users simultaneously (without instancing as in WoW or Guild Wars) -- has the game logic implemented almost entirely in Stackless Python, with shared state across tens of thousands of CPUs. Or what about that small and insignificant search engine, Google? They seem to rely quite heavily on Python too.
Oh, I'm sorry. Perhaps those aren't "large scale" enough for you. What sort of "large scale enterprise applications" did you have in mind?
-
Re:My Suggestion to OO Developers
-
... Ack. :)
Okay, I generally try not to make snarky comments, but, with my apologies, please allow me to indulge briefly.
:)
> With PHP, it's simple -- your test machine is probably set up already, and your deployment
> webserver almost certainly is.
<snark>Are you FUCKING kidding me?</snark>
(Golly, I already feel better.) :)
Now please allow me to expand.
Deploying for PHP is an insane pain in the ass. PHP breaks compatibility at every turn on the wind (fun fact: the product I'm paid to deploy for a large company right now doesn't run on the very latest PHP... and the previous version has since had security holes discovered, joy). PHP's behavior depends strongly on the host configuration, which may vary wildly and to which you may not even have access. Availability of certain features is conditioned by how PHP was compiled, which you might have no control on. PHP is not thread-safe and may wreck your data on certain Apache configurations. And so on, and so on.
Since Python was brought up in this thread, let's compare. Python has an API called WSGI that plugs into pages or frameworks on the client side, and Web servers on the server side, and any WSGI-compliant server method and framework will do. All the Python-based frameworks, Django, TurboGears, Web.py, Pylons, etc, support WSGI. Apache with mod_python or CGI or FastCGI or FCGID support WSGI. Lighttpd has a WSGI module, I believe. Whatever is available for you will do for a Python framework so long as there's a WSGI interface for it, and there's a WSGI interface for pretty much everything these days (although some googling might be in order in some cases). Recently, I deployed one of the largest Python frameworks under a very restricted platform that only allowed CGI: it worked just fine. In fact, I imagine it shouldn't be exceedingly hard to code a small PHP handler that would delegate calls to WSGI, which would allow you to deploy a Python framework wherever PHP is installed. Now that would be fun. :)
Also, Python has a standard library that can be counted on everywhere it's available, and I had never before understood how much of a boon that can be, honestly. It's also thread-safe (although it does pay a price for this safety -- when you know that price and when it matters and when it doesn't, be proud of yourself, because you'll then know one of that tool's flaws, and knowing that is the beginning of mastery).
Mind, I'm not telling you to drop everything and start courting snakes right away, because that's not my fucking call -- it's yours. Do NOT switch tools if you don't know, personally, WHY you should; everybody will be happier in the end that way (but I do encourage you to learn new tools when you can and what they're good for and why they're good; it's healthy for the mind). But I find your comment interesting, because it implicitly connected an unknown (deploying under Python) with a difficulty comparatively to your current known way, regardless of the inherent flaws of that way. Interesting, how the mind works, isn't it? :)
This being said, dropping an 'hello world' in some directory and having it work right away is something PHP still does better; in fact, it's simply great at it. It's when you start using non-trivial functionalities that things go downhill.
Anyway. As a conclusion: do me a favor, forget Python for at least a day, and go learn Ruby instead at first. Why? Because I would like you to learn why you're using the tools you are, and listening to some random dude on the Net about some random language is quite probably not how you'll achieve that.
Thanks for reading! (And sorry, I tend to be a bit verbose, I know.) -
some points
- Don't forget to check and respect robots.txt. Python has a module that helps you parse that file
- Samie and its Python port Pamie are your friends. You can automate IE so your script is treated as an human and not discriminated as a robot.
- I use such beasts to do one-click time reporting at work and one-click cartoon collecting in my favorite newspaper.
- And once I even repeatedly voted on an online poll and changed the course of history.
- Ah, yes, TFA was about building a spider on Linux. I didn't check if my one-click IE scripts work on IE/Wine/Linux.
- If I write an one-click script for online shopping, does it infringe the infamous Amazon patent?
- When will Firefox's automation capabilities match those of IE?
- Don't forget to check and respect robots.txt. Python has a module that helps you parse that file
-
some points
- Don't forget to check and respect robots.txt. Python has a module that helps you parse that file
- Samie and its Python port Pamie are your friends. You can automate IE so your script is treated as an human and not discriminated as a robot.
- I use such beasts to do one-click time reporting at work and one-click cartoon collecting in my favorite newspaper.
- And once I even repeatedly voted on an online poll and changed the course of history.
- Ah, yes, TFA was about building a spider on Linux. I didn't check if my one-click IE scripts work on IE/Wine/Linux.
- If I write an one-click script for online shopping, does it infringe the infamous Amazon patent?
- When will Firefox's automation capabilities match those of IE?
- Don't forget to check and respect robots.txt. Python has a module that helps you parse that file
-
Re:Makes more sense than Java
``Also though it is slightly off-topic I also think that Java under GPL would not benefit as much because the model of contribution is really not as easily understood as the OS world.''
With all the complaints about the Java community process being slow and bureaucratic, and the free Java implementations lagging behind in features, I think having a good, open source Java implementation is a Good Thing in it's own right.
Also, I don't know what you mean by the model of contribution for Java not being as easily understood as the OS world. It's not like there aren't any successful open source programming language implementations yet. -
Re:Python not easy to use due to reference countin
Read the FAQ. Python's garbage collector does check for cyclical references, just not as frequently (unless you tell it to via the gc module).
-
misc comments on comments
One recent thread about the book (which also comments on why things like functions and OOP appear later in the book than one would think):
http://groups.google.com/group/comp.lang.python/br owse_thread/thread/b8366618c4547978
Also check the Amazon page for reviews and other feedback plus the author even posted a comment:
http://amazon.com/o/ASIN/0132269937
To reply to some previous comments:
- It's *much* faster than it used to be: http://shootout.alioth.debian.org/gp4/python.php
- The indentation only bothers you for 1-4 months. (I didn't like it either at first.)
- It *is* interpreted but byte-compiled like Java to make successive runs faster
- Why ESR likes Python: http://www.linuxjournal.com/article/3882
- Native look-n-feel GUI: http://wxwidgets.org/ and http://wxpython.org/
- Compare to other languages: http://wiki.python.org/moin/LanguageComparisons
- Shopping: http://www.bestbookdeal.com/book/compare/013226993 7 (it seems like Amazon, Buy.com, Bookpool, and Overstock rotate for having best overall price, i.e., no tax [depending on where you live] and free shipping)
- Bad code: Python is attractive to first-time programmers because of its ease, so that's what you may be seeing. Also, bad code is language-independent, regardless; Python does not go out of its way to make this happen. However, Python also attracts long-time programmers because they discover they are more efficient and productive in it.
FWIW, I switched to Python a few years ago (after lots of C/C++, Java, Perl, Tcl, etc.), and I don't want to program in anything else again. The naysayers can pound on me all they like, but from my point of view, I enjoy what I do, I get decent pay, and I can get home on time to feed my kids then hack some more for fun after putting them to bed.
-A.C. -
Re:Python is SLOW
It's fast enough to multiplex (conference call) multiple voip streams.
See "Scripting Language" My Arse: Using Python for Voice over IP
http://www.python.org/pycon/dc2004/papers/6/ -
Right....
-
Re:Python is SLOW
> python " for x in range(1,1000)"
> is not the same as C "for (x=1;x1000;x++)"In place of range(), you should use xrange() as it doesn't build up the whole list as range() does.
-
Re:Python is SLOW
Also remember - taking the exact same algorithm between different languages may be misleading. In the case of python, there are more 'pythonic' language constructs that obviate the need to use particular algorithms - and also may provide speed above and beyond what you would find using the traditional algorithm.
So, this, for instance, is a Pythonic way of getting multiple return values from function:
def something():
return "Foo", "Bar"
foo, bar = something()
whereas this is not:
def something(l):
l.append("Foo", "Bar")
l = []
something(l)
foo = l[0]
bar = l[1]
Someone coming from a language like C or C++ might however have designed something like the latter.
Here is a link to comparisons of python with other languages for your edification: http://wiki.python.org/moin/LanguageComparisons -
Re:Python is SLOW
Also remember - taking the exact same algorithm between different languages may be misleading. In the case of python, there are more 'pythonic' language constructs that obviate the need to use particular algorithms - and also may provide speed above and beyond what you would find using the traditional algorithm.
So, this, for instance, is a Pythonic way of getting multiple return values from function:
def something():
return "Foo", "Bar"
foo, bar = something()
whereas this is not:
def something(l):
l.append("Foo", "Bar")
l = []
something(l)
foo = l[0]
bar = l[1]
Someone coming from a language like C or C++ might however have designed something like the latter.
Here is a link to comparisons of python with other languages for your edification: http://wiki.python.org/moin/LanguageComparisons -
Python Tutorial
Might not work as a direct substitute, but Python also has an extensive online tutorial under the documentation section of their website, http://www.python.org./
-
Re:On the cheap side ...
For that matter, the Official Python Tutorial is doubleplusgreat. It's both well written and comprehensive.
-
On the cheap side ...
One might try out Alan Gald's fine Learning to Program site. Short on pretty. Long on usefulness.
Oh, and all the thick books in the world will never help a budding python coder more than the tutor mailing list.
-
Re:Why are people freaking out?
-
Re:"Crunching" the numbers
Jan. 13, 1520 was a tuesday
No it wasn't. Read your documentation: "the current Gregorian calendar indefinitely extended in both directions". So your code is invalid pre-1582 (and even later if you consider that not every country adopted it immediately).
Never ask a computer scientist to do the job of an historian? -
Re:IceWeasel beats FireFox usage stats by end of 2
What on earth are you talking about? What debian is shipping is just firefox minus branding plus debian-specific patches. Why would anyone else have an interest in adopting that?
Your idea about a full fork shows a complete lack of understanding about how the Mozilla project works. Why would you want to fork Gecko or XULRunner just because of disagreements over a front-end that makes up 10% of the code, tops? Because that's all Firefox is. At least learn the basics about Mozilla before calling for a fork of it, otherwise you won't get far.
And for your "corporate governance" argument... Mozilla Corp. is just a subsidiary(sp?) the Mozilla Foundation created for administrative purposes. GNOME has the GNOME Foundation, Apache has the Apache Software Foundation, Python has the Python Software Foundation, GNU has the FSF. Are you calling for a fork of those projects too, to rid them of their evil governing entities? -
Running With the Pack
"On the Internet, nobody knows you're a dog." - P. Steiner
-
Re:It must be all about HR
-
Re:try/except/else/finally
I'm interested to know what would happen if you 'return' from the ELSE block, but have code in the FINALLY block.
See The return statement First, the exception passed to 'return' is evaluated (in your example to 42), then the 'finally' block is executed. So, this function prints "a","c","d" and returns 42. -
Array type for numerical calculations??
At some point there was talk about including a simple array type in python. http://scipy.org/BaseArray http://mail.python.org/pipermail/python-dev/2006-
J une/066516.html Does anybody know when this plugin will be ready for inclusion in python? -
Re:Woot -- conditional expressions!
http://docs.python.org/dev/whatsnew/pep-308.html recommends inclosing the expression in parentheses. Also, deeply nested expressions are not encouraged in the python world.
-
Re:Sqlite included!
The documentation for Python 2.5 is still in docs.python.org/dev
It's also up to date in the Windows bundle, and the SQLite3 documentation seems fairly good
-
Re:Sqlite included!
The documentation for Python 2.5 is still in docs.python.org/dev
It's also up to date in the Windows bundle, and the SQLite3 documentation seems fairly good
-
Re:Sqlite included!
I didn't mean that they only used some functions, but simply that they didn't write those functions or anything, they're just linking a library and exposing the API to Python.
Not exactly, they wrapped the library in a DBAPI2 compliant interface (DBAPI2 would be similar to Perl's DBI, it's an official standard DB interface published in PEP 249: the Python Database API Specification v2.0)
-
Re:In line conditionals, FINALLY
Indeed, I got puzzled about the choice for this syntax.
They explain why, whether one agrees or not with it, in this part of the release notes.
In short, there was some discussion on the mailing lists about whether the syntax should be, and no clear winner could be appointed. Then, the BDFL figured out that whenever conditional expressions are used, one of the values is usually the norm and the other the exception, thus, putting the normal value at the beggning of the expression made it for code readability.
From the URL above:
"""\
This syntax may seem strange and backwards; why does the condition go in the middle of the expression, and not in the front as in C's c ? x : y? The decision was checked by applying the new syntax to the modules in the standard library and seeing how the resulting code read. In many cases where a conditional expression is used, one value seems to be the 'common case' and one value is an 'exceptional case', used only on rarer occasions when the condition isn't met. The conditional syntax makes this pattern a bit more obvious:
contents = ((doc + '\n') if doc else '')
"""