小编use*_*609的帖子

Why should I use __new__ instead of __init__ in this example?

I have been studying __new__ recently, and I've read lots of code where __new__ is used instead of __init__. Sometimes I think both work, but I don't know why the original author uses __new__.

Can someone explain why the below code uses __new__ instead of __init__? I want a reason for this example. I know the difference between __new__ and __init__, but I don't know why __new__ is used here.

Example:

    class MiniSubtest(object):
        def __new__(cls, …
Run Code Online (Sandbox Code Playgroud)

python design-patterns

8
推荐指数
1
解决办法
6243
查看次数

有人告诉我RRECOMMENDS和RDEPENDS的区别

我很少使用RRECOMMENDS,我不知道它的实际用途是什么.它似乎只安装一个包..

-RDEPENDS_${PN} = "kernel-module-tun"
+RRECOMMENDS_${PN} = "kernel-module-tun"
Run Code Online (Sandbox Code Playgroud)

任何人都可以解释上面两行代码之间的区别吗?

是否RRECOMMENDS安装kernel-module-tun?如果不是那么它用于什么?

bitbake

3
推荐指数
1
解决办法
5053
查看次数

标签 统计

bitbake ×1

design-patterns ×1

python ×1