Jonkman Microblog
  • Login
Show Navigation
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. Hattie Cat (hattiecat@shitposter.club)'s status on Friday, 16-Feb-2018 20:23:11 EST Hattie Cat Hattie Cat
    Python is retarded. Brain-damaged scope rules make it hard to write closures. Compare the following. I hate you Guido, and your cult.

    def poo():
      x=42
      def moo():
         x += 1
        return x
      return moo

    m=poo()
    print m

    > UnboundLocalError: local variable 'x' referenced before assignment

    versus

    def poo():
       x=[42]
       def moo():
          x[0]+=1
          return x[0]
       return moo

    m=poo()
    print m

    > 43
     
    In conversation Friday, 16-Feb-2018 20:23:11 EST from shitposter.club permalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

Jonkman Microblog is a social network, courtesy of SOBAC Microcomputer Services. It runs on GNU social, version 1.2.0-beta5, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Jonkman Microblog content and data are available under the Creative Commons Attribution 3.0 license.

Switch to desktop site layout.