当前位置: 首页>>代码示例>>Python>>正文


Python __builtin__.long方法代码示例

本文整理汇总了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) 
开发者ID:leancloud,项目名称:satori,代码行数:18,代码来源:hub.py

示例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) 
开发者ID:leancloud,项目名称:satori,代码行数:14,代码来源:corecffi.py

示例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) 
开发者ID:powervm,项目名称:pypowervm,代码行数:15,代码来源:storage.py


注:本文中的__builtin__.long方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。