Python Programming, news on the Voidspace Python Projects and all things techie.
Python 2.5 isn't even out of the door yet and Python 2.6 features are already being discussed.
This would add a new piece of language syntax, the make statement. It allows you to create custom (named) namespaces without all the machinery overhead of the class statement.
I often use classes to create namespaces for related attributes, so I might use this .
There is a danger in adding new syntax to the language. Python 2.4 and 2.5 have both done this, with decorators, generator expressions, the with statement and conditional expressions . Python 2.6 already proposes to do this by changing the import semantics in the form of relative imports.
This creates two difficulties.
- When using new syntax features it is basically impossible to write code that will still work on previous versions. Even if you check the Python version at runtime, to ensure that the code is only executed on an interpreter that can handle it, the parser will still choke.
- It raises the bar for people trying to learn the language. When looking at code they have to be able to recognise more language constructs to have a chance of understanding what is going on.
Python doesn't suffer from being defined by a standards body, choking all possible improvement, but it seems to be growing rapidly. I believe that Python is in good hands, and some of the recent additions add great power in the right hands. Having said that, the reason I fell in love with Python was the emphasis it placed on readability and clarity. I hope those taking Python into new and uncharted territory remember axiom number three from the Zen of Python :
Simple is better than complex.
|||Or at least being discussed...|
|||Various other use cases are discussed in the PEP, including the suggestion that it could replace the class statement entirely.|
|||Plus the new unified try/except/finally.|
I've got a few days off whilst I'm in between jobs. We move on Friday, so the next couple of days will be very hectic. In the meantime I'm doing a hasty update to one of my programs.
It is similar to the cyberspace envisioned by William Gibson, but more of the details are fleshed out. From my point of view, the most exciting thing about it, is the ability to create new things. Stephenson doesn't describe the mechanics of virtual matter and energy, but programmers are able to create new and working objects like motorcycles.
I've searched the web  to look for the hackers who are creating the Metaverse. Despite the rise of the MMORPG, where people can interact in virtual worlds, I can find nothing similar. All the ones I've seen have a fixed and rigid infrastructure. Objects must be built into to the fabric of the world, so you're unable to create new ones from the inside.
I'll have to wait, or build the Metaverse myself.
I was explaining to a friend recently how humans had managed to create such complex things as computers.
Computers are (currently) based on silicon wafers, with circuits containing hundreds of thousands of transistors - switches.
Despite the complexity of modern devices, they are built from combinations of circuits comprised of very simple components. At their heart, microprocessors are still descendants of mechanical devices like The Difference Engine of Charles Babbage.
The basic component of the human is the cell. A cell is a phenomenally complex device, a miniature chemical factory that operates on the quantum interaction of its inner workings. Each of us have hundreds of millions of these cells.
So despite packing untold numbers of transistors onto silicon wafers, humans are still a long way off achieving anything remotely approaching the complexity of the human body (and mind).
|||The philosophical (or Spiritual whichever floats your boat) suppositions are predicated on the fact that the resurrection is a myth.|
|||The real world it describes is a little silly for my tastes, the virtual world on the other hand...|
In working on rest2web I've realised that it would be very easy to support other markups.
The ones that spring to mind are :
Would anyone find that useful ?
<* uservalue *>
This allows uservalues to contain ReST and still be turned into HTML.
|||Although it seems that wiki markup is a nebulous concept, with every Wiki having its own variant. Anyone know of a good standalone Wiki-format-to-html module for Python ? Bonus points for not suggesting I extract the rendering engine from MoinMoin but providing a link to the right module instead.|
|||I anticipated this, but I didn't realise how serious it was. Now that I'm making uservalues more general I have to fix it.|
There has been some tangible progress on rest2web at last.
There is an updated version in the SVN Repository.
rest2web now supports three levels of verbosity via command line options :
- -v Verbose (the default)
- -a Actions & Warnings Only
- -w Warnings Only
There is currently a bug in the handling of the file keyword when use in conjunction with the index-file keyword.
The file bug is now fixed in SVN.
After this there are several new features to be added before the next release.
Other rest2web news; the Leipzig Python User Group are having a meeting on April 11th. Mike Müller is giving a talk on rest2web. Shame it's a bit far for me to go, but it should be interesting.
New CGI Repository
This one is for my CGI Projects, and can be found at :
This contains the following projects (each in their own folder on the trunk ) :
File download Manager.
The Voidspace Python Guestbook.
An authentication and user account framework for CGI applications.
Interface to the Akismet anti-spam web service. It includes an example CGI.
A Python CGI proxy with a couple of related programs.
A simple script to provide a contact/feedback form on a website. Undocumented, but easy to use.
An online anagram server script.
A simple example that shows how to use the logintools framework. This examples protects static html files behind a login.
A couple of scripts that can redirect users to a randomly chosen URL.
A CGI search engine that uses the Yahoo Web Services. Undocumented, but the code is well commented.
A simple script that counts visitors to a webpage.
Of particular interest may be the following :
The version in SVN has several improvements over the latest released version. It has a couple of bugfixes, uses the akismet.py interface, and has additional anti-spam measures.
Both of these are previously unreleased. I was going to wait until I had time to write documentation and make a few improvements, but in the meantime...
A lot of this code is quite old, Nanagram-CGI was one of the first programs I wrote. Despite this, my CGI page is one of the most popular on my site. It got around five thousand visits in March.
The reason for getting the repository is that I will be writing an application soon(-ish) that will integrate logintools and downman. Although that won't be Open Source, it ought to lead to considerable improvements in both.
I also need to do a new release of the guestbook before giving it the complete refactor it needs (which will add an administrative interface, amongst other things). I'm not sure when this will happen though.
|||There are also copies of released versions, where appropriate, in tags.|
This work is licensed under a Creative Commons Attribution-Share Alike 2.0 License.