Python Forum
informatio from importer to importee
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
informatio from importer to importee
#4
i was recoding the debugtoys module to work with a setup function. then i decided that instead of passing an environment variable name, i would expand the flexibility and pass the result of whatever test the importer wanted to be used, which might not be from environment variables at all. then i was thinking that logic could go around the original import like:
if eval(os.environ['ROSES_ARE_RED']):
    from debugtoys import pf,pr,pv,sl
else:
    def pf(*a,**o): return
    def pr(*a,**o): return
    def pv(*a,**o): return
    def sl(*a,**o): return
or maybe not. this setup function could also provide the dummy functions when the debugging is disabled. so i am recoding it that way now.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
informatio from importer to importee - by Skaperen - Nov-18-2018, 07:31 PM
RE: informatio from importer to importee - by Skaperen - Nov-19-2018, 01:37 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Custom importer and errors Fips 6 595 Apr-14-2024, 02:34 PM
Last Post: Pedroski55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020