How is duck typing different from the old 'variant' type and/or interfaces?

后端 未结 10 1009
无人及你
无人及你 2021-01-30 03:32

I keep seeing the phrase \"duck typing\" bandied about, and even ran across a code example or two. I am way too lazy busy to do my own research, can someone tel

10条回答
  •  太阳男子
    2021-01-30 03:50

    Duck typing is just another term for dynamic typing or late-binding. A variant object that parses/compiles with any member access (e.g., obj.Anything) that may or not actually be defined during runtime is duck typing.

提交回复
热议问题