RE: [PyCrust] CallTips and AutoComp need work
Brought to you by:
pobrien
|
From: Kevin A. <al...@se...> - 2001-08-08 17:46:20
|
I don't see how you could know whether a method has side-effects or not. I
reiterate what I said originally, which is that if you can't get a doc
string without doing an eval on the code, then you shouldn't try. That means
stuff like this in PythonCard:
bg = pcapp.getCurrentBackground() # can return a doc string
fld1 = bg.find('field1') # can return a doc string
bg.find('field1).getText() # can't return a doc string for getText
Does that make sense?
ka
---
Here's the original discussion started offlist.
pat_orbtech: It isn't really an error. I expect it to fail. That is why it
is in a try: block.
pat_orbtech: The only way I know it will fail is to try it.
pat_orbtech: The issue is what to do about the error messages that are going
to the dos window.
altis: in general it is probably a bad idea to be doing that given that the
method would be doing an action twice then, right?
altis: once when you try it and then for real
altis: i would think that if you can't just get the doc string then you
shouldn't have a call tip, executing code is not good
Not in this context. The only way to get a docstring or anything else is to
have an object. The only way to get the object is to eval a string. So I'm
doing eval() on a string to get the object. If the string isn't a valid
object then it fails. I'm limiting what I eval to object strings that can't
have side effects (at least that is the intent) but even then I might be
evaling something that isn't a valid object. I need the object to get its
attributes or docstring or whatever. This is the way it is done in IDLE,
Boa, PythinWin, etc. If there was a better way I would expect them to be
doing it.
> -----Original Message-----
> From: pyc...@li...
> [mailto:pyc...@li...]On Behalf Of Patrick
> K. O'Brien
> Sent: Wednesday, August 08, 2001 10:41 AM
> To: pycr
> Subject: [PyCrust] CallTips and AutoComp need work
>
>
> The way that python code is being evaluated to determine the object for a
> call tip or autocomplete has not been perfected. If anyone would like to
> take a look at the code and make suggestions, please do so.
> Anyone that has
> discovered an issue related to this should feel free to reply to this
> message so that we can flesh out exactly what needs improving. Thanks.
>
> ---
> Patrick K. O'Brien
> Orbtech
> "I am, therefore I think."
>
>
>
> _______________________________________________
> PyCrust-users mailing list
> PyC...@li...
> http://lists.sourceforge.net/lists/listinfo/pycrust-users
>
|