3 ms·
I can't get used to the fact that for builtin types grow methods, you need to import corresponding modules everywhere. You import module X, which gets you obje
by WesolyKubeczek 5y ago
I can't get used to the fact that for builtin types grow methods, you need to import corresponding modules everywhere.
You import module X, which gets you objects as defined in the module Y. To use methods defined for that type, you need to import Y yourself. Python, of course, by virtue of binding objects to methods, doesn't need it.
There are some more namespacing quirks that may require one to give up on that sweet syntactic sugar to disambiguate things (two unrelated modules defining methods on a single type, with the same signature but different behaviors, and you need both modules imported for some reason?), but this is, again, something one would have to get used to. It's not a different world like Rust or Prolog.
It's not a complete showstopper, just something I keep bumping my head into now and then.
- michaelsbradley 5y ago> you need to import corresponding modules everywhere It's a good practice to re-export "all modules whose types appear in public symbols of the current module". For that and other good advice, see The Status Nim style guide: https://status-im.github.io/nim-style-guide/03_language.html#import-export https://status-im.github.io/nim-style-guide/03_language.html...