tags:

views:

82

answers:

3

Hi, I use pyscripter for coding, it supports auto-completion. So, when I say:

a = []
a.

It gives me all the list functions. similarly with strings I do b=''.

But for file type, I have to use file. and choose the function and write it's arguments and then replace file with the variable name.

Is there a way to declare a variable type explicitly in python, so that my IDE can be more useful?

+1  A: 

Give a try to spyder IDE.

Charles Hebert
+1  A: 

Python has no type declarations. Python 3 introduces something called function annotations, which Guido sometimes refers to as "the thing that isn't type declarations," because the most obvious use of it will be to provide type information as a hint.

As others have mentioned, various IDEs do a better or worse job at auto-completing.

Ned Batchelder
+1  A: 

in case you want methods callable on a type ...you can always use dir(var) in python console...

mossplix
+1 I think that this is the right answer. Learn the methods available on it the hard way and quit your bellyaching.
aaronasterling