The Lochs was the second-weakest ward for the SNP in the whole of Fife in the 2012 local elections (the only worse one was the rarefied setting of St Andrews). They put up only one candidate, who finished third and received just 19% of the vote, a whopping 27% behind the combined support for Labour's two candidates. Remember all of that happened on a day when, across Scotland, the SNP defeated Labour in the popular vote by 1%. So on paper, this should be just about as tough a ward for Nicola Sturgeon's party as you'll find anywhere - but you certainly wouldn't know that from the by-election result yesterday. The SNP stormed into second place, and slashed Labour's lead to just 8.5%.
Labour 47.1% (+0.7)
SNP 38.6% (+19.6)
Conservatives 9.6% (+7.0)
Communists 3.1% (n/a)
Greens 1.6% (n/a)
As almost always seems to be the case, the quirks of the STV voting system are allowing some fairly extreme misinformation to do the rounds about the result. Labour are claiming to have "turned the tide" with a "gain". Well, yes, it's technically true that they "gained" the seat, in the sense that the vacancy was caused by the retirement of an independent councillor - but Labour topped the poll in the ward last time and did so again yesterday. Their vote effectively flatlined, in spite of the fact that a huge number of votes that had previously gone to the independent were now up for grabs.
On the other extreme, some people have claimed that the swing from Labour to the SNP was as high as 17%. I've squinted at the result in a number of different ways to try to understand where that figure has come from, but I'm mystified. Suffice to say it's inaccurate - the real swing was around 9.5%, which is plenty enormous enough to be getting on with.
UPDATE : It turns out that the 17% swing is not measured from the 2012 result at all, but from another by-election in the ward that was held in June 2014. Well, I suppose that can be justified, although 2012 is the more natural baseline, and allows for direct comparisons with other recent by-elections.