Bug 319353 - __future__ imports not found
Summary: __future__ imports not found
Status: RESOLVED FIXED
Alias: None
Product: kdev-python
Classification: Developer tools
Component: Language support (show other bugs)
Version: 1.5.x
Platform: openSUSE Linux
: NOR normal
Target Milestone: 1.6.0
Assignee: Sven Brauch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-05 09:21 UTC by Todd
Modified: 2013-08-13 10:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Todd 2013-05-05 09:21:19 UTC
Most of the import from __future__ are flagged as "not found in specified module".

In python 2.7 This includes: absolute_import, division, generators, nested_scopes, unicode_literals, with_statement

Only print_function is found

Reproducible: Always

Steps to Reproduce:
1. Create a python script
2. Add the following 2 lines at the top:
from __future__ import (absolute_import, division, generators, nested_scopes,
                                               print_function, unicode_literals, with_statement)
Actual Results:  
absolute_import, division, generators, nested_scopes, unicode_literals, and with_statement are not found

Expected Results:  
All are found

Many of these are not needed with python 2.7, but some projects still require them for backwards-compatibility reasons.

I understand that some third-party modules use weird imports that are hard to parse, but this is a core part of python.  

Further, importing division is both critical for python 3 compatibility and the commonly recomnmnded approach for anyone doing a lot of mathematics because the default approach to doing division is unintuitive.
Comment 1 Sven Brauch 2013-05-05 12:36:27 UTC
Ok -- will fix it. __future__ imports are a very special case in the language and need extra handling (which I only added for print_function since it's the only thing which makes sense in 2.7 IDE-wise). 

Note that this is not a very grave bug, the only effect it has is some curly underline under those words, nothing else. ;)
Comment 2 Sven Brauch 2013-08-13 10:30:30 UTC
Git commit 770d3572b0b2bf97384ecdd83eaa3341a4383f55 by Sven Brauch, on behalf of Zaar Hai.
Committed on 13/08/2013 at 10:30.
Pushed by brauch into branch 'master'.

Add missing __future__ imports
REVIEW:111930
CCMAIL:haizaar@haizaar.com

M  +6    -0    documentation_files/__future__.py

http://commits.kde.org/kdev-python/770d3572b0b2bf97384ecdd83eaa3341a4383f55