You can use classes to hold class (or shared) attributes or to create class instances. To create
an instance of a class, you call the class as if it were a function. For example, consider the
following class:
class MyClass:
pass
Copy to clipboardCopied to clipboard
Here, the pass statement is used because a statement
is required to complete the class, but no action is required programmatically.
The following statement creates an instance of the class MyClass:
About cookies on this siteOur websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising.For more information, please review your cookie preferences options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.