Talk:Instance variable
| This article is rated Start-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||
| ||||||||||||||
Would it be more correct to say "... for which each object *of* the class has a separate copy"?
Not a paradigm
No? Thebigclaw (talk) 04:23, 13 April 2008 (UTC)
- I think the standard way to say this is "non-static member variable" but perhaps there is some subtle technical difference.66.112.225.87 (talk) 19:26, 21 August 2010 (UTC)
Override has special meaning.
At: However the current location referenced in one object may be San Francisco, USA, and you would want to override the default value to currLatitude = 37.7750, but another object may reference La Paz, Bolivia and you would instead want currLatitude = 16.4942. the term 'override' should not be used, as this has a special meaning in a number of OOP languages. It is also more technical than is required. 'change' is adequate.
However the current location referenced in one object may be San Francisco, USA, and you would want to change the default value to 37.7750. Another object may reference La Paz, Bolivia and you would want to change currLatitude to 16.4942. — Preceding unsigned comment added by 101.117.35.119 (talk) 01:01, 15 April 2014 (UTC)
Not in Python
What is returned by Google when searching for "instance variable" is the paragraph that says "a variable which is declared in a class but outside of constructors". However, that's not the case in Python where instance attributes are declared and initialised in the `__init__` method (e.g. just look at the given Python example).
Consequently, I find the above part of the definition misleading.
See also https://stackoverflow.com/questions/38377276/instance-variables-in-methods-outside-the-constructor-python-why-and-how Rhosseinkhan (talk) 07:27, 15 May 2025 (UTC)
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.
