google-code-export / ulipad

Automatically exported from code.google.com/p/ulipad
0 stars 0 forks source link

Problem with hidden methods in autocomplete #254

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. make a class like this
class hi(object):
    def __toto(self):
        print 'You Found Me'

    def Me(self):
        'Dis is OK'

    def __init__(self):
        print 'Initialized'
2. then write 
hi().
3. autocomlete will give you __toto() instead of giving you _hi__toto()
as python automatically changes methods starting with __(name) to 
_(class)__(name) where (name) is the method name and (class) is the class name

you should make a filter for auto complete like

if((methodname).startswith('__') && (!(methodname).endswith('__'))):
    (methodname) = '_' + (classname) + (methodname)

where (methodname) is the name of the mathod and (classname) is the name of the 
class

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by ahmednem...@gmail.com on 21 Jul 2010 at 8:50

GoogleCodeExporter commented 9 years ago
You are right, but I think for __xxx method should be private method, you 
should not use it in class outside. So I think it's not a big problem. 

Original comment by limo...@gmail.com on 21 Jul 2010 at 11:53