摘要: 描述符:非特殊的方法可以被实例属性遮盖 函数和方法只实现了__get__方法,属于非覆盖型描述符。 特殊方法不受这个问题的影响,是因为解释器只在类中寻找特殊方法。 __repr__, __getattr__ 都是如此 测试代码: class LineItem: def __init__(self, 阅读全文
posted @ 2024-04-03 05:29 limalove 阅读(1) 评论(0) 推荐(0) 编辑
摘要: from itertools import product import pandas as pd res = list(product(['a','b'],['c'],['d','e','g'])) print(res) data = list(product(range(10), range(1 阅读全文
posted @ 2024-03-15 22:24 limalove 阅读(3) 评论(0) 推荐(0) 编辑
摘要: flush = True 参数不可缺少,因为Python的输出默认以行为单位缓冲,即Python只在换行符后显示可打印的字符。 阅读全文
posted @ 2024-01-09 21:24 limalove 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-12-30 08:40 limalove 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-12-26 21:39 limalove 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-12-25 10:56 limalove 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-12-24 09:31 limalove 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-12-23 21:34 limalove 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-12-23 08:42 limalove 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2023-12-22 06:10 limalove 阅读(1) 评论(0) 推荐(0) 编辑