Posts/2011/01

Comments update and site to-do list

Having used DISQUS elsewhere as a commenter and not being a great fan of the default Blogger comment system, I've configured the blog to use DISQUS instead.

I've also asked to have the blog's python related posts added to the Planet Python feed, so we'll see how that pans out.

The main thing I'm still not entirely happy with is the site colour scheme - while I'm still a fan of the whole light-text-on-dark-background style, the contrast between clicked links and the current black background really isn't significant enough. I'll probably tinker with that a bit over the next few days.

Some goals for Python 3.3

With 3.2 nearly out the door, it's time to think seriously about goals for Python 3.3 and anything else I'd like to get done on the Python front this year. This post will serve as a to-do list of sorts.

PEP 1 Update
When cleaning up PEP 0 to clear out some of the accumulated cruft in the lists of Meta and Informational PEPs, I ran into a problem where the API specification PEPs use the "Final" state to indicate when consensus has been reached and the API has been locked in. This conflicts with the normal use of the Final state to indicate that a PEP is over a done with and is only being kept around for historical reasons.

A brief discussion on python-dev suggested "Consensus" as a new end state for these PEPs. I like that solution, but adopting it requires an update to PEP 1. I'd like to get to that sometime this year.

PEP 343 and 377, redux
There are a couple of rough edges on the with statement and the associated context management protocol that still bother me.

Firstly, the fact that there is no way for a context manager to skip the body of a with statement means certain constructs simply can't be factored out properly. I previously tried to address this with PEP 377, but that solution was rightly rejected as having too great an impact on common cases which didn't need the extra complexity. I have since thought of an alternative approach that is both more flexible and has a much lower impact on ordinary cases, so it has a higher chance of acceptance.

Secondly, I'd like to revisit the idea of implicit context managers. These were dropped from PEP 343 due largely to terminology problems - we weren't sure whether the term "context manager" referred to objects with enter and exit methods, or to the objects that were able to create such an object on demand. With the meaning of context manager now well established, I believe it should be possible to implement and document this in a way that makes intuitive sense, while making it significantly easier to write context managers that are both stateful and reusable.

That's my __name__, don't wear it out
As per a recent python-ideas discussion, __name__ currently serves multiple masters, which leads to conflicts in certain situations (with __name__ set to a value that is correct for some purposes, but wrong for others). This is especially prevalent with the __main__ module, but can also apply to pseudo-packages, where something is documented as a single unified namespace, but is actually implemented as multiple files combined into a package.

For Python 3.3, I'd like to have a mechanism in place to start sorting this out without breaking every Python script on the planet that relies on the "if __name__ == '__main__':" idiom.

Other PEPs (e.g. PEP 380, 393)
There are a few other PEPs that will hopefully be landing for 3.3, including the subgenerator and memory efficient string PEPs. While I probably won't take much of an active hand in implementing those, there will still be plenty of related python-dev discussion and checkins to review.

And on a completely non-code-related front... with any luck I'll be able to find myself a more directly open source focused job this year. I have the luxury of being fussy in my choice of employment though, so I can happily sit back and relax while waiting to see how that pans out :)

Which matters more to you: being right or staying friends?

Browsing through the Religious Tolerance site, I felt inspired to turn my Ethos post into a Visitor Essay submission. I have no idea if they will ever post it (as it turns out, they did so quite promptly, here), but decided to put the whole thing up here (after the jump) regardless.

