Python Forum
what works with the with statement?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what works with the with statement?
#1
is there a list of everything that works with the with statement? or, alternatively, everything that does not work with the with statement? i could not find anything at all, one way or the other, regarding how a particular function behaved, so i had to set up a test script.
import os
with os.open('/dev/tty',os.O_WRONLY) as fd:
    write(fd,b'foo\n')
write(fd,b'bar\n')
i don't want to have to do this with everything i might use the with statement with.
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
what works with the with statement? - by Skaperen - Jan-02-2022, 11:19 PM

Forum Jump:

User Panel Messages

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