[Scons-users] Module Scons.Util

Bill Deegan bill at baddogconsulting.com
Sun Oct 1 13:27:55 EDT 2017


I think you're mistaken.
If s is a UserString or not a Sequence or BaseStringTypes then it's
actually doing something.

It could probably be rewritten as:

return ''.join([to_String_for_subst(e) for e in s])



On Sun, Oct 1, 2017 at 10:16 AM, James Rinkevich <rinkevichjm at gmail.com>
wrote:

> in this function
> def to_String_for_subst(s,
>                         isinstance=isinstance, str=str,
> to_String=to_String,
>                         BaseStringTypes=BaseStringTypes,
> SequenceTypes=SequenceTypes,
>                         UserString=UserString):
>
>     # Note that the test cases are sorted by order of probability.
>     if isinstance(s, BaseStringTypes):
>         return s
>     elif isinstance(s, SequenceTypes):
>         l = []
>         for e in s:
>             l.append(to_String_for_subst(e))
>         return ' '.join( s )
>     elif isinstance(s, UserString):
>         # s.data can only be either a unicode or a regular
>         # string. Please see the UserString initializer.
>         return s.data
>     else:
>         return str(s)
>
> the lines
>         l = []
>         for e in s:
>             l.append(to_String_for_subst(e))
> have no effect and just waste time, perhaps someone intended the return
> line to be
>        return ' '.join( l )
> instead of
>        return ' '.join( s )
>
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20171001/5bd1fbea/attachment.html>


More information about the Scons-users mailing list