Skip to main content

New answers tagged

0 votes

Share Global Variable in DLL, feasible or naive?

In theory, you can achieve this in multiple ways. You can use a shared memory, via the file mapping API. You can have the state in a "master" process and the "slave" processes can ...
anon_user123456's user avatar
1 vote

How would I go about writing my own implementation of Win32 functions?

From a technical perspective. Yes, you can do this. It can be accomplished by something called DLL search order hijacking. However this is a pretty rudimentary security vulnerability and is likely ...
anon_user123456's user avatar
3 votes

What side-effects, if any, are okay when importing a python module?

One big issue with your example logging code is that both those lines of code could fail for a multitude of reasons (read-only filesystem, invalid path, lack of filesystem permissions, etc). These ...
bta's user avatar
  • 1,161
-3 votes

What side-effects, if any, are okay when importing a python module?

TL;DR Side effects are unacceptable until they are unavoidable. Convention Python libraries are "quick and dirty" - they rely heavily on global shared state and there is little to be done ...
Basilevs's user avatar
  • 2,268
13 votes

What side-effects, if any, are okay when importing a python module?

However, in a lot of cases, the side-effects are hard to avoid or may be desirable. They are never hard to avoid, and they are never desirable. Or maybe they somewhat are hard to avoid, because it ...
freakish's user avatar
  • 1,926
21 votes

What side-effects, if any, are okay when importing a python module?

logging # Creates a logfile logging.basicConfig(filename="module.log") No, don't do it! Now git status is dirty, it shows an untracked file. Protect this with a __main__ guard, or let ...
J_H's user avatar
  • 7,600

Top 50 recent answers are included