This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年08月30日 21:59 by simohe, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg143237 - (view) | Author: simohe (simohe) | Date: 2011年08月30日 21:59 | |
When the current module is in a package and imports submodules, the following lines are converted to illegal code. -import sub.subsub +from . import sub.subsub -import sub, sub.subsub, sub2 +from . import sub, sub.subsub, sub2 A valid alternative: -import sub.subsub +from .sub import subsub as _dummy -import sub, sub.subsub, sub2 +from . import sub, sub2\nfrom .sub import subsub as _dummy |
|||
| msg156737 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2012年03月25日 07:03 | |
-import sub.subsub +from .sub import subsub as _dummy That’s partly incorrect, as you need to bind the name sub to match the original code. |
|||
| msg156738 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2012年03月25日 07:04 | |
BTW I think if this is too difficult to implement 2to3 could just be documented as requiring you not to use implicit relative imports. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:21 | admin | set | github: 57073 |
| 2021年10月20日 22:40:51 | iritkatriel | set | resolution: duplicate -> wont fix |
| 2021年10月20日 22:37:18 | iritkatriel | set | status: open -> closed superseder: Close 2to3 issues and list them here resolution: duplicate stage: needs patch -> resolved |
| 2012年03月30日 02:00:41 | meador.inge | set | nosy:
+ meador.inge |
| 2012年03月25日 07:04:17 | eric.araujo | set | messages: + msg156738 |
| 2012年03月25日 07:03:35 | eric.araujo | set | nosy:
+ eric.araujo messages: + msg156737 |
| 2011年09月02日 16:59:43 | eric.araujo | set | nosy:
+ benjamin.peterson stage: needs patch versions: + Python 2.7, Python 3.2, Python 3.3, - Python 2.6, Python 3.1 |
| 2011年08月30日 21:59:21 | simohe | create | |