MCPcopy Create free account
hub / github.com/cloudpipe/cloudpickle / instance

Function instance

cloudpickle/cloudpickle.py:495–508  ·  view source on GitHub ↗

Create a new instance of a class. Parameters ---------- cls : type The class to create an instance of. Returns ------- instance : cls A new instance of ``cls``.

(cls)

Source from the content-addressed store, hash-verified

493
494
495def instance(cls):
496 """Create a new instance of a class.
497
498 Parameters
499 ----------
500 cls : type
501 The class to create an instance of.
502
503 Returns
504 -------
505 instance : cls
506 A new instance of ``cls``.
507 """
508 return cls()
509
510
511@instance

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected