Mypy 1.8.0 Documentation
import Union def normalize_id(user_id: Union[int, str]) -> str: if isinstance(user_id, int): return f'user-{100_000 + user_id}' else: return user_id The typing module contains many other useful types previous page) # This is how you annotate a callable (function) value x: Callable[[int, float], float] = f def register(callback: Callable[[str], int]) -> None: ... # A generator function that yields ints is amount: int) -> None: self.audit_log.append(f"Deposited {amount}") self.balance += amount def withdraw(self, amount: int) -> None: self.audit_log.append(f"Withdrew {amount}") self.balance -= amount0 码力 | 234 页 | 902.89 KB | 1 年前3Mypy 1.8.0 Documentation
def normalize_id(user_id: Union[int, str]) -> str: if isinstance(user_id, int): return f'user-{100_000 + user_id}' else: return user_id The typing [https://docs.python.org/3/library/typing errors # This is how you annotate a callable (function) value x: Callable[[int, float], float] = f def register(callback: Callable[[str], int]) -> None: ... # A generator function that yields ints is None: self.audit_log.append(f"Deposited {amount}") self.balance += amount def withdraw(self, amount: int) -> None: self.audit_log.append(f"Withdrew {amount}") self.balance0 码力 | 318 页 | 271.55 KB | 1 年前3Mypy 1.10.0+dev Documentation
def normalize_id(user_id: Union[int, str]) -> str: if isinstance(user_id, int): return f'user-{100_000 + user_id}' else: return user_id The typing [https://docs.python.org/3/library/typing errors # This is how you annotate a callable (function) value x: Callable[[int, float], float] = f def register(callback: Callable[[str], int]) -> None: ... # A generator function that yields ints is None: self.audit_log.append(f"Deposited {amount}") self.balance += amount def withdraw(self, amount: int) -> None: self.audit_log.append(f"Withdrew {amount}") self.balance0 码力 | 318 页 | 270.84 KB | 1 年前3Mypy 1.10.0+dev Documentation
import Union def normalize_id(user_id: Union[int, str]) -> str: if isinstance(user_id, int): return f'user-{100_000 + user_id}' else: return user_id The typing module contains many other useful types previous page) # This is how you annotate a callable (function) value x: Callable[[int, float], float] = f def register(callback: Callable[[str], int]) -> None: ... # A generator function that yields ints is amount: int) -> None: self.audit_log.append(f"Deposited {amount}") self.balance += amount def withdraw(self, amount: int) -> None: self.audit_log.append(f"Withdrew {amount}") self.balance -= amount0 码力 | 234 页 | 913.89 KB | 1 年前3Celery 2.4 Documentation
"priority": 0, "request": { "name": "tasks.sleeptask", "id": "1a7980ea-8b19-413e-91d2-0b74f3844c4d", "args": "[1]", "kwargs": "{}"}}, {"eta": "2010-06-07 09:07:53", "priority": task being executed: [INFO/MainProcess] Task celery.task.http.HttpDispatchTask [f2cc8efc-2a14-40cd-85ad-f1c77c94beeb] processed: 100 Since applying tasks can be done via HTTP using the djcelery result: Show the result of a task $ celeryctl result -t tasks.add 4e196aa4-0141-4601-8138- 7aa33db0f577 Note that you can omit the name of the task as long as the task doesn’t use a custom result backend0 码力 | 543 页 | 957.42 KB | 1 年前3Python3 基础教程 - 廖雪峰
Python 程序的运行时间需要 0.1 秒,慢了 100 倍,但由于 网络更慢,需要等待 1 秒,你想,用户能感觉到 1.001 秒和 1.1 秒的区 别吗?这就好比 F1 赛车和普通的出租车在北京三环路上行驶的道理一 样,虽然 F1 赛车理论时速高达 400 公里,但由于三环路堵车的时速只 有 20 公里,因此,作为乘客,你感觉的时速永远是 20 公里。 Python3 基础教程【完整版】 可以处理任意大小的整数,当然包括负整数,在程序中的表示方 法和数学上的写法一模一样,例如:1,100,-8080,0,等等。 计算机由于使用二进制,所以,有时候用十六进制表示整数比较方便, 十六进制用 0x 前缀和 0-9,a-f 表示,例如:0xff00,0xa5b4c3d2,等等。 浮点数 浮点数也就是小数,之所以称为浮点数,是因为按照科学记数法表示时, 一个浮点数的小数点位置是可变的,比如,1.23x109 和 42/531 >>> 10 % 3 1 无论整数做//除法还是取余数,结果永远是整数,所以,整数运算结果 永远是精确的。 练习 请打印出以下变量的值: n = 123 f = 456.789 s1 = 'Hello, world' s2 = 'Hello, \'Adam\'' s3 = r'Hello, "Bart"' s4 = r'''Hello, Lisa0 码力 | 531 页 | 5.15 MB | 1 年前3MuPDF 1.25.0 Documentation
setAppearance(null, null, mupdf.Matrix.identity, [ 0, 0, 100, 100 ], ˓→{}, "0 1 0 rg 10 10 50 50 re f") annot = page.createAnnotation("Stamp") annot.setRect([10, 750, 200, 850]) annot.setIcon("TOP SECRET") command. For example, to zoom to 150 dpi, type “150z”. F1 Display help. i Show document information. o Show document outline. L Highlight links. F Highlight form fields. a Show annotation editor. r color mode. E Toggle ICC color management. e Toggle spot color emulation. A Toggle anti-aliasing. f Toggle fullscreen. w Shrinkwrap window to fit page. W Fit page width to window. H Fit page height0 码力 | 259 页 | 1.11 MB | 7 月前3MuPDF 1.24.0 Documentation
setAppearance(null, null, mupdf.Matrix.identity, [ 0, 0, 100, 100 ], ˓→{}, "0 1 0 rg 10 10 50 50 re f") annot = page.createAnnotation("Stamp") annot.setRect([10, 750, 200, 850]) annot.setIcon("TOP SECRET") command. For example, to zoom to 150 dpi, type “150z”. F1 Display help. i Show document information. o Show document outline. L Highlight links. F Highlight form fields. a Show annotation editor. r color mode. E Toggle ICC color management. e Toggle spot color emulation. A Toggle anti-aliasing. f Toggle fullscreen. w Shrinkwrap window to fit page. W Fit page width to window. H Fit page height0 码力 | 249 页 | 830.15 KB | 7 月前3WeRoBot 1.6.0 微信公众号开发框架文档
@robot.filter(re.compile("(.*)?e(.*)?"), "f") def d(message, session, match): if match: return "正文为 " + match.group(1) + "e" + match.group(2) return "正文为 f" 这段代码等价于 @robot.text def a(message): return "正文为 " + match.group(1) + "e" + match.group(2) if message.content == "f": return "正文为 f" 如果你想通过修饰符以外的方法添加 filter,可以使用 add_filter() 方法 def say_hello(): return "hello!" robot 操作类 有部分接口暂未实现,可自行调用微信接口。 开始开发 获取 access token 详细请参考 http://mp.weixin.qq.com/wiki/14/9f9c82c1af308e3b14ba9b973f99a8ba.html Client.grant_token() 获取 Access Token。 返回: 返回的 JSON 数据包 Client.get_access_token()0 码力 | 85 页 | 89.26 KB | 1 年前3WeRoBot 1.5.0 微信公众号开发框架文档
@robot.filter(re.compile("(.*)?e(.*)?"), "f") def d(message, session, match): if match: return "正文为 " + match.group(1) + "e" + match.group(2) return "正文为 f" 这段代码等价于 @robot.text def a(message): return "正文为 " + match.group(1) + "e" + match.group(2) if message.content == "f": return "正文为 f" 如果你想通过修饰符以外的方法添加 filter,可以使用 add_filter() 方法 def say_hello(): return "hello!" robot 操作类 有部分接口暂未实现,可自行调用微信接口。 开始开发 获取 access token 详细请参考 http://mp.weixin.qq.com/wiki/14/9f9c82c1af308e3b14ba9b973f99a8ba.html Client.grant_token() 获取 Access Token。 返回: 返回的 JSON 数据包 Client.get_access_token()0 码力 | 83 页 | 88.85 KB | 1 年前3
共 565 条
- 1
- 2
- 3
- 4
- 5
- 6
- 57