Skip to content

Commit dfea5a3

Browse files
author
Brian Obot
committed
Add Notes on Operator overloading
1 parent 70fc27c commit dfea5a3

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/bin/20b_operator_overloading.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ fn main() -> Result<(), Box<dyn Error>> {
8686
let _b = a[0];
8787

8888
println!("A = {a:?}");
89+
// not all operators can be overloaded in python
90+
// & is always a reference
91+
// && || are limited to boolean values
92+
// .., ..= always create a range struct
93+
// = is the assignment operator, which copies or moves a value
8994

9095
Ok(())
9196
}

0 commit comments

Comments
 (0)