Closed msullivan closed 5 years ago
I recommend : since this is used elsewhere too. -- --Guido (mobile)
Do you have a preference about whether it should always emit :
or only when a nested class is involved?
I say always. We may have to bump the major version to indigo the incompatibility. -- --Guido (mobile)
Thanks!
Without understanding the module hierarchy, we can't distinguish between a module and a class in a dotted name like
foo.bar.A.B
, and will insert code likefrom foo.bar.A import B
, even thoughA
is a class.Work around this with a cruddy heuristic that names beginning with a capital letter are classes and not modules.
Another approach would be to introduce alternate punctuation like ! or : to separate the module and class part of a name. This would have the disadvantage of being pretty nonstandard but also not being an awful hack.
The "nonstandard" argument seemed compelling when I first went to implement this so I did the capital letter heuristic. But now it feels pretty weak to me and I'd lean towards switching to it, but I figured I'd get feedback first.