[Scons-users] conventions for AddMethod

Mats Wichmann mats at wichmann.us
Mon Dec 11 10:02:18 EST 2017


On 12/10/2017 12:11 PM, Bill Deegan wrote:
> I have not strong opinions on this one.
> 
> Pythonically the _ should represent functions which shouldn't get called
> (or called directly) from outside the module.
> I'm not sure in any case calling any of the methods added via AddMethod
> outside of the env, or DefaultEnvironment make sense.
> So you could argue _ should be used for all of them.
> 
> That said, I don't think it's worth changing all the existing code from one
> to the other.
> (Lots of other tasks to be done would provide more utility for the project).

To be clear (if it wasn't), I was not proposing any changes to scons, I
was trying to note that the scons source code did not provide a
"consensus opinion" since both ways are used.

In my specific case, if I have a tags file, and I'm editing in vim, and
I have the cursor on what looks like a function call and press ^] to
jump to that function, if the name was created by AddMethod to refer to
an actual function of a different name, then there just won't be a tag
to jump to, as ctags has no idea about this binding.   Or if I have an
IDE and want to hover over the name to have it display call tips, there
would be nothing there, because the function has a different name.

Meanwhile, there's certainly validity to the viewpoint that these
functions should not be called outside of their special context and so
"hiding" them (in the limited sense Python can do that) makes some sense.




More information about the Scons-users mailing list