首页 \ 问答 \ 构造函数是“调用”与构造函数是“执行”?(Constructor is “invoked” vs. Constructor is “executed”?)

构造函数是“调用”与构造函数是“执行”?(Constructor is “invoked” vs. Constructor is “executed”?)

构造函数调用和构造函数执行之间有什么区别? 我正在阅读james Gosling的java编程语言中的构造函数顺序依赖。作者指出,当你创建一个对象构造函数时,首先调用,然后使用feild成员最终执行costructor.Both听起来和我一样。


What is the difference betweeen constructor invocation and constructor execution? I am reading about constructor order dependecies from java programming langauage by james Gosling.The author states that when you create an object constructor is first invoked, then feild members are intialized finally costructor is executed.Both sounds the same to me.


原文:https://stackoverflow.com/questions/22394276
更新时间:2023-05-31 20:05

最满意答案

尝试手动更新设置工具。

wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
sudo python ez_setup.py --user

Try updating your setup tools manually.

wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
sudo python ez_setup.py --user

相关问答

更多
  • 这里的许多答案都是2015年过期的(尽管丹尼尔·罗斯曼最初接受的答案不是)。 这是现在的状态: 二进制包现在以轮子( .whl文件)的形式发布 - 不仅仅是在PyPI上,而是在第三方存储库中,如Christoph Gohlke的Windows扩展包 。 pip可以处理轮子; easy_install不行。 虚拟环境(内置3.4,或可以添加到2.6 + / 3.1 +与virtualenv )已经成为一个非常重要和突出的工具(并在官方文档中推荐); 它们包括开箱即用,但是甚至不能通过easy_install正 ...
  • 如果你这样做,那么它将工作: cd /usr/local/lib/python2.7/site-packages && ls 找到目录中的pip-1.4.1-py2.7.egg-info和distribute-0.6.49-py2.7.egg 。 那么以下步骤解决了这个问题: 在/usr/local/bin/pip中将pip版本更改为1.4.1 在/usr/local/bin/easy_install中将分发版本更改为0.6.49 If you do this then it will work: cd ...
  • 通常,您只安装了一个版本的python发行版。 由于2.5.1和2.5.4来自同一版本,因此复制库应该可以正常工作。 您需要注意的是,您现在在路径中有/ usr / bin / python和/ usr / local / bin / python,并且某些实用程序可能会混淆。 如果您需要同时安装两个微版本,我会完全保留2.5.4的路径,或者让它完全破坏另一个(尽管这样做会自行承担风险;)如果你选择前者,您还可以使用PYTHONPATH环境变量将2.5.4指向您的站点包。 Ubuntu采用不同的路线,这就是 ...
  • 这应该工作: curl https://bootstrap.pypa.io/ez_setup.py -s | python 除非重定向,否则cURL会将收到的正文输出到STDOUT,因此您不必传递-o - (根据文档,它实际上不应该做任何事情)。 您应该传递-s以抑制进度表和任何错误。 然后将它直接导入python 。 没有其他参数, python会将STDIN确定为要执行的脚本的源。 This should work: curl https://bootstrap.pypa.io/ez_setup.py ...
  • 我在这里找到了一个潜在的解 这里是相关的报价: “发生这种情况是因为Ubuntu 12.04(这是我的服务器的操作系统)有一个旧的pyOpenSSL库,它不接受属性'set_tlsext_host_name'对于修复,你需要添加依赖pyOpenSSL > = 0.13在Ubuntu上更新pyOpenSSL使用pip ,安装libffi-dev并通过apt删除python-openssl “。 $ sudo apt-get purge python-openssl $ sudo apt-get install ...
  • sudo apt-get install python-setuptools 安装Python的setuptools 2.对于Python 3,命令是 sudo apt-get install python3-setuptools 至于virtualenv - 您可以为一个Python安装它,但使用any: virtualenv --python python3.4 即使virtualenv适用于Python 2.7或3.6。 sudo apt-get install python-setuptool ...
  • Christoph Gohlke 在这里提供了预构建的Windows安装程序,包括scipy。 最好的办法是使用其中一个,原因是从源代码安装scipy,numpy和matplotlib需要构建大多数Windows机器都没有编译器的C和Fortran扩展。 另外还有一些包含python和一些其他工具的预编译关系: Anaconda :SciPy堆栈的免费发行版。 支持Linux,Windows和Mac。 Enthought Canopy :免费和商业版本包括核心SciPy堆栈包。 支持Linux,Window ...
  • 我完全修改了我的python安装! 现在它正在发挥作用。 我不知道发生了什么但是stackoverflow用户首先关心解决问题......这就是我所做的: 清除python3的每一条路径......请注意这个命令 ,它们会吹你的PYTHON3安装。 sudo apt-get remove python3 sudo apt-get remove python3.2* sudo apt-get remove python3.3* sudo apt-get remove python3.4* sudo apt-g ...
  • 尝试手动更新设置工具。 wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py sudo python ez_setup.py --user Try updating your setup tools manually. wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py sudo python ez_setup.py --user
  • easy_install的文档很简单。 请参阅升级包 。 升级软件包不需要做任何特殊操作:只需通过请求特定版本安装新版本,例如: easy_install "SomePackage==2.0" 所以这应该做到这一点: easy_install "Sphinx==1.6.5" 另请参阅使用easy_install 卸载软件包 。 如果要删除当前安装的软件包版本(或软件包的所有版本),则应首先运行: easy_install -m PackageName 这将确保Python不会继续搜索您计划删除的软件包 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)