• list indices must be integers or slices, not str

    From Frank Millman@21:1/5 to All on Wed Jul 20 10:32:07 2022
    Hi all

    C:\Users\E7280>python
    Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64
    bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.

    x = list(range(10))

    '{x[1]}'.format(**vars())
    '1'

    '{x[-1]}'.format(**vars())
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: list indices must be integers or slices, not str


    Can anyone explain this error? It seems that a negative index is deemed
    to be a string in this case.

    Thanks

    Frank Millman

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Frank Millman on Wed Jul 20 02:12:19 2022
    Frank Millman <frank@chagford.com> writes:
    Can anyone explain this error? It seems that a negative index is
    deemed to be a string in this case.

    It seems to only want integer constants. x[2+2] and x[k] where k=2
    don't work either.

    I think the preferred style these days is f'{x[-1]}' which works.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to Frank Millman on Wed Jul 20 09:23:35 2022
    Frank Millman <frank@chagford.com> writes:
    '{x[-1]}'.format(**vars())

    I take it that "x[-1]" must be produced by "field_name"
    of "Format String Syntax" of "string — Common string
    operations" of the Python Library Reference. That is:

    arg_name ("." attribute_name | "[" element_index "]")*

    , with element_index being:

    digit+ | index_string

    . So if it's not "digit+", it's taken to be an index_string!

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Angelico@21:1/5 to Frank Millman on Wed Jul 20 19:37:06 2022
    On Wed, 20 Jul 2022 at 18:34, Frank Millman <frank@chagford.com> wrote:

    Hi all

    C:\Users\E7280>python
    Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64
    bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.

    x = list(range(10))

    '{x[1]}'.format(**vars())
    '1'

    '{x[-1]}'.format(**vars())
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    TypeError: list indices must be integers or slices, not str


    Can anyone explain this error? It seems that a negative index is deemed
    to be a string in this case.


    Yeah, that does seem a little odd. What you're seeing is the same as
    this phenomenon:

    "{x[1]} {x[spam]}".format(x={1: 42, "spam": "ham"})
    '42 ham'
    "{x[1]} {x[spam]}".format(x={"1": 42, "spam": "ham"})
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    KeyError: 1

    But I can't find it documented anywhere that digits-only means
    numeric. The best I can find is:

    https://docs.python.org/3/library/string.html#formatstrings
    """The arg_name can be followed by any number of index or attribute expressions. An expression of the form '.name' selects the named
    attribute using getattr(), while an expression of the form '[index]'
    does an index lookup using __getitem__()."""

    and in the corresponding grammar:

    field_name ::= arg_name ("." attribute_name | "[" element_index "]")* index_string ::= <any source character except "]"> +

    In other words, any sequence of characters counts as an argument, as
    long as it's not ambiguous. It doesn't seem to say that "all digits is interpreted as an integer, everything else is interpreted as a
    string". ISTM that a negative number should be interpreted as an
    integer too, but that might be a backward compatibility break.

    ChrisA

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Millman@21:1/5 to Chris Angelico on Wed Jul 20 12:31:58 2022
    On 2022-07-20 11:37 AM, Chris Angelico wrote:
    On Wed, 20 Jul 2022 at 18:34, Frank Millman <frank@chagford.com> wrote:

    Hi all

    C:\Users\E7280>python
    Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64
    bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    >>> x = list(range(10))
    >>>
    >>> '{x[1]}'.format(**vars())
    '1'
    >>>
    >>> '{x[-1]}'.format(**vars())
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    TypeError: list indices must be integers or slices, not str
    >>>

    Can anyone explain this error? It seems that a negative index is deemed
    to be a string in this case.


    Yeah, that does seem a little odd. What you're seeing is the same as
    this phenomenon:

    "{x[1]} {x[spam]}".format(x={1: 42, "spam": "ham"})
    '42 ham'
    "{x[1]} {x[spam]}".format(x={"1": 42, "spam": "ham"})
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    KeyError: 1

    But I can't find it documented anywhere that digits-only means
    numeric. The best I can find is:

    https://docs.python.org/3/library/string.html#formatstrings
    """The arg_name can be followed by any number of index or attribute expressions. An expression of the form '.name' selects the named
    attribute using getattr(), while an expression of the form '[index]'
    does an index lookup using __getitem__()."""

    and in the corresponding grammar:

    field_name ::= arg_name ("." attribute_name | "[" element_index "]")* index_string ::= <any source character except "]"> +

    In other words, any sequence of characters counts as an argument, as
    long as it's not ambiguous. It doesn't seem to say that "all digits is interpreted as an integer, everything else is interpreted as a
    string". ISTM that a negative number should be interpreted as an
    integer too, but that might be a backward compatibility break.


    Thanks for investigating this further. I agree it seems odd.

    As quoted above, an expression of the form '[index]' does an index
    lookup using __getitem()__.

    The only __getitem__() that I can find is in the operator module, and
    that handles negative numbers just fine.

    Do you think it is worth me raising an issue, if only to find out the
    rationale if there is one?

    Frank

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Millman@21:1/5 to Frank Millman on Wed Jul 20 13:04:45 2022
    On 2022-07-20 12:31 PM, Frank Millman wrote:
    On 2022-07-20 11:37 AM, Chris Angelico wrote:
    On Wed, 20 Jul 2022 at 18:34, Frank Millman <frank@chagford.com> wrote:

    Hi all

    C:\Users\E7280>python
    Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 >>> bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
      >>>
      >>> x = list(range(10))
      >>>
      >>> '{x[1]}'.format(**vars())
    '1'
      >>>
      >>> '{x[-1]}'.format(**vars())
    Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
    TypeError: list indices must be integers or slices, not str
      >>>

    Can anyone explain this error? It seems that a negative index is deemed
    to be a string in this case.


    Yeah, that does seem a little odd. What you're seeing is the same as
    this phenomenon:

    "{x[1]} {x[spam]}".format(x={1: 42, "spam": "ham"})
    '42 ham'
    "{x[1]} {x[spam]}".format(x={"1": 42, "spam": "ham"})
    Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
    KeyError: 1

    But I can't find it documented anywhere that digits-only means
    numeric. The best I can find is:

    https://docs.python.org/3/library/string.html#formatstrings
    """The arg_name can be followed by any number of index or attribute
    expressions. An expression of the form '.name' selects the named
    attribute using getattr(), while an expression of the form '[index]'
    does an index lookup using __getitem__()."""

    and in the corresponding grammar:

    field_name        ::=  arg_name ("." attribute_name | "["
    element_index "]")*
    index_string      ::=  <any source character except "]"> +

    In other words, any sequence of characters counts as an argument, as
    long as it's not ambiguous. It doesn't seem to say that "all digits is
    interpreted as an integer, everything else is interpreted as a
    string". ISTM that a negative number should be interpreted as an
    integer too, but that might be a backward compatibility break.


    Thanks for investigating this further. I agree it seems odd.

    As quoted above, an expression of the form '[index]' does an index
    lookup using __getitem()__.

    The only __getitem__() that I can find is in the operator module, and
    that handles negative numbers just fine.

    Do you think it is worth me raising an issue, if only to find out the rationale if there is one?

    Frank

    I saw this from Paul Rubin - for some reason his posts appear in google
    groups, but not python-list.

    "It seems to only want integer constants. x[2+2] and x[k] where k=2
    don't work either.

    I think the preferred style these days is f'{x[-1]}' which works."

    Unfortunately the 'f' option does not work for me in this case, as I am
    using a string object, not a string literal.

    Frank

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Angelico@21:1/5 to Frank Millman on Wed Jul 20 21:08:35 2022
    On Wed, 20 Jul 2022 at 20:55, Frank Millman <frank@chagford.com> wrote:

    On 2022-07-20 11:37 AM, Chris Angelico wrote:
    On Wed, 20 Jul 2022 at 18:34, Frank Millman <frank@chagford.com> wrote:

    Hi all

    C:\Users\E7280>python
    Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 >> bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    >>> x = list(range(10))
    >>>
    >>> '{x[1]}'.format(**vars())
    '1'
    >>>
    >>> '{x[-1]}'.format(**vars())
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    TypeError: list indices must be integers or slices, not str
    >>>

    Can anyone explain this error? It seems that a negative index is deemed
    to be a string in this case.


    Yeah, that does seem a little odd. What you're seeing is the same as
    this phenomenon:

    "{x[1]} {x[spam]}".format(x={1: 42, "spam": "ham"})
    '42 ham'
    "{x[1]} {x[spam]}".format(x={"1": 42, "spam": "ham"})
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    KeyError: 1

    But I can't find it documented anywhere that digits-only means
    numeric. The best I can find is:

    https://docs.python.org/3/library/string.html#formatstrings
    """The arg_name can be followed by any number of index or attribute expressions. An expression of the form '.name' selects the named
    attribute using getattr(), while an expression of the form '[index]'
    does an index lookup using __getitem__()."""

    and in the corresponding grammar:

    field_name ::= arg_name ("." attribute_name | "[" element_index "]")*
    index_string ::= <any source character except "]"> +

    In other words, any sequence of characters counts as an argument, as
    long as it's not ambiguous. It doesn't seem to say that "all digits is interpreted as an integer, everything else is interpreted as a
    string". ISTM that a negative number should be interpreted as an
    integer too, but that might be a backward compatibility break.


    Thanks for investigating this further. I agree it seems odd.

    As quoted above, an expression of the form '[index]' does an index
    lookup using __getitem()__.

    The only __getitem__() that I can find is in the operator module, and
    that handles negative numbers just fine.

    In general, __getitem__ is the method used to handle those sorts of lookups:

    class X:
    def __getitem__(self, item):
    print("Get item", type(item), item)

    "{x[0]} {x[1]} {x[-1]} {x[spam]} {x[1.0]}".format(x=X())

    Outside of a format directive, you'd need to quote those:

    x[0], x[1], x["spam"]

    The distinction is that unquoted bare numbers are interpreted as
    integers, not as strings. I'm unable to find the exact definition of
    that documented.

    Do you think it is worth me raising an issue, if only to find out the rationale if there is one?


    I'd wait for other people's responses first, there may be a better
    insight to be found than what I was able to come across.

    ChrisA

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Angelico@21:1/5 to Frank Millman on Wed Jul 20 21:14:20 2022
    On Wed, 20 Jul 2022 at 21:06, Frank Millman <frank@chagford.com> wrote:
    I saw this from Paul Rubin - for some reason his posts appear in google groups, but not python-list.

    "It seems to only want integer constants. x[2+2] and x[k] where k=2
    don't work either.

    Yes, that's for the same reason that x[spam] can be used usefully with
    a dictionary. Otherwise you'd need to use quotes. It makes perfect
    sense that both 2+2 and k are treated as strings.

    I think the preferred style these days is f'{x[-1]}' which works."

    Not true; there's no single "preferred style", and f-strings are
    absolutely NOT replacements for everything else. They have their
    place, as do the others. Yes, including percent formatting, it is not deprecated, and it's really tiresome when people claim that it is.

    Unfortunately the 'f' option does not work for me in this case, as I am
    using a string object, not a string literal.

    Right. An f-string uses the exact syntax of a Python expression, which
    is often too powerful, but also restricts it to the string literal
    style (since it's actual code, not a method call). For other purposes, .format() is a better choice.

    ChrisA

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter Otten@21:1/5 to Chris Angelico on Wed Jul 20 15:42:27 2022
    On 20/07/2022 11:37, Chris Angelico wrote:
    On Wed, 20 Jul 2022 at 18:34, Frank Millman <frank@chagford.com> wrote:

    Hi all

    C:\Users\E7280>python
    Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64
    bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    >>> x = list(range(10))
    >>>
    >>> '{x[1]}'.format(**vars())
    '1'
    >>>
    >>> '{x[-1]}'.format(**vars())
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    TypeError: list indices must be integers or slices, not str
    >>>

    Can anyone explain this error? It seems that a negative index is deemed
    to be a string in this case.


    Yeah, that does seem a little odd. What you're seeing is the same as
    this phenomenon:

    "{x[1]} {x[spam]}".format(x={1: 42, "spam": "ham"})
    '42 ham'
    "{x[1]} {x[spam]}".format(x={"1": 42, "spam": "ham"})
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    KeyError: 1

    But I can't find it documented anywhere that digits-only means
    numeric.


    I found

    https://peps.python.org/pep-3101/

    """
    PEP 3101 – Advanced String Formatting
    ...
    An example of the ‘getitem’ syntax:

    "My name is {0[name]}".format(dict(name='Fred'))

    It should be noted that the use of ‘getitem’ within a format string is
    much more limited than its conventional usage. In the above example, the
    string ‘name’ really is the literal string ‘name’, not a variable named ‘name’. The rules for parsing an item key are very simple. If it starts with a digit, then it is treated as a number, otherwise it is used as a
    string.

    Because keys are not quote-delimited, it is not possible to specify
    arbitrary dictionary keys (e.g., the strings “10” or “:-]”) from within a format string.
    """

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Angelico@21:1/5 to Peter Otten on Thu Jul 21 00:45:07 2022
    On Wed, 20 Jul 2022 at 23:50, Peter Otten <__peter__@web.de> wrote:

    I found

    https://peps.python.org/pep-3101/

    """
    PEP 3101 – Advanced String Formatting
    ...
    An example of the ‘getitem’ syntax:

    "My name is {0[name]}".format(dict(name='Fred'))

    It should be noted that the use of ‘getitem’ within a format string is much more limited than its conventional usage. In the above example, the string ‘name’ really is the literal string ‘name’, not a variable named
    ‘name’. The rules for parsing an item key are very simple. If it starts with a digit, then it is treated as a number, otherwise it is used as a string.


    Cool. I think this is a good justification for a docs patch, since
    that really should be mentioned somewhere other than a historical
    document.

    ChrisA

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From MRAB@21:1/5 to Chris Angelico on Wed Jul 20 15:21:23 2022
    On 20/07/2022 12:08, Chris Angelico wrote:
    On Wed, 20 Jul 2022 at 20:55, Frank Millman <frank@chagford.com> wrote:

    On 2022-07-20 11:37 AM, Chris Angelico wrote:
    On Wed, 20 Jul 2022 at 18:34, Frank Millman <frank@chagford.com> wrote:

    Hi all

    C:\Users\E7280>python
    Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 >> >> bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    >>> x = list(range(10))
    >>>
    >>> '{x[1]}'.format(**vars())
    '1'
    >>>
    >>> '{x[-1]}'.format(**vars())
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    TypeError: list indices must be integers or slices, not str
    >>>

    Can anyone explain this error? It seems that a negative index is deemed >> >> to be a string in this case.


    Yeah, that does seem a little odd. What you're seeing is the same as
    this phenomenon:

    "{x[1]} {x[spam]}".format(x={1: 42, "spam": "ham"})
    '42 ham'
    "{x[1]} {x[spam]}".format(x={"1": 42, "spam": "ham"})
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    KeyError: 1

    But I can't find it documented anywhere that digits-only means
    numeric. The best I can find is:

    https://docs.python.org/3/library/string.html#formatstrings
    """The arg_name can be followed by any number of index or attribute
    expressions. An expression of the form '.name' selects the named
    attribute using getattr(), while an expression of the form '[index]'
    does an index lookup using __getitem__()."""

    and in the corresponding grammar:

    field_name ::= arg_name ("." attribute_name | "[" element_index "]")*
    index_string ::= <any source character except "]"> +

    In other words, any sequence of characters counts as an argument, as
    long as it's not ambiguous. It doesn't seem to say that "all digits is
    interpreted as an integer, everything else is interpreted as a
    string". ISTM that a negative number should be interpreted as an
    integer too, but that might be a backward compatibility break.


    Thanks for investigating this further. I agree it seems odd.

    As quoted above, an expression of the form '[index]' does an index
    lookup using __getitem()__.

    The only __getitem__() that I can find is in the operator module, and
    that handles negative numbers just fine.

    In general, __getitem__ is the method used to handle those sorts of lookups:

    class X:
    def __getitem__(self, item):
    print("Get item", type(item), item)

    "{x[0]} {x[1]} {x[-1]} {x[spam]} {x[1.0]}".format(x=X())

    Outside of a format directive, you'd need to quote those:

    x[0], x[1], x["spam"]

    The distinction is that unquoted bare numbers are interpreted as
    integers, not as strings. I'm unable to find the exact definition of
    that documented.

    Do you think it is worth me raising an issue, if only to find out the
    rationale if there is one?


    I'd wait for other people's responses first, there may be a better
    insight to be found than what I was able to come across.

    It's mentioned in PEP 3101 (Advanced String Formatting):

    """
    The rules for parsing an item key are very simple. If it starts with a
    digit, then it is treated as a number, otherwise it is used as a string.
    """

    I have a vague memory of it being discussed on python-dev, but it was a
    long time ago.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mats Wichmann@21:1/5 to Frank Millman on Wed Jul 20 10:46:35 2022
    On 7/20/22 05:04, Frank Millman wrote:

    I think the preferred style these days is f'{x[-1]}' which works."

    Unfortunately the 'f' option does not work for me in this case, as I am
    using a string object, not a string literal.

    For that you could consider

    https://pypi.org/project/f-yeah/

    (straying a bit off thread subject by now, admittedly)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Martin Di Paola@21:1/5 to Mats Wichmann on Wed Jul 20 15:59:19 2022
    offtopic

    If you want a pure-python but definitely a more hacky implementation,
    you can play around with inspect.stack() and get the variables from
    the outer frames.


    # code:
    x = 32
    y = 42
    printf("Hello x={x}, y={y}", x=27)

    # output:
    Hello x=27, y=42


    The implementation of printf() was never released in PyPI (I guess I never saw it as more than a challenge).

    But the implementation is quite simple (I did a post about it): https://book-of-gehn.github.io/articles/2021/07/11/Home-Made-Python-F-String.html

    Thanks,
    Martin.
    On Wed, Jul 20, 2022 at 10:46:35AM -0600, Mats Wichmann wrote:
    On 7/20/22 05:04, Frank Millman wrote:

    I think the preferred style these days is f'{x[-1]}' which works."

    Unfortunately the 'f' option does not work for me in this case, as I am
    using a string object, not a string literal.

    For that you could consider

    https://pypi.org/project/f-yeah/

    (straying a bit off thread subject by now, admittedly)
    --
    https://mail.python.org/mailman/listinfo/python-list

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roel Schroeven@21:1/5 to Frank Millman on Wed Jul 20 22:59:21 2022
    Frank Millman schreef op 20/07/2022 om 13:04:
    On Wed, 20 Jul 2022 at 18:34, Frank Millman <frank@chagford.com> wrote: >>>   >>>
      >>> x = list(range(10))
      >>>
      >>> '{x[1]}'.format(**vars())
    '1'
      >>>
      >>> '{x[-1]}'.format(**vars())
    Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
    TypeError: list indices must be integers or slices, not str
      >>>

    Can anyone explain this error? It seems that a negative index is deemed >>> to be a string in this case.


    [...]


    "It seems to only want integer constants. x[2+2] and x[k] where k=2
    don't work either.

    I think the preferred style these days is f'{x[-1]}' which works."

    Unfortunately the 'f' option does not work for me in this case, as I am
    using a string object, not a string literal.

    I've always found a bit dirty to pass indiscriminate symbol tables like
    the one from globals() or vars() or vars(some_object) to a formatting
    method, leaving the formatting string free to access any of it. I prefer
    to make things more explicit. Can't you make a dict with a selection of
    things you possible want to format?

    In a sense I think you're looking for a more complete templating
    solution than what Python's formatting mechanisms are designed for.
    Maybe you should consider a full template engine, like Jinja?

    --
    "There is no cause so noble that it will not attract fuggheads."
    -- Larry Niven

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Frank Millman@21:1/5 to Chris Angelico on Thu Jul 21 10:32:03 2022
    On 2022-07-20 4:45 PM, Chris Angelico wrote:
    On Wed, 20 Jul 2022 at 23:50, Peter Otten <__peter__@web.de> wrote:

    I found

    https://peps.python.org/pep-3101/

    """
    PEP 3101 – Advanced String Formatting
    ...
    An example of the ‘getitem’ syntax:

    "My name is {0[name]}".format(dict(name='Fred'))

    It should be noted that the use of ‘getitem’ within a format string is >> much more limited than its conventional usage. In the above example, the
    string ‘name’ really is the literal string ‘name’, not a variable named
    ‘name’. The rules for parsing an item key are very simple. If it starts >> with a digit, then it is treated as a number, otherwise it is used as a
    string.


    Cool. I think this is a good justification for a docs patch, since
    that really should be mentioned somewhere other than a historical
    document.

    ChrisA

    I have submitted the following -

    https://github.com/python/cpython/issues/95088

    Frank

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul Rubin@21:1/5 to Frank Millman on Thu Jul 21 15:02:07 2022
    Frank Millman <frank@chagford.com> writes:
    Unfortunately the 'f' option does not work for me in this case, as I
    am using a string object, not a string literal.

    That sounds a bit suspicious, but if you are sure that the string itself
    is made from trusted data, maybe you want the evil eval().

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)