Search This Blog

Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Wednesday, June 15, 2016

Break is goto in disguise

On the python list there was a discussion about break.  I made the comment that break is just a euphemism for goto.  I thought that this would be a commonplace. However google does not give many useful hits for this.

So thought I'd cook up an example.
Here is Apple's famous SSL-bug in shortform

Saturday, April 19, 2014

Unicode in Python

1 Introduction

Python has been making long strides in embracing unicode. With python 3 we are at a stage where python programs can support unicode well however python program-source is still completely drawn from the ASCII subset of unicode.
Well… Actually with python 3 (not 2) this is already possible
def solvequadratic(a,b,c):
    Δ = b*b - 4*a*c
    α = (-b + sqrt(Δ))/(2*a)
    β = (-b - sqrt(Δ))/(2*a)
    return (α, β)

>>> solvequadratic(1,-5,6)
(3.0, 2.0)
>>>
Now to move ahead!

Wednesday, May 1, 2013

Dance of Functional Programming

Languaging with Haskell and Python


Friday, July 27, 2012

We dont need no Ooooo-Orientation – 3

In my earlier posts Ive discussed some context around why OO has been one of the more dismal failures in the history of IT/CS.
Here I talk of the error in thinking 'inheritance'.
And this gives the philosophical separation between those drawn to OOP and those not.

Before I come to the meat of the matter – why OO sucks – it would be good in all fairness, to deal with the

Very few successes of OOP