簡單的問題 - 我可以打印此if的源代碼嗎? if __name__ == '__main__':
# ...
# this is the `if` I want to print
# V
if args and args[0][0] == '-':
if args[0] in ('--help','-h','-?'):
print_s
我在python中使用mongoengine作爲ORM。現在我有一個情況我有一個類,實際上是一個模型,形式爲: from mongoengine import *
class SomeDetails(Document):
alias = StringField(required=True)
version = StringField(required=True)
a
有沒有一種方法來反省一個變量,直接找出它聲明的子集?在這裏,我創建一個子集,但反思指出我的基本類型: > subset Prime of Int where .is-prime
(Prime)
> my Prime $x = 23
23
> $x.WHICH
Int|23
我知道它有一些地方保存的信息,因爲如果我嘗試重新分配不子集相匹配的值,它失敗: > $x = 24
Type