Skip to content

Instantly share code, notes, and snippets.

@2tony2
Created May 22, 2024 07:47
Show Gist options
  • Select an option

  • Save 2tony2/ee3c34c326f02b58e50d6e263bf9dbee to your computer and use it in GitHub Desktop.

Select an option

Save 2tony2/ee3c34c326f02b58e50d6e263bf9dbee to your computer and use it in GitHub Desktop.
import inspect
# Get the class definition of the object
print(inspect.getmembers(pipeline))
# Output: [('__class__', <class '__main__.DataPipeline'>), ('__delattr__', <method-wrapper '__delattr__' of DataPipeline object at 0x7f8b6f3b1f10>), ('__dict__', {'name': 'ETL Pipeline', 'batch_size': 500, 'status': 'inactive'}), ('__dir__', <built-in method __dir__ of DataPipeline object at 0x7f8b6f3b1f10>), ...]
# Get the signature of the __init__ method
print(inspect.signature(DataPipeline.__init__))
# Output: (self, name: str, batch_size: int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment