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

All Samples(90637)  |  Call(88276)  |  Derive(2345)  |  Import(16)
type(object) -> the object's type
type(name, bases, dict) -> a new type

src/l/a/Langtangen-HEAD/src/py/examples/type.py   Langtangen(Download)
        raise TypeError, \
              'remove() argument 1 must be a string '\
              'or a list, not a %s' % type(files)
    for file in files:
        print 'removing',
def typecheck_types(i):
    for t in types_types:
        if type(i) == t:
            print t,
 
            print c,
 
type_types = (type(1), type([]), type(()), type({}), type(''),
              type(u''), type(1.0), type(MyClass('')))
 

src/p/e/personis-0.933/personis/examples/aelog/apiclient/discovery.py   personis(Download)
  """
  if schema_type == 'string':
    if type(value) == type('') or type(value) == type(u''):
      return value
    else:
    return str(bool(value)).lower()
  else:
    if type(value) == type('') or type(value) == type(u''):
      return value
    else:

src/c/l/clearsilver-0.10.1/clearsilver/python/examples/base/odb.py   clearsilver(Download)
 
        else:
            if type(data) == type(long(0)):
                return "%d" % data
            else:
    def _fixColMatchSpec(self,col_match_spec, should_match_unique_row = 0):
        if type(col_match_spec) == type([]):
            if type(col_match_spec[0]) != type((0,)):
                raise eInvalidMatchSpec, "invalid types in match spec, use [(,)..] or (,)"
        elif type(col_match_spec) == type((0,)):

src/p/y/py_examples-HEAD/phonon/kakawana-read-only/src/kakawana/feedparser.py   py_examples(Download)
            return [(tag['scheme'], tag['term']) for tag in UserDict.__getitem__(self, 'tags')]
        realkey = self.keymap.get(key, key)
        if type(realkey) == types.ListType:
            for k in realkey:
                if UserDict.has_key(self, k):
    def __setitem__(self, key, value):
        for k in self.keymap.keys():
            if key == k:
                key = self.keymap[k]
                if type(key) == types.ListType:
        attrsD = dict(attrs)
        baseuri = attrsD.get('xml:base', attrsD.get('base')) or self.baseuri
        if type(baseuri) != type(u''):
            try:
                baseuri = unicode(baseuri, self.encoding)
                output = _sanitizeHTML(output, self.encoding, self.contentparams.get('type', 'text/html'))
 
        if self.encoding and type(output) != type(u''):
            try:
                output = unicode(output, self.encoding)

src/t/o/Toolserver-0.4.1/samples/MailCheck.py   Toolserver(Download)
	def validateEmail_pre_condition(self, email):
		assert type(email) == type(''), 'email addresses must be ascii string'
 
	def validateEmail_post_condition(self, result):
		assert type(result) == type({})
		assert type(result.get('valid', None)) == type(1), 'validity flag must be integer'

src/p/y/pypy-HEAD/pypy/interpreter/pyparser/test/unittest_samples.py   pypy(Download)
        if trace and not trace[1:] and index == trace[0]:
            buf.append('\n----> ')
        if type(elt) is int:
            if names:
                buf.append(name(elt))
            else:
                buf.append(str(elt))
            buf.append(', ')
        elif type(elt) is str:
def assert_tuples_equal(tup1, tup2, curpos = ()):
    for index, (elt1, elt2) in enumerate(zip(tup1, tup2)):
        if elt1 != elt2:
            if type(elt1) is tuple and type(elt2) is tuple:
                assert_tuples_equal(elt1, elt2, curpos + (index,))

src/t/o/Toolserver-0.4.1/samples/ServerManager.py   Toolserver(Download)
	def getChallange_pre_condition(self, *args):
		assert type(args) in (type(()), type([])), 'The arguments must be a list'
		for el in args:
			assert type(el) in (type(''), type(u'')), 'The arguments must be a list of strings'
 

src/t/o/Toolserver-0.4.1/samples/GreetingTool.py   Toolserver(Download)
		only called when the toolserver is started with the -c switch.
		"""
		assert type(self.instanceVar) == type(1), "instanceVar is an integer"
 
	def _shutdown(self):
	def greeting_pre_condition(self, name, delay):
		assert type(name) in (type(''), type(u'')), "Type of name must be string"
		assert type(delay) == type(1), "Type of delay must be integer"
 
	def greeting_post_condition(self, result):

src/e/p/epimorphism-HEAD/_lib/sources/OpenGL/platform/baseplatform.py   epimorphism(Download)
        else:
            base = _NullFunctionPointer
        cls = type( functionName, (base,), {
            '__doc__': doc,
            'deprecated': deprecated,
        } )
        return cls(
            functionName, dll, resultType, argTypes, argNames, extension=extension, doc=doc,

src/p/e/personis-0.933/personis/examples/aelog/personis/client/util.py   personis(Download)
    # dirty kludge to get around unicode
    for k,v in result.items():
        if type(v) == type(u''):
            result[k] = str(v)
        if type(k) == type(u''):
            del result[k]
            result[str(k)] = v
    ## Unpack the error, and if it is an exception throw it.
    if type(result) == types.DictionaryType and 'result' in result:

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