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

All Samples(899)  |  Call(814)  |  Derive(0)  |  Import(85)
Return true if the object is an instance method.

Instance method objects provide these attributes:
    __doc__         documentation string
    __name__        name with which this method was defined
    im_class        class object in which this method belongs
    im_func         function object containing implementation of method
    im_self         instance to which this method is bound, or None

        def ismethod(object):
    """Return true if the object is an instance method.

    Instance method objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this method was defined
        im_class        class object in which this method belongs
        im_func         function object containing implementation of method
        im_self         instance to which this method is bound, or None"""
    return isinstance(object, types.MethodType)
        


src/i/p/ipython-py3k-HEAD/IPython/core/ultratb.py   ipython-py3k(Download)
import types
 
# For purposes of monkeypatching inspect to fix a bug in it.
from inspect import getsourcefile, getfile, getmodule,\
     ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode
 
# IPython's own modules
        else:
            raise IOError('could not find class definition')
 
    if ismethod(object):
        object = object.__func__
    if isfunction(object):
        object = object.__code__

src/z/a/zamboni-lib-HEAD/lib/python/logilab/astng/builder.py   zamboni-lib(Download)
 
import sys
from os.path import splitext, basename, dirname, exists, abspath
from inspect import isfunction, ismethod, ismethoddescriptor, isclass, \
     isbuiltin
from inspect import isdatadescriptor
 
                # damned ExtensionClass.Base, I know you're there !
                attach_dummy_node(node, name)
                continue
            if ismethod(member):
                member = member.im_func
            if isfunction(member):
                # verify this is not an imported function

src/t/o/topographica-HEAD/releases/0.9.7/topographica/topo/misc/asizeof.py   topographica(Download)
 
from __future__ import generators  #PYCHOK for yield in Python 2.2
 
from inspect    import isbuiltin, isclass, iscode, isframe, \
                       isfunction, ismethod, ismodule, stack
from math       import log
from os         import linesep
        elif isfunction(obj):
            v.set(refs=_func_refs,
                  both=False)  # code only
        elif ismethod(obj):
            v.set(refs=_im_refs,
                  both=False)  # code only
        elif isclass(t):  # callable instance, e.g. SCons,

src/t/o/topographica-HEAD/topographica/topo/misc/asizeof.py   topographica(Download)
 
from __future__ import generators  #PYCHOK for yield in Python 2.2
 
from inspect    import isbuiltin, isclass, iscode, isframe, \
                       isfunction, ismethod, ismodule, stack
from math       import log
from os         import linesep
        elif isfunction(obj):
            v.set(refs=_func_refs,
                  both=False)  # code only
        elif ismethod(obj):
            v.set(refs=_im_refs,
                  both=False)  # code only
        elif isclass(t):  # callable instance, e.g. SCons,

src/t/o/topographica-0.9.7/topo/misc/asizeof.py   topographica(Download)
 
from __future__ import generators  #PYCHOK for yield in Python 2.2
 
from inspect    import isbuiltin, isclass, iscode, isframe, \
                       isfunction, ismethod, ismodule, stack
from math       import log
from os         import linesep
        elif isfunction(obj):
            v.set(refs=_func_refs,
                  both=False)  # code only
        elif ismethod(obj):
            v.set(refs=_im_refs,
                  both=False)  # code only
        elif isclass(t):  # callable instance, e.g. SCons,

src/p/y/Pympler-0.1/pympler/asizeof/asizeof.py   Pympler(Download)
 
from __future__ import generators  #PYCHOK for yield in Python 2.2
 
from inspect    import isbuiltin, isclass, iscode, isframe, \
                       isfunction, ismethod, ismodule, stack
from math       import log
from os         import linesep
        elif isfunction(obj):
            v.set(refs=_func_refs,
                  both=False)  # code only
        elif ismethod(obj):
            v.set(refs=_im_refs,
                  both=False)  # code only
        elif isclass(t):  # callable instance, e.g. SCons,

src/p/r/Products.DocFinderTab-1.0.4/Products/DocFinderTab/analyse.py   Products.DocFinderTab(Download)
from Products.DocFinderTab.config import FILTER_ROLES   # DFT
from Products.DocFinderTab.config import FILTER_METHODS # DFT
 
from inspect import isclass, ismethod, \
     isfunction, ismethoddescriptor, \
     getmro, \
     getargspec, formatargspec, \
    if isinstance(obj, (staticmethod, classmethod)):
        return obj.__get__(obj).__doc__
    if FILTER_METHODS:
        if isfunction(obj) or ismethod(obj) or ismethoddescriptor(obj):
            if not obj.__doc__: return 'method'
    return obj.__doc__
 
def _findArgSpec(maybeFunction):
  '''the argument specification for *maybeFunction* or an exception.'''
  if isclass(maybeFunction):
    maybeFunction= getattr(maybeFunction,'__init__',_id)
  if isinstance(maybeFunction, (staticmethod, classmethod)):  # DFT
    maybeFunction= maybeFunction.__get__(maybeFunction)
  if ismethod(maybeFunction):

src/c/l/clonedigger-HEAD/trunk/clonedigger/logilab/astng/builder.py   clonedigger(Download)
from os.path import splitext, basename, dirname, exists, abspath
from parser import ParserError
from compiler import parse
from inspect import isfunction, ismethod, ismethoddescriptor, isclass, \
     isbuiltin
from inspect import isdatadescriptor
 
                # damned ExtensionClass.Base, I know you're there !
                attach_dummy_node(node, name)
                continue
            if ismethod(member):
                member = member.im_func
            if isfunction(member):
                # verify this is not an imported function

src/c/l/clonedigger-HEAD/pretty_printing/clonedigger/logilab/astng/builder.py   clonedigger(Download)
from os.path import splitext, basename, dirname, exists, abspath
from parser import ParserError
from compiler import parse
from inspect import isfunction, ismethod, ismethoddescriptor, isclass, \
     isbuiltin
from inspect import isdatadescriptor
 
                # damned ExtensionClass.Base, I know you're there !
                attach_dummy_node(node, name)
                continue
            if ismethod(member):
                member = member.im_func
            if isfunction(member):
                # verify this is not an imported function

src/c/l/clonedigger-HEAD/for_evalution/clonedigger/logilab/astng/builder.py   clonedigger(Download)
from os.path import splitext, basename, dirname, exists, abspath
from parser import ParserError
from compiler import parse
from inspect import isfunction, ismethod, ismethoddescriptor, isclass, \
     isbuiltin
from inspect import isdatadescriptor
 
                # damned ExtensionClass.Base, I know you're there !
                attach_dummy_node(node, name)
                continue
            if ismethod(member):
                member = member.im_func
            if isfunction(member):
                # verify this is not an imported function

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next