Some programming languages have constructs that because of their frequent use are often mistaken for language features.
For example, many people think that
self is a keyword in Python, but it's just the conventional name for the first argument to a method (you can use any variable name you want):
class Complex: def __init__(self, realpart, imagpart): self.r = realpart self.i = imagpart
Another example: when I was learning R, I thought the syntax for filtering a vector was kind of weird:
d[d %% 2 == 0] # even elements only
At first I thought
d %% 2 == 0 was some sort of lambda that gets magically applied to every element of
d, until I realized that this is a straightforward application of R's vectorized operations:
d %% 2 == 0 returns a vector like
[TRUE, FALSE, FALSE, ...], and then
d just uses that list to filter values that are at positions marked as
What are some other constructs that may first appear to be specially designed language features, but are just straightforward applications of the language's core syntax & semantics?