What is the '@=' symbol for in Python?
@ is for decorators, but what is
@= for in Python? Is it just reservation for some future idea?
This is just one of my many q while reading
@(at) operator is intended to be used for matrix multiplication. No builtin Python types implement this operator.
@ operator was introduced in Python 3.5.
@= is matrix multiplication followed by assignment, as you would expect. They map to
__imatmul__ similar to how
+= map to
The operator and the rationale behind it are discussed in detail in PEP 465.
★ Back to homepage or read more recommendations: