• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(212)  |  Call(3)  |  Derive(0)  |  Import(209)
instance(class[, dict])

Create an instance without calling its __init__() method.
The class must be a classic class.
If present, dict must be a dictionary or None.

src/r/p/rpyc-3.0.7/rpyc/core/vinegar.py   RPyC(Download)
import sys
import exceptions
import traceback
from types import InstanceType, ClassType
from rpyc.core import brine
from rpyc.core import consts
 
 
    # support old-style exception classes
    if isinstance(cls, ClassType):
        exc = InstanceType(cls)
    else:
        exc = cls.__new__(cls)
 

src/p/y/pypy3-HEAD/pypy/rlib/objectmodel.py   pypy3(Download)
def instantiate(cls):
    "Create an empty instance of 'cls'."
    if isinstance(cls, type):
        return cls.__new__(cls)
    else:
        return types.InstanceType(cls)
 

src/p/y/pypy-HEAD/pypy/rlib/objectmodel.py   pypy(Download)
def instantiate(cls):
    "Create an empty instance of 'cls'."
    if isinstance(cls, type):
        return cls.__new__(cls)
    else:
        return types.InstanceType(cls)