According to the documentation for path.extname(path):
If there is no . in the last portion of the path, or if the first character of the basename of path (see path.basename()) is ., then an empty string is returned.
path.basename('.a.a')[0]=='.' and path.extname('.a.a')!='' should not happen at the same time.
According to the documentation for
path.extname(path):path.basename('.a.a')[0]=='.'andpath.extname('.a.a')!=''should not happen at the same time.