I wonder if there is a good reason for this optical mismatch between e. g. pattern matching, which uses 开发者_如何学Pythona simple
case foo =>
to denote that no action should be taken.
Wouldn't it be reasonable to have something like
import foo.bar.{Baz => }
instead of
import foo.bar.{Baz => _}
considering that _
is used as an "import everything" in the same statement?
I would suggest it's for symmetry with renamed imports:
import java.util.{Collection => JCollection, _}
If we want to import to an inaccessible identifier:
import java.util.{Collection => _ , _}
(I know, _
is a valid identifier, but on the right hand side of =>
you should think of it as a black-hole from which the incoming identifier cannot escape.)
精彩评论