06 2020 档案

该文被密码保护。
posted @ 2020-06-26 18:02 Alrenn 阅读(0) 评论(0) 推荐(0)
摘要:反射 概述 运行时,runtime,区别在于编译时,指的是程序被加载到内存中执行的时候。 反射,reflection,指的是运行时获取类型定义信息。 一个对象能够在运行时像镜子一样反射出其类型信息。 简单说,在Python中,能够通过一个对象,找到其type、class、attribute或meth 阅读全文
posted @ 2020-06-25 20:06 Alrenn 阅读(116) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2020-06-24 17:28 Alrenn 阅读(0) 评论(0) 推荐(0)
摘要:上下文管理 文件IO操作可以对文件对象使用上下文管理,使用with...as语法。 with open('test','w+') as f: f.write('abc') 仿照上例写一个自己的类,实现上下文管理 class Point: pass def __enter__(self): pass 阅读全文
posted @ 2020-06-24 09:01 Alrenn 阅读(156) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2020-06-20 10:24 Alrenn 阅读(4) 评论(0) 推荐(0)