All Samples(90637) | Call(88276) | Derive(2345) | Import(16)
type(object) -> the object's type type(name, bases, dict) -> a new type
src/s/h/shedskin-HEAD/examples/pylot/Camera.py shedskin(Download)
def __init__(self, world, eye, target, up, distance,
w, h, cols, rows, ortho=False):
#{
assert type(world) == World
assert type(eye) == Vector4
assert type(target) == Vector4
assert type(up) == Vector4
src/g/d/gdata-2.0.17/samples/oauth/oauth_on_appengine/appengine_utilities/cache.py gdata(Download)
def _validate_timeout(self, timeout):
if timeout == None:
timeout = datetime.datetime.now() +\
datetime.timedelta(seconds=DEFAULT_TIMEOUT)
if type(timeout) == type(1):
timeout = datetime.datetime.now() + \
datetime.timedelta(seconds = timeout)
if type(timeout) != datetime.datetime:
src/g/d/gdata-2.0.17/samples/apps/marketplace_sample/appengine_utilities/cache.py gdata(Download)
timeout = datetime.datetime.now() +\
datetime.timedelta(seconds=self.default_timeout)
if type(timeout) == type(1):
timeout = datetime.datetime.now() + \
datetime.timedelta(seconds = timeout)
if type(timeout) != datetime.datetime:
src/g/a/gaesdk-python-HEAD/lib/PyAMF/doc/tutorials/examples/actionscript/guestbook/python/guestbook.py gaesdk-python(Download)
def sql_safe(value):
if isinstance(value, basestring):
return value.replace("'", "\\'")
elif isinstance(type(value), (int, float)):
return value
src/p/y/PySide-1.1.2/sources/shiboken/tests/samplebinding/metaclass_test.py PySide(Download)
class MetaA(type):
pass
class A(object):
__metaclass__ = MetaA
MetaB = type(Point)
B = Point
class MetaC(MetaA, MetaB):
src/p/y/python-cookbook-HEAD/cb2_examples/cb2_20_15_sol_3.py python-cookbook(Download)
return
for k, v in d.items():
if type(v) is types.FunctionType:
newv = _make_constants(v, builtin_only, stoplist, verbose)
setattr(mc, k, newv)
elif type(v) in (type, types.ClassType):
def make_constants(builtin_only=False, stoplist=[], verbose=False):
""" Call this metadecorator to obtain a decorator which optimizes
global references by constant binding on a specific function.
"""
if type(builtin_only) == type(types.FunctionType):
src/b/o/Box2D-2.3b0/examples/pgu/gui/layout.py Box2D(Download)
self.widgets = []
for e in self._widgets:
if type(e) is tuple and e[0] != 0:
self.do_space(e)
elif type(e) is tuple and e[0] == 0:
self.do_br(e[1])
elif type(e) is int:
y = self.y
if len(self.items) != 0 and type(self.items[-1]) == tuple:
del self.items[-1]
w = 0
for e in self.items:
if type(e) == tuple: w += e[0]
src/g/o/google-data-api-HEAD/samples/oauth/oauth_on_appengine/appengine_utilities/cache.py google-data-api(Download)
def _validate_timeout(self, timeout):
if timeout == None:
timeout = datetime.datetime.now() +\
datetime.timedelta(seconds=DEFAULT_TIMEOUT)
if type(timeout) == type(1):
timeout = datetime.datetime.now() + \
datetime.timedelta(seconds = timeout)
if type(timeout) != datetime.datetime:
src/p/s/psycopg2-2.4.6/examples/dict.py psycopg2(Download)
data = curs.fetchone()
print "The type of the data row is", type(data)
print "Some data accessed both as tuple and dict:"
print " ", data['foo'], data['bar'], data['zot']
print " ", data[0], data[1], data[2]
# execute another query and demostrate we can still access the row
curs.execute("SELECT 2 AS foo")
print "The type of the data row is", type(data)
data = curs.fetchone()
print "The type of the data row is", type(data)
print "Some data accessed both as tuple and dict:"
print " ", data['foo'], data['bar'], data['zot']
print " ", "No access using indices: this is a specialized cursor."
# execute another query and demostrate we can still access the row
curs.execute("SELECT 2 AS foo")
print "The type of the data row is", type(data)
src/p/y/PyAMF-HEAD/doc/tutorials/examples/actionscript/google_appengine/punit/models.py PyAMF(Download)
def __init__(self, module='__main__', defaultTest=None,
argv=None, testRunner=None, testLoader=defaultTestLoader):
if type(module) == type(''):
self.module = __import__(module)
for part in module.split('.')[1:]:
Previous 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 Next