[pydev - Users] Assisting pydev with type information.

View: New views
6 Messages — Rating Filter:   Alert me  

[pydev - Users] Assisting pydev with type information.

by SourceForge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7524396
By: thomasmm

I'd like to 'help' pydev by giving it some info about my types - so that it
can provide me with auto-complete information, and so that it doesn't mar

The problem is that I often initially assign attributes the 'None' value, and
then set their actual value later.  This typically comes up with class types.
I guess this is the equivelent of assigning a null value to a reference in other
languages.

The result seems to be that pydev/pylint thinks the attribute has a type of
None (which is true, initially).

Is there some way that I can 'tell' pydev what the correct type is?  Ideally
it would be better if I could do this in the source code, rather then in
a configuration file, since that would be more convenient and because it is
useful information for documenting the program.


______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=293649

------------------------------------------------------------------------------
_______________________________________________
Pydev-users mailing list
Pydev-users@...
https://lists.sourceforge.net/lists/listinfo/pydev-users

[pydev - Users] RE: Assisting pydev with type information.

by SourceForge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7543428
By: f33l

I'd be interested in this too - I'd be cool, if you could somehow tell pydev
to use the @type tag for the pydoc as reference, but I guess that's also messy
and not implemented. I wish Guido had made python 3.0 optionally statically
typed. Sigh.

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=293649

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pydev-users mailing list
Pydev-users@...
https://lists.sourceforge.net/lists/listinfo/pydev-users

[pydev - Users] RE: Assisting pydev with type information.

by SourceForge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7548529
By: gthb

You can do that with assertions. E.g.:

assert isinstance(ds, DataSet)
ds.|

With the cursor there, PyDev will autocomplete on members of the class DataSet.

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=293649

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pydev-users mailing list
Pydev-users@...
https://lists.sourceforge.net/lists/listinfo/pydev-users

[pydev - Users] RE: Assisting pydev with type information.

by SourceForge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7581592
By: thomasmm

That is a good idea, but I find that it doesn't work.  I guess pydev doesn't
parse the 'isinstance' statement?

I hope it will be supported in the future as it is a good solution to the problem.
Then I would define a static member like this:

class Blah:
    shape1 = None;           # will be used as a Shape object later.
    isinstance( shape1, Shape );         # returns False here, but ignored.
        # or
    assert isinstance( shape1, (NoneType, Shape) );


______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=293649

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pydev-users mailing list
Pydev-users@...
https://lists.sourceforge.net/lists/listinfo/pydev-users

[pydev - Users] RE: Assisting pydev with type information.

by SourceForge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7582721
By: fabioz

It should support the assert isinstance(), but I guess it's not working with
a tuple as a parameter (please enter a bug request for that).

Cheers,

Fabio

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=293649

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pydev-users mailing list
Pydev-users@...
https://lists.sourceforge.net/lists/listinfo/pydev-users

[pydev - Users] RE: Assisting pydev with type information.

by SourceForge.net :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Read and respond to this message at:
https://sourceforge.net/forum/message.php?msg_id=7583138
By: thomasmm

Are you sure?

I'm finding that it doesn't work in either case.  For example:

        assert isinstance( attr1, Obj1 );
        attr1.member1();
                 # here an error is reported, even though member1 is a member
of Obj1.


______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit:
https://sourceforge.net/forum/unmonitor.php?forum_id=293649

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pydev-users mailing list
Pydev-users@...
https://lists.sourceforge.net/lists/listinfo/pydev-users