Method
Method ¶
Method(method, cls, skip_self: bool = True)
Bases: Function
The Method class represents a method of a class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
method
|
Callable
|
The method to be inspected. |
required |
cls
|
type
|
The class to which the method belongs. |
required |
skip_self
|
bool
|
Whether to skip the self parameter. |
True
|
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
The name of the method. |
docstring |
str
|
The docstring of the method. |
has_docstring |
bool
|
Whether the method has a docstring. |
description |
str
|
The description part of the method's docstring. |
params |
list[Parameter]
|
A list of parameters of the method. |
dict |
dict
|
A dictionary representation of the method's attributes. |
is_static |
bool
|
Whether the method is static. |
is_classmethod |
bool
|
Whether the method is a classmethod. |
is_property |
bool
|
Whether the method is a property. |
is_private |
bool
|
Whether the method is private. |
is_protected |
bool
|
Whether the method is protected. |
is_public |
bool
|
Whether the method is public. |
is_inherited |
bool
|
Whether the method is inherited. |
Source code in objinspect/method.py
split_args_kwargs ¶
Split the arguments passed to a function into positional and keyword arguments.