문제

Io> 1 proto == Number
==> true
Io> 1 type == Number
==> false
Io> 1 proto
==> 0
Io> 1 type
==> Number

I'm very confused about this. Does anyone have ideas about this?

도움이 되었습니까?

해결책

It's because type is a sequence whereas protos are a list of objects.

Io> (1 proto) type
==> Number

Io> 1 hasProto("Number")
==> false

Io> 1 hasProto(Number)
==> true

Io> (1 type) type
==> Sequence

Io> 1 type == "Number"
==> true

What is interesting is that...

Io> 1 protos
==> list(0)

... instead of returning list(Number). But with 0 (zero) being a Number object then I suspects this doesn't cause protos a problem!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top