This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 187823

Summary: variable type hint is not module wide
Product: python Reporter: nbphpuser <nbphpuser>
Component: EditorAssignee: Torbjorn Norbye <tor>
Status: CLOSED FIXED    
Severity: normal CC: Jenselme
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Other   
Issue Type: DEFECT Exception Reporter:
Attachments: autocompletion offer

Description nbphpuser 2010-06-19 09:21:58 UTC
Created attachment 100240 [details]
autocompletion offer

Hello!

in example below type of variable log is not recognized, however it is specified

import logging
log = logging.getLogger('util')
log.setLevel(logging.DEBUG)
logging.basicConfig(format="%(name)s %(levelname)s: %(message)s")

# @type log Logger
log.info(msg) #here autocompletion works

class Foo:
    def __init__(self):
        log.             #here log type is not recognized see screenshot


another example:

class Foo:
    def __init__(self):
        # @type self.log Logger
        self.log = Logger()
        self.log.       #here log type is not recognized


However this works:

class Foo:
    def __init__(self):
        log = Logger()
        log.
Comment 1 Jenselme 2017-06-22 22:09:47 UTC
Completion is being reworked for the new release planed in August. Not sure it is still relevant with the current version. Type annotation support may be added later for Python 3. Closing this as old bug.
Comment 2 Jiri Kovalsky 2017-06-23 08:06:34 UTC
Thanks for your evaluation Julien. Reporter, if you think your issue is still valid and needs to be addressed, don't hesitate to reopen it with additional information. Closing for now.