Re: Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Steven D'Aprano
On Fri, 23 Mar 2018 10:39:05 -0600, Malcolm Greene wrote: >> Perhaps it doesn't need to be said, but just to be sure: don't use eval >> if you don't trust the people writing the configuration file. They can >> do nearly unlimited damage to your environment.  They are writing code >> that you are

Re: Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Ned Batchelder
On 3/23/18 12:39 PM, Malcolm Greene wrote: Perhaps it doesn't need to be said, but just to be sure: don't use eval if you don't trust the people writing the configuration file. They can do nearly unlimited damage to your environment.  They are writing code that you are running. Of course! Sc

Re: Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Malcolm Greene
> Perhaps it doesn't need to be said, but just to be sure: don't use eval if > you don't trust the people writing the configuration file. They can do nearly > unlimited damage to your environment.  They are writing code that you are > running. Of course! Script and config file are running in a

Re: Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Ned Batchelder
On 3/23/18 4:30 AM, Malcolm Greene wrote: Looking for advice on how to expand f-string literal strings whose values I'm reading from a configuration file vs hard coding into my script as statements. I'm using f-strings as a very simple template language. I'm currently using the following techniqu

Re: Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Chris Angelico
On Fri, Mar 23, 2018 at 7:37 PM, Malcolm Greene wrote: > My original post reformatted for text mode: > > Looking for advice on how to expand f-string literal strings whose values I'm > reading from a configuration file vs hard coding into > my script as statements. I'm using f-strings as a very s

Re: Python 3.6: How to expand f-string literals read from a file vs inline statement

2018-03-23 Thread Malcolm Greene
My original post reformatted for text mode: Looking for advice on how to expand f-string literal strings whose values I'm reading from a configuration file vs hard coding into my script as statements. I'm using f-strings as a very simple template language. I'm currently using the following tech