Python 类型检查 ---- typing 模块

Tutorials

Subtype 概念(子类型)

  • type tree

    • 类型树

      • 类似 class tree (类树)
  • 注意

python 代码规范

Lambda functions λ 函数 更规范的使用

https://treyhunner.com/2018/09/stop-writing-lambda-expressions/

错误用法

lambda 赋给变量

  • 错误
1
normalize_case = lambda s: s.casefold()
  • 正确

    • 定义单行,正常函数
1
def normalize_case(s): return s.casefold()

多余的转换

  • 错误

    • 在 lambda 中又调用同样接口的函数

      1
      
      sorted_numbers = sorted(numbers, key=lambda n: abs(n))
  • 正确

    • 直接使用已有函数,不要多此一举

C# Notes

反编译工具

https://blog.csdn.net/kongwei521/article/details/54927689

  • dotPeek

    • 好用,免费
    • 在线源码支持
  • .Net Reflector
  • ILSpy/dnSpy

    • dnSpy 报病毒

String 类型

System.String

  • 两种格式

    • "a string"

      • ""
    • @"a string, c:home"

      • @""
      • 相当于其它语言 r"a string c:home"
      • 不把 "\" 当成转义符,而是普通字符
      • crude string
      • 支持换行,类似 python """ a string """, doc string