Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!

Data Graham posted:

Waiwaiwait. I feel like this means I might have been doing poo poo wrong for years then.

Does this mean

code:
def foo(blah, my_list=[]):
Or

code:
foo(blah, [])
are wrong? What do I need to be doing (and fixing in ... like .. all of my code ever)?

All you'd need to do is

code:
def foo(blah, my_list=None):
    my_list = my_list or list()
    ...

Adbot
ADBOT LOVES YOU

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
I am setting up a python dev environment on Windows 11, only ever used Linux or Mac. On those I just `conda install python3` and let conda manage all my dependencies cause I typically need the scientific poo poo.

Just do the same thing in Windows?

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
Setting up a windows dev environment serves two purposes for me:

1. I’ve never done any programming in a non-*nix based environment. I’m genuinely curious.

2. At my job we use some various command line tools ran via Cygwin, some being python scripts, and let’s just say that these tools are “statically” (i mean, the paths are hard coded, everything is hard coded) linked to a random python.exe file inside a completely and entirely unrelated software folder in c:/program files. These python scripts are like mission critical. Like seriously one of the default things they do is download and install an old version of a program that we don’t use just because all the python scripts we do use point to a python.exe inside that folder.

I’d like to change that but now that I typed this all out I feel like I should just leave it alone.

E: So setting up python in windows for my own personal use was to get python running. I’m (obviously) not going to copy company code onto my personal computer or work for free at home to figure this out, but I figure I could develop a simple concept for my own learning purposes, and then from there see if I can propose to get some support/funding to at the very least set up a dedicated and reproducible python environment for work poo poo.

Boris Galerkin fucked around with this message at 13:47 on Feb 13, 2024

Boris Galerkin
Dec 17, 2011

I don't understand why I can't harass people online. Seriously, somebody please explain why I shouldn't be allowed to stalk others on social media!
I think that if you’re learning to code, it’s better to be more explicit like their solution. If you’re just learning Python do what you’re doing.

Kinda like math, how you’re very much encouraged to "show your work" so to speak. I wouldn’t expect students in like physics 400+ to show every single step of a derivative … but the intro to calculus 101 students would be expected to.

Boris Galerkin fucked around with this message at 12:39 on Feb 15, 2024

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply