本文整理汇总了Python中__builtin__.long方法的典型用法代码示例。如果您正苦于以下问题:Python __builtin__.long方法的具体用法?Python __builtin__.long怎么用?Python __builtin__.long使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类__builtin__
的用法示例。
在下文中一共展示了__builtin__.long方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: idle
# 需要导入模块: import __builtin__ [as 别名]
# 或者: from __builtin__ import long [as 别名]
def idle(priority=0):
"""
Cause the calling greenlet to wait until the event loop is idle.
Idle is defined as having no other events of the same or higher
*priority* pending. That is, as long as sockets, timeouts or even
signals of the same or higher priority are being processed, the loop
is not idle.
.. seealso:: :func:`sleep`
"""
hub = get_hub()
watcher = hub.loop.idle()
if priority:
watcher.priority = priority
hub.wait(watcher)
示例2: start
# 需要导入模块: import __builtin__ [as 别名]
# 或者: from __builtin__ import long [as 别名]
def start(self, callback, *args, **kw):
update = kw.get("update", True)
if update:
# Quoth the libev doc: "This is a costly operation and is
# usually done automatically within ev_run(). This
# function is rarely useful, but when some event callback
# runs for a very long time without entering the event
# loop, updating libev's idea of the current time is a
# good idea."
# So do we really need to default to true?
libev.ev_now_update(self.loop._ptr)
watcher.start(self, callback, *args)
示例3: __hash__
# 需要导入模块: import __builtin__ [as 别名]
# 或者: from __builtin__ import long [as 别名]
def __hash__(self):
"""For comparing sets of LUs."""
# The contract of hash is that two equal thingies must have the same
# hash, but two thingies with the same hash are not necessarily equal.
# The hash is used for assigning keys to hash buckets in a dictionary:
# if two keys hash the same, their items go into the same bucket, but
# they're still different items.
if six.PY3:
conv = int
else:
import __builtin__
conv = __builtin__.long
return conv(self.udid[2:], base=16)