Python Forum
i want to make my own context manager
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
i want to make my own context manager
#1
i want to make my own context manager. maybe more than one. i'm reading docs for module contextmanager but it seems to not be very thorough. the first one i want to make is to be file-object-like object. that is, it should be usable like a file object, including as a context manager (so its creator can be used in a with statement in place of open(). this is one reason i haven been reading up on file-object methods (to see what all i need to implement.
Tradition is peer pressure from dead people

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


Possibly Related Threads…
Thread Author Replies Views Last Post
  exception context Skaperen 0 2,304 Mar-06-2021, 08:42 PM
Last Post: Skaperen
  function to store in caller's context Skaperen 7 2,956 Jul-27-2020, 08:45 PM
Last Post: Skaperen
  turning my function into a context manager Skaperen 2 1,926 Nov-14-2019, 09:08 PM
Last Post: Skaperen
  same context functions Skaperen 12 5,181 Jun-18-2019, 06:09 PM
Last Post: Skaperen
  Windows Context Menu Depth GWild 0 2,303 Jan-27-2018, 07:18 AM
Last Post: GWild

Forum Jump:

User Panel Messages

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