Leaving a short-term teaching position early I'm a little over a month into a 9-month teaching position, to cover two semesters' worth of courses.  It's my first "proper" job since finishing my PhD.  I've just been offered a 2 1/2-year postdoc (which I'd much rather do than my current job), and been told that the latest I could take it up by is 2/3 the way through next semester.  So if I left to take up the postdoc, my current department would have to find someone else for (at least part of) next semester's courses.

According to the terms of my contract, I'm within my rights to leave, giving 3 months' notice. But if I did that, would I piss the department off so much as to find myself in some way blacklisted in years to come?
You need to talk with someone in the department about how to handle this (presumably the teaching coordinator, or chair, or whoever hired you).  In the sorts of departments/universities I'm familiar with, it would be difficult to arrange for someone else to take over a course partway through the semester.  Then your options might be teaching the whole course or leaving a semester early, and in the latter case they might need to know soon to line up a replacement.  On the other hand, it's possible that something very different could work out, depending on the local situation.


  But if I did that, would I piss the department off so much as to find myself in some way blacklisted in years to come?


Maybe, if you announce a decision without consulting with them and if that decision is extremely inconvenient.  However, it sounds like a reasonable thing to request, if you're flexible about trying to meet the department's needs as well (for example by quitting in between semesters rather than partway through the spring).