• 1 Post
  • 36 Comments
Joined 1 year ago
cake
Cake day: June 21st, 2023

help-circle
  • Since you have all your shutil.copytrees and sys.path manipulation at the top level of the test modules, they are executed the moment those modules are imported. unittest likely imports all discovered test modules before actually executing the tests so the set up of both modules is executed in random order before the tests are run. The correct way to perform test setup is using setUp and setUpClass methods of unittest.TestCase. Their counterparts tearDown and tearDownClass are used to clean up after tests. You probably will be able to get this to work somehow using those methods.

    However, I’m fairly certain that this entire question is an example of the XY problem and you should be approaching this whole thing differently. Copying the modules and their mock dependencies into a temporary directory and manipulating sys.path seems like an absolute nightmare and it will be a massive PITA even if you get it to a working state. I don’t know what problem exactly you’re trying to solve but I think you should really read up on unittest.mock and even more importantly on dependency injection.





  • So I’m going to say what I always say when people complain about semantic whitespace: Your code should be properly indented anyway. If it’s not, it’s a bad code.

    I’m not saying semantic whitespace is superior to brackets or parentheses. It’s clearly not. But it’s not terrible either.

    As someone who codes in Python pretty much everyday for years, I NEVER see indentation errors. I didn’t see them back when I started either. Code without indentation is impossible to read for me anyway so it makes zero difference whether the whitespace has semantic meaning or not. It will be there either way.


  • I’m pretty sure I have aphantasia. My mom, on the other hand, is an artist with very powerful imagination. She would often tell me how she sees something she’s imagining and I never really knew what she meant. I just assumed that it’s kinda a figure of speech. Only when I first read about aphantasia I realized that it probably really works completely differently for her.

    I would like to know whether aphantasia has any practical impact on one’s life. For example, I had this suspicion that differences in my “mental image processing pipeline” might be a factor in my terrible driving skills. Quick visual assessment of the traffic situation, at an intersection for instance, is very hard for me. This is just me making stuff up though, no idea if it makes any sense. In fact, I think I’m going to research this topic and look for some papers now!











  • I just don’t think the majority of people are motivated enough. I have met many people who have no hobbies and no ambitions and just don’t want to do anything productive. They would like to spend their entire lives playing video games or partying or something similar.

    And this is just about the lack of motivation, but what about malicious actors? People who would sabotage other’s efforts or try to profit in an unfair way? How would you ensure this won’t happen?

    What about shitty and unpleasant but necessary jobs no one wants to do?

    The idea that once you remove the money everyone will suddenly feel the desire to serve the society is bonkers. Don’t get me wrong, I don’t love capitalism. I want to believe the world like that is possible, I really do, but I just can’t see it working. I live in a society where I have to use a 3 kg bike lock in order not to lose my bike and even then I have to detach the $10 light and take it with me because otherwise it won’t be there when I come back. I have zero trust and belief that such society can magically self organize and work together towards a common happiness.


  • In such a system, people work on what they want, when they want, and provide for society because it’s their true desire.

    I find it kinda hard to believe that people would be able to achieve the level of organization and would be willing to put in the effort required just by doing what they want when they want, without any outside incentive. I’m not talking about a painting or a book, that’s why I specifically mentioned things requiring large investments. And by investment I didn’t mean just money but time and effort in general.




  • I definitely mean “stealing” as “depriving the publisher of the cost”. Limiting the term “stealing” just to moving physical objects really makes no sense in the current world.

    it only holds if you’d actually have ponied up were the content not available for free

    That’s an interesting case I never really considered. If you only genuinely pirate stuff you would never buy otherwise then… I guess it’s fine? But this alone doesn’t put the end to the discussion because I find it really hard to believe that people would just give up all of the stuff they pirate if they had to pay for it. But in some cases, sure, sounds reasonable.

    Artistic content is, believe it or not, produced outside of capitalism as well.

    That’s true of course but I don’t think just pretending we don’t live in a capitalist world and taking stuff for free is making this world better in any way.

    Let’s say something costs $20, from which 75% goes to make some rich guy even richer and only 25% goes to the actual author who put in the work. It’s more important to me to give that $5 to the author than NOT to give the $15 to the rich guy. Would I prefer there wasn’t a rich guy in the equation? Yes, of course, but that’s often just not possible.

    In the end, I genuinely want the world to be a better place but I don’t really believe in extreme solutions. I appreciate your civilized answer despite different opinions. Peace!


  • No, I don’t, because I can afford stuff and pirating in this situation would be just pure stealing which I believe is morally wrong. Yes, being a billionaire is usually morally wrong too but I don’t think it just cancels out.

    Justifying piracy by saying capitalism is bad sounds like a hypocrisy to me. You want to use something that exists thanks to capitalism without participating in it. You want to eat your cake and have it too.

    Now, the case is different for people that can’t afford stuff, especially when they genuinely need it (but I don’t draw the line at entertainment, after all people NEED entertainment too). In that case, please pirate away. Everyone deserves a decent life. In general, I largely agree with OP’s friend.