Hacker Newsnew | past | comments | ask | show | jobs | submit | voidiac's commentslogin

Python's implementation of sum doesn't care about types, the function looks something like:

    def sum(iterable):
        r = 0
        for v in iterable:
            r += v
        return v

it always starts with an integer, and since int.__add__(str) returns NotImplemented it tries str.__radd__(int) instead, which raises an AttributeError because str has no method __radd__, so no summing of strings and integers.


Actually Python does explicitly reject strings.

  >>> sum(['hello', ' world'], '')
  TypeError: sum() can't sum strings [use ''.join(seq) instead]
But this is done explicitly against strings. They would _just work_ if not for this restriction, because based on usage they should work.


Dividing Europe based on language would make more sense: romance languages in the west, germanic in the centre and slavic in the east.


except of course romanian and moldovan are romance (very much east), as is Rumantsch (very much centre)


And of course our dear Western neighbors, the Hungarians, who are as odd-ball as the Fins and Estonians :)


Most cubes I've seen seem to have metal springs.


The name is confusing, the first thing i thought of was an SMTP-server.


Ireland and Great Britain are islands. On these two islands are two sovereign states: Ireland and the United Kingdom of Great Britain and Northern Ireland (also known as UK). The UK consists of four parts: England, Wales and Scotland on the island of Great Britain and Northern Ireland on the island of Ireland.

.ie is the domain of the state Ireland. .uk is the domain of the UK.


Branching would be something like:

  case JMP: {
    ip = program[ip + 1] - 1;
    break;
  }


Register based VMs are not more complex than stack based VMs. You can even have a stack and the only difference is that your instructions operate on registers and not directly on the stack. I only consider generating code more complex with a register based VM.

If you are interested here is a toy vm I wrote myself: https://github.com/byo3rn/ire

PS: I suck at documentation.


There are some more problems with the flags. The colours of the french and german flag are in the wrong order. The icelandic and norwegian flags are missing the white line around the cross. The class for the netherlands shouldn't be lb-flag-holland.


You can still go there.


That would be "Nous sommes Charlie".


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: