def moveto(self,<EOL>new_abspath=None,<EOL>new_dirpath=None,<EOL>new_dirname=None,<EOL>new_basename=None,<EOL>new_fname=None,<EOL>new_ext=None,<EOL>overwrite=False,<EOL>makedirs=False):
self.assert_exists()<EOL>p = self.change(<EOL>new_abspath=new_abspath,<EOL>new_dirpath=new_dirpath,<EOL>new_dirname=new_dirname,<EOL>new_basename=new_basename,<EOL>new_fname=new_fname,<EOL>new_ext=new_ext,<EOL>)<EOL>if p.is_not_exist_or_allow_overwrite(overwrite=overwrite):<EOL><INDENT>if self.abspath != p.abspath:<EOL><INDENT>if makedirs:<EOL><INDENT>parent = p.parent<EOL>if not parent.exists():<EOL><INDENT>os.makedirs(parent.abspath)<EOL><DEDENT><DEDENT>self.rename(p)<EOL><DEDENT><DEDENT>return p<EOL>
An advanced :meth:`pathlib_mate.pathlib2.Path.rename` method provide ability to rename by
each components of a path. A new ``Path`` instance will returns.

**中文文档**

高级重命名函数, 允许用于根据路径的各个组成部分进行重命名。但和os.rename
方法一样, 需要保证母文件夹存在。