[enh] make on_attribute of CommaProxyList generic