The role of faith in my life has been a varied one. My parents are Roman Catholics (albeit ones with more than a few issues with the way the Church hierarchy run the show), and so I grew up doing the traditional Roman Catholic thing - convent primary school (although there were no teaching nuns by the time I came through) followed by a Christian Brothers high school (although again, one with mostly lay teachers). Church on Sunday was a weekly family ritual, and after drifting away into the typical agnosticism of the Australian teenager, I rediscovered my faith through the National Evangelisation Teams program. Enthused about my faith again, I started actually studying it - reading the Bible, looking at church teachings, that kind of thing. But something strange happened - the more I studied, the more hollow it all seemed. I *didn't* agree with everything the Bible said, or everything the Church taught, and neither did my parents. Clearly I was using something else as the basis for my moral decisions in which Church teachings I chose to agree with and which I chose to reject, but what was it?
A Star Wars fan website (of all things [1]) led me to encounter the phrase "secular humanism". Reading up on that, I found it agreed perfectly with the criteria I had been applying in picking and choosing amongst the teachings of the Catholic Church. I was happy to have found a term for my beliefs that focused on what I believed in, rather than simply highlighting one thing I had chosen to reject (i.e. "atheism"). One cognitive science degree and a whole lot of reading later (including the likes of Dawkins, Dennett, Hofstadter, Pinker and Sagan), and I was even happier with the idea of a world where we create our own meaning rather than having it passed down to us from on high.
The journey from childhood faith, through teenage agnosticism to adult faith and my eventual deliberate choice of a naturalistic world view was something that involved a lot of thought and introspection, that I was fortunate enough to have the time for. However, it left me with a problem. Many of my family are still devout (or not-so-devout) Catholics and my friends embrace a variety of religious traditions. How could I align what I had discovered for myself with their different points of view, without coming off (to myself or to others) as a condescending twit making allowances for the "less enlightened"?
The militant atheists (such as Dawkins) often come across as wanting to see the religious baby thrown out with the fundamentalist bathwater. Others (such as Dennett) are able to put forward a more nuanced view, that attempts to better understand the whole of religion, so that we can more effectively harness the positive aspects while reducing the negative effects. Having been a believer as an adult, and having suffered no significant negative experiences through my faith, I have a much easier time seeing the good side of religious belief than many atheists, so Dennett's line of rapprochement seemed far more appealing to me.
Eventually, I was able to distil my personal ethos down into a belief that the pillars of ethical and moral living consist of just 5 basic concepts: honesty, compassion, justice, freedom and hope. As I see it, we have to believe in something, otherwise nihilism wins and there is no point in getting out of bed in the morning. For myself, and humanists like me, I see those five things as products of evolution. I see them as glorious, beautiful things in their own right, the most profound creations of the human race. It is up to each of us to honour and steward each of the principles as best we can. Others choose to see those 5 principles as something that was gifted to us by a higher power, rather than something we created collectively ourselves over the course of time. I don't agree with such beliefs, but that is only because I see them as unnecessary. In practice, if the outcome is a personal faith that accepts and promotes the same 5 principles I believe in, then I don't really care all that much as to why somebody agrees they're important.
Where I start to have an issue is when groups and individuals either consciously or inadvertently start to disrespect those ideals. Whether the offenders are governments, organised religions, corporations, or specific individuals, malicious deceit, discounting of the feelings of others, inequitable treatment, unnecessary coercive restraints and excessive pessimism and fatalism are all concepts I have fundamental problems with. Of course, balancing all of those principles means that there are many situations encountered in the real world that have no right answers, only less bad wrong ones, which is why reasonable people may disagree on the correct courses of action. Simply "getting rid of religion" doesn't magically make the underlying issues go away.
The dangerous religions are the ones that create a priestly caste and then say to everyone else "It's complicated, it's a mystery, don't worry your pretty little head about it". By convincing people to shut down their capacity for critical thinking, they are trampling over a number of those principles I value (especially honesty and freedom). Religious traditions that instead encourage their believers to adopt an attitude of constant questioning are far more compatible with the humanist point of view, as it allows members of that faith to make their own judgments based on universal ethical principles in addition to the teachings of that specific tradition.
This separation of beliefs from consequences (similar to the distinction made between beliefs and actions here at OCRT) and individual believers from religious organisations was the insight I needed to realise that it was possible to be religiously tolerant without feeling (or being) condescending about it.
[1] For the record, it was Stardestroyer.net