you are viewing a single comment's thread
view the rest of the comments
[–] 0 points 9 months ago* (3 children)

that's a class method not a function tho

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 9 months ago (2 children)

    AFAIK the syntax seems to be the same.

    def sayHam():
        print("Ham")
    
    sayHam()
    

    works when typed into the Python console, no class needed. I program as a hobby, I'm no expert on the language, but does Python even differentiate between functions and class methods internally? Other than just scope? There's a possibility I'll learn something today.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 9 months ago (1 child)

    I thought python was one of those weird OOP languages like Java or C# that bound all classless methods to some universal static class but im wrong on that.

    They are out there though so be on the lookout for these languages that doesnt believe in algebra.

  • source
  • parent
  • hideshow 1 child comment