Reading through the docs once again for the 100x time probably I found this:
def mutate_copy(l: List[Int]) -> List[Int]:
# def creates an implicit copy of the list because it's mutated
l.append(5)
return l
I immediately was very skeptical and then relieved after trying that this does in fact NOT work.
I guess / hope this is an old relict when we had both fn & def and is hopefully not the intended behavior.
Can someone confirm? ![]()
Also reading through the complete “Mojo Manual” again, there seems to be a lot of old / legacy mojo code that is either
- not working anymore: e.g.
print(list_of_data.__str__())→print(list_of_data) - not using newer features: e.g.
"...".format(...)instead of t-String
Looking at the recent update for the contribution process I would assume PRs to improve the docs are welcome? Can also create an issue if necessary!
![]()