GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Philip May
  • Machine Learning
  • Python
  • IT
  • Linux
  • Blog
  • About Me
  • Backoff
  • Beautiful Soup
  • Black
  • Colab
  • Collections
  • Conda
  • Context Manager

This view

  • Original page
  • New address

GeezerVison is showing philipmay.org — Python Naming — Philip May

Python Naming#

This is about how things are named in Python.

Classes#

  • class object: the raw class itself (not instantiated) (see here)

  • instance object or instance of a class: an instantiated class like x = MyClass() (see here)
    an instance object has two kinds of valid attribute names:

    • data attributes: are variables belonging to the instance, attributes need not be declared - like local variables - they spring into existence when they are first assigned to

    • methods: method is a function that “belongs to” an object

  • class variables: for attributes (and methods) shared by all instances of a class (see here)

  • instance variables: for data unique to each instance (see here)

classmethod#

see https://www.geeksforgeeks.org/class-method-vs-static-method-python/

staticmethod#

see https://www.geeksforgeeks.org/class-method-vs-static-method-python/

constructor vs. initializer vs. allocator (__init__)#

see https://stackoverflow.com/a/6578504

On this page
Edit on GitHub
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.