mozillazg's Blog
  • Feed
  • About
  • Archives

[python]如何复制一个 class

2014-11-20

python

    通过下面两种方法可以复制一个 class:

    • class B(A): pass
    • B = type("B", (A,), {})

    参考资料

    • How to copy a python class? - Stack Overflow

    微信扫一扫:分享

    Scan me!

    微信里点“发现”,扫一下

    二维码便可将本文分享至朋友圈。

    有任何建议和想法欢迎在下方评论区留言或者加我微信交流


    Comments


    © 2025 mozillazg · Powered by pelican-bootstrap3, Pelican, Bootstrap · Privacy

    Creative Commons License "mozillazg's Blog" by mozillazg is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, except where indicated otherwise.

    Back to top