Dotted notation accesses an attribute or method by placing its name after an object and a period. Use it to read or assign object fields, call methods, and access functions exposed by imported modules. section 15.1.1 section 3.2.1
Common forms include:
- `object.attribute` reads a field, while `object.attribute = value` assigns or replaces it. Python instances can receive fields on the fly, without declaring them in advance. section 15.1.1
- `object.method(arguments)` calls a method attached to the object, such as `x.reverse()` or `x.upper()`. Methods operate on their associated object; string methods return values without modifying immutable strings. section 3.2.2 section 6.4
- `module.function(arguments)` calls a function imported from a library, as in `math.ceil(3.49)`. section 3.2.1
- Special methods and inherited methods are also reached through object attributes. A method call supplies the instance as its first `self` parameter implicitly. section 3.6
Fields and methods
class Circle: def __init__(self): self.radius = 1 c = Circle() print(c.radius) # 1 c.radius = 5 print(2 * 3.14 * c.radius) # 31.4 The same syntax distinguishes field access (`c.radius`) from a method call (`c.area()`). section 15.1.1 section 3.6
round(3.49) #1 3 import math math.ceil(3.49) #2 4 #1 round called with 3.49 #2 The math library module is imported, and its ceil function is called.
Compare a built-in function call with a dotted call to an imported module function: `round(3.49)` versus `math.ceil(3.49)`. section 3.2.1








