Did I find the right examples for you? yes no

All Samples(184)  |  Call(161)  |  Derive(0)  |  Import(23)
Return true if the object is a method descriptor.

But not if ismethod() or isclass() or isfunction() are true.

This is new in Python 2.2, and, for example, is true of int.__add__.
An object passing this test has a __get__ attribute but not a __set__
attribute, but beyond that the set of attributes varies.  __name__ is
usually sensible, and __doc__ often is.

Methods implemented via descriptors that also pass one of the other(more...)

        def ismethoddescriptor(object):
    """Return true if the object is a method descriptor.

    But not if ismethod() or isclass() or isfunction() are true.

    This is new in Python 2.2, and, for example, is true of int.__add__.
    An object passing this test has a __get__ attribute but not a __set__
    attribute, but beyond that the set of attributes varies.  __name__ is
    usually sensible, and __doc__ often is.

    Methods implemented via descriptors that also pass one of the other
    tests return false from the ismethoddescriptor() test, simply because
    the other tests promise more -- you can, e.g., count on having the
    im_func attribute (etc) when an object passes ismethod()."""
    return (hasattr(object, "__get__")
            and not hasattr(object, "__set__") # else it's a data descriptor
            and not ismethod(object)           # mutual exclusion
            and not isfunction(object)
            and not isclass(object))
        


src/m/o/modern-python-example-HEAD/lib/python2.7/site-packages/logilab/astng/raw_building.py   modern-python-example(Download)
import sys
from os.path import abspath
from inspect import (getargspec, isdatadescriptor, isfunction, ismethod,
                     ismethoddescriptor, isclass, isbuiltin)
 
                if name == '__class__' and class_node.parent is None:
                    class_node.parent = self._done[self._module]
            elif ismethoddescriptor(member):
                assert isinstance(member, object)
                object_build_methoddescriptor(node, member, name)

src/o/t/ottwatch-HEAD/lib/gdata/samples/apps/marketplace_sample/gdata/test_config.py   ottwatch(Download)
              or type(value) == property # Allow properties.
              or inspect.ismethod(value) # Allow methods. 
              or inspect.ismethoddescriptor(value) # Allow method descriptors.
                                                   # staticmethod et al.
              or issubclass(value, atom.core.XmlElement)):

src/g/d/gdata-2.0.18/samples/apps/marketplace_sample/gdata/test_config.py   gdata(Download)
              or type(value) == property # Allow properties.
              or inspect.ismethod(value) # Allow methods. 
              or inspect.ismethoddescriptor(value) # Allow method descriptors.
                                                   # staticmethod et al.
              or issubclass(value, atom.core.XmlElement)):

src/n/a/natto-0.1.7/natto/__init__.py   natto(Download)
        or inspect.ismemberdescriptor(data) \
        or inspect.ismethod(data) \
        or inspect.ismethoddescriptor(data) \
        or (options['modules'] == False and inspect.ismodule(data)) \
        or inspect.isroutine(data) \

src/j/i/jinja24doc-1.1.0/jinja24doc.py   jinja24doc(Download)
from jinja2 import Environment, FileSystemLoader, Undefined
from traceback import format_exception
from inspect import getargspec, getdoc, getmembers, getsource, formatargspec, \
        isfunction, ismethod, isclass, ismodule, \
        ismethoddescriptor, isgetsetdescriptor
 
            for nm, it in getmembers(item):     # class members
                if ismethod(it) or ismethoddescriptor(it) or isgetsetdescriptor(it):
                    try:
                        args, vargs, kwords, defaults = getargspec(it)

src/m/a/main-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/pydoc.py   main(Download)
def _is_some_method(obj):
    return inspect.ismethod(obj) or inspect.ismethoddescriptor(obj)
 
def allmethods(cl):
    methods = {}

src/m/a/main-HEAD/External.LCA_RESTRICTED/Languages/CPython/27/Lib/pydoc.py   main(Download)
def _is_some_method(obj):
    return inspect.ismethod(obj) or inspect.ismethoddescriptor(obj)
 
def allmethods(cl):
    methods = {}

src/p/y/pydroid-HEAD/src/pydroid/framework/project_skeleton/libs/python27/lib/python2.7/pydoc.py   pydroid(Download)
def _is_some_method(obj):
    return inspect.ismethod(obj) or inspect.ismethoddescriptor(obj)
 
def allmethods(cl):
    methods = {}

src/t/a/taxon-0.2.1/taxon/__init__.py   taxon(Download)
# coding: utf-8
"""Taxon: simple object taxonomy.
"""
 
from inspect import (
            classname = type(obj).__name__
        objname = obj.__name__
    elif ismethoddescriptor(obj):
        typename = 'methoddescriptor'
        cls = obj.__objclass__

src/m/a/main-HEAD/External.LCA_RESTRICTED/Languages/IronPython/27/Doc/sphinx/ext/autodoc.py   main(Download)
    def format_args(self):
        if inspect.isbuiltin(self.object) or \
               inspect.ismethoddescriptor(self.object):
            # can never get arguments of a C function or method
            return None
    def format_args(self):
        if inspect.isbuiltin(self.object) or \
               inspect.ismethoddescriptor(self.object):
            # can never get arguments of a C function or method
            return None

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