2 ms·
I agree in general, but just wanted to add that the pythonic approach would be to avoid the explicit index entirely, with something like: alternate_word_mappin
by falcor84 5y ago
I agree in general, but just wanted to add that the pythonic approach would be to avoid the explicit index entirely, with something like:
alternate_word_mapping = dict(zip(words, words_in_english))
- vladiliescu 5y agoThumbs up, I totally missed this. Didn’t encounter this approach in the suggestions either. That’s actually one reason why I don’t think it’s current incarnation is a good fit for learning new apis, it’s been trained on a lot of code, not all of it good. Seems like something a future version might be able to fix, perhaps by training a new layer using just demonstrably ‘good’ code?
- ellen364 5y agoAgreed and an excellent point. Ironically, my example was not nearly as Pythonic as it could have been! (V late reply as still learning how to keep track of replies on HN. But perhaps you’ll see it anyway.)