Maya Python General Question

Would this statement be correct ?:

Attributes define nodes, methods and functions.

If you’re comparing Maya’s nodes to object-oriented programming, I’d say no:

A Maya node is an instance of a class, yes. This is shown in the nodal docs themselves, through their superclass hyperlinks.

But the attributes on the node store data only (float, int, string, etc), they aren’t class methods that ‘do’ something when called to.

Maya’s nodes have no ‘methods’.

That being said, I find it a fun exercise to make my own classes that wrapper node types, and expose this functionality (give them methods), it’s similar to what PyMel does.

In Maya…

Most data is represented with nodes, nodes have attributes, and attributes have data / connections

In Computer Science…

Functions are callable portions of code
Methods are functions that specifically belong to a class
Attributes are another term for class-level variables (most people call them “class variables” instead)

def this_is_a_function():
    pass

class MyClass(object):
    
    this_is_an_attribute = 5
    
    def __init__(self)
        pass
    
    def this_is_a_method(self)
        pass

The term Node is sometimes used when referring to the implementation of certain data structures such as a Linked List, but doesn’t mean anything on its own.