StackOverflow Questions for Tag: contextmanager

crm5024
crm5024

Reputation: 1

How do I use an asyncio context manager with Jupyter notebooks to create new tasks?

Score: 0

Views: 55

Answers: 0

Read More
Eric Grunzke
Eric Grunzke

Reputation: 1657

What is the proper way to type hint the return value of an @asynccontextmanager?

Score: 16

Views: 9483

Answers: 1

Read More
Ron Serruya
Ron Serruya

Reputation: 4446

How can I wait for an object's __del__ to finish before the async loop closes?

Score: 29

Views: 11310

Answers: 6

Read More
Keith Lee
Keith Lee

Reputation: 1

Mocked database cursor context manager missing the '__enter__'

Score: 0

Views: 38

Answers: 1

Read More
Bailey Parker
Bailey Parker

Reputation: 15903

Typing __exit__ in 3.5 fails on runtime, but typechecks

Score: 10

Views: 5357

Answers: 1

Read More
Thingamabobs
Thingamabobs

Reputation: 8042

Python Asyncio - Eventloop in a contextmanager

Score: 0

Views: 1207

Answers: 1

Read More
Ryan Haining
Ryan Haining

Reputation: 36882

Open a list of files using with/as context manager

Score: 24

Views: 5080

Answers: 3

Read More
user66081
user66081

Reputation: 458

Type hints for context manager

Score: 7

Views: 6267

Answers: 1

Read More
jared
jared

Reputation: 9046

Capture KeyboardInterrupt in context manager when OpenMPI run is manually terminated

Score: 0

Views: 75

Answers: 1

Read More
Kyle Truong
Kyle Truong

Reputation: 2751

Where is a Python built-in object's __enter__() and __exit__() defined?

Score: 4

Views: 1987

Answers: 4

Read More
user2138149
user2138149

Reputation: 17266

Is it possible to implement RAII with Python in the context of ensuring that the close() function is called on opened files?

Score: -2

Views: 84

Answers: 1

Read More
CosmicallyCosmo
CosmicallyCosmo

Reputation: 13

Is yielding a future from an contextlib asynccontextmanager unsafe?

Score: 1

Views: 259

Answers: 1

Read More
Arun Kaliraja Baskaran
Arun Kaliraja Baskaran

Reputation: 1086

How to use the same context manager across different methods?

Score: 4

Views: 267

Answers: 1

Read More
ng.newbie
ng.newbie

Reputation: 3227

Why leave the variable at the end of the with statement?

Score: -3

Views: 72

Answers: 1

Read More
shaoyl85
shaoyl85

Reputation: 1964

Context Manager without Yield

Score: 20

Views: 6164

Answers: 4

Read More
Staale
Staale

Reputation: 28008

How to put variables on the stack/context in Python

Score: 3

Views: 2429

Answers: 5

Read More
loqueelviento
loqueelviento

Reputation: 133

Acquiring/releasing a resource automatically when shared between class instances

Score: 0

Views: 43

Answers: 0

Read More
user3103957
user3103957

Reputation: 848

Usage of Async Context managers and Async Iterators in Async library in Python

Score: 1

Views: 419

Answers: 1

Read More
tbickford
tbickford

Reputation: 41

How to use a context manager to create an instance of a class?

Score: 1

Views: 110

Answers: 1

Read More
sixtyfootersdude
sixtyfootersdude

Reputation: 27231

Changing the exception type in a context manager

Score: 3

Views: 96

Answers: 1

Read More
PreviousPage 2Next