Python Gotchas

Last year, I got involved in trying to teach programming to school kids – this was via the excellent https://www.codeclub.org.uk/ enterprise. During this, I collated a series of Python “gotchas”, which I still think is worth sharing. As a friend of mine put it:

“The problem is that python is good, except where it does stupid things. Python programmers mostly trip over the stupid things fairly quickly, right themselves, and work around them forever, and forget that they are stupid.” – Aquarion

So, here is my list. If you think you have a good new one, please add in the comments.

  1. Tuples are immutable.
  2. Case Matters.
  3. Integer division trucates. (__import__ future, float cast)
  4. Classes have to inherit object to be derivable from.
  5. Type of bracket plethora-rama.
  6. Unicode.
  7. List string concatenation with .join().
  8. Shallow copies of dicts (.deepcopy())
  9. Default arguments in Python (dragons).
  10. Tabs vs Spaces.
  11. == vs is.
  12. Dictionaries are unordered.
  13. Scope, particularly scope in loops.

My relationship with exercise and depression

One of the things that depressed people are (nearly) always told to try and do to combat their depresson is “Do some exercise!”. This sounds wonderful advice. Leaving aside the obvious problems such as when you are depressed, getting out of bed is an achievement, I have have another issue:

Exercise depresses me

I don’t seem to get the same endorphin thing that many other people get out of exercise. I do not feel “better” when I have done exercise. I feel cruddy, I feel tired, and I feel depressed. It lowers my mood; it makes me worse.

Of course, there are the obvious health benefits of being fitter, and so I have to play it careful. I can only do exercise when I am in a stable mental state, otherwise it will send me off from a “low” to a “depression”. I have to harbour my physical state against my mental state. This makes it all the harder to try and manage my condition.

Many people have difficulty understanding this, and the reason I am writing it down, is so I do not have to keep repeating it.

  • If I am feeling down, please don’t suggest exercise to make me feel better.
  • If I look OK, and you suggest a physical activity, and I decline because I am feeling fragile, please understand that I am protecting my mental health.
  • I do understand that I am overweight, and unfit, but I am trying to control these as best as I can.

My Personal Gender and Sexuality

A work in Progress

When I was a child, I often fantasised about switching gender. The net had only just been invented, and was not as pervasive as it is now. As I grew older, and became sexual, knowing nothing of non-binary gender, I compartmentalised myself. There was nothing I knew apart from male and female. Even feeling that I had aspects of both was weird and frowned upon – I remember strongly my mother having a go at me for dressing up in women’s clothes. Knowing no other course, I split myself into a male persona, and a female persona.

When I arrived at university, I discovered the net, and also came out to myself as bisexual. I still knew nothing of non-binary gender, I just could love and be aroused by “both” genders. The word “bisexuality” was new to me, and I only discovered it by hanging out on the usenet group alt.homosexual. Yes, it was that bad.

Non-binary gender was still unknown to me. I still separated myself into “Jon” (being furry, bearded and having a penis, this was my default), and “Lucy” (who I could only be rarely, usually on my own, and very rarely with a close friend or partner).

At university, a friend also introduced me to Neil Gaiman’s Sandman, and The Books of Magic. I cried when I read “A Game of You”. Then there is the sequence in Book 3 of The Books of Magic, when Doctor Occult takes Timothy into Faerie, and becomes Rose. It was the first time I had ever seen/read it in a way that really resonated to me. For the first time, I felt not alone in having this split gender/persona thing.

I now know about non-binary gender, and I wish I had known about it as a teenager. Having lived as two separate personas for over 20 years, my brain cannot repattern so easily. I have lived this way for so long, I do not know if I can recombine these two distinct personalities into one, and become a new “me”. I still identify as bisexual, as I have been a bisexuality activist for so long. As for my gender, I consider myself “third gender”, although my behaviour is bigender

I am Jon, and I am Lucy. In another age, we would be one.

So, I created a blog

I never thought I would do this. Basically, I have been writing essays and opinion pieces on my own personal webspace, and it was pointed out to me that this is an activity probably better done with a blog. I asked around, thought hard, and for the moment, I will host this on wordpress.com.

Anyway, there is going to be a burst of activity as I port some of my articles over from my previous static webspace.

WARNING

My posts will refer to sex, sexuality, gender, computing, bit twiddling, and may well involve swearing.