In python what is the correct nomenclature for accessing a class attribute using dot notation?
<p>This is semantics question, I'm writing a tutorial for a module that I hacked together for my lab and I would like to know if there is a correct term for accessing a class attribute by using dot notation. For example:</p>

<pre><code>class funzo:
    def __init__(self,string):
        self.attribute = string
fun = funzo("Sweet sweet data")
fun.attribute
</code></pre>

<blockquote>
  <p>Now one can access the string by ??? the object named fun.</p>
</blockquote>

<p>I've been using the term 'dot referencing' but that seems wrong. I googled around and checked the python glossary but I can't seem to find anything.</p>

<p>Attribute Access, this is from the language reference section on <a href="https://docs.python.org/3/reference/datamodel.html#customizing-attribute-access" rel="nofollow">customizing it</a>:</p>

<blockquote>
  <p>The following methods can be defined to customize the meaning of <em>attribute access</em> (use of, assignment to, or deletion of <code>x.name</code>) for class instances.</p>
</blockquote>

<p><sup>(emphasis mine)</sup></p>

<p>So your quote could be better worded as:</p>

<blockquote>
  <p>Now, one can access the attribute <code>attribute</code> by using dotted expressions on the instance named <code>fun</code>.</p>
</blockquote>

<p>Where the term <em>dotted expressions</em> is found from the entry on 'attribute' in the <a href="https://docs.python.org/3/glossary.html" rel="nofollow">Python Glossary</a>.</p>

<p>Another choice employed in the docs as an alternative to <em>dotted expressions</em> is, as in your title, <em>dot-notation</em>. This is found in the <em>Callables</em> section of the <a href="https://docs.python.org/3/reference/datamodel.html#the-standard-type-hierarchy" rel="nofollow">Standard Type Hierarchy</a>, so another option you could consider is:</p>

<blockquote>
  <p>Now, one can access the attribute <code>attribute</code> using dot-notation on the instance named <code>fun</code>.</p>
</blockquote>

<p>Both are, in my opinion, completely understandable if someone has at least some experience in programming languages. I prefer the term <em>dot-notation</em> and as such, would use the later.</p>

python python-3.x oop