Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
lsferreira42
on Dec 23, 2021
|
parent
|
context
|
favorite
| on:
Three Minor Features in Go 1.18
This is really annoying, every time i code in go i miss python's list.append method
mariusor
on Dec 23, 2021
|
next
[–]
That is weird because append is one of the five associated helper functions on slices that's actually in the Go specification.
https://go.dev/ref/spec#Appending_and_copying_slices
lsferreira42
on Dec 23, 2021
|
parent
|
next
[–]
Yes, it's a helper function, not a list method like it is in python. The result is the same, its just weird
mariusor
on Dec 23, 2021
|
root
|
parent
|
next
[–]
Oh, I understand what you mean now. I thought you meant the functionality, not the idiom of calling it as a method. I dare say that it didn't occur to me that this difference would be great enough for someone to complain about it on the internet. :P
IshKebab
on Dec 23, 2021
|
prev
[–]
Python also puts what should be methods as global functions, e.g. len, filter, reduce.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: