It's wrong. Python3 eliminated mountains of annoying bugs that happened all over the code base because of mixing of unicode strings and byte strings. Python2 was an absolute mess.
You think so but then you write a function with a default argument pointing to some variable that is a list and now suddenly the semantics of that are... what?
you could just treat argument initialization as an executable expression which is called every time you call a function. If you have a=[], then it's a new [] every time. If a=MYLIST then it's a reference to the same MYLIST. Simple. And most sane languages do it this way, I really don't know why python has (and maintain) this quirk.
b = ComplexObject (...)
# do things with b
def foo (self, arg=b):
# use b
return foo
Should it create a copy of b every time the function is invoked? If you want that right now, you can just call b.copy (), when you always create that copy, then you can not implement the current choice.
I wonder, why that kind of ambiguity or complexity even comes to your mind at all. Just because python is weird?
def foo(self, arg=expression):
could, and should work as if it was written like this (pseudocode)
def foo(self, arg?):
if is_not_given(arg):
arg=expression
if "expression" is a literal or a constructor, it'd be called right there and produce new object, if "expression" is a reference to an object in outer scope, it'd be still the same object.
it's a simple code transformation, very, very predictable behavior, and most languages with closures and default values for arguments do it this way. Except python.
What you want is for an assignment in a function definition to be a lambda.
def foo (self, arg=lambda : expression):
Assignment of unevaluated expressions is not a thing yet in Python and would be really surprising. If you really want that, that is what you get with a lambda.
> most languages with closures and default values for arguments do it this way.
Do these also evaluate function definitions at runtime?
I'm banned for expressing my opinion that harassing new joiners who say "hey guys" is a bad idea. They claim it's anti-women to do that, even though the dictionary clearly says it's a gender neutral expression and you can see it in countless movies being said by women to only women.
Imo it's not inclusive to harass people for using English properly. But they think it's inclusive to ban me for that opinion. To each his own I guess.
You mean the nuclear waste that we banned companies from using as nuclear fuel for modern reactors? I think you will find that regulation actually stopped us from solving this problem.
> It's not working for corals either.
Imagine if we had much more nuclear power so we didn't produce enormous amounts of CO2! The corals would be in a much better position.
The "environmental movement" has been an anti-nuclear power movement that doesn't care about the environment since the beginning sadly. They've managed to harm the environment more than all nuclear accidents by several orders of magnitude.
> You mean the nuclear waste that we banned companies from using as nuclear fuel for modern reactors?
There is no need to ban this because it (and reprocessing in general) is economically idiotic. It would be like saying government bans prevent companies from setting money on fire.
Dry cask storage is a quite acceptable and economical way to deal with nuclear waste. The demand that something permanent be done immediately reflects a desire to use waste as a lever against nuclear energy. Nuclear fans would do well not to fall into this trap and think immediate reprocessing is necessary or desirable.
Sure, it's fine, but we've ALSO effectively banned research into reactor types that use "nuclear waste" as fuel. In Sweden it's not even effectively, we had laws on the books until quite recently that banned nuclear research.
This simply isn't true. Not as much may have been invested in said research, but that's more a reflection of the lack of a business case for such things. They are not a magical panacea to all of nuclear's woes.
Your logic reminds me of people who confuse consumer preference with boycotts.
The lack of a business case is do to the regulatory environment. The nuclear regulatory agency that was set up to license new nuclear plants just didn't. For decades they stalled all applications. That's why the industry died.
Obviously it's an S curve yes, but we are so far from living in an Ian M. Banks Culture novel that we don't have to worry for probably a million years. Anti-growth people are ideologues with bad imagination and some pseudo-religious hate of humanity driving their political trend.
I don't think you can get an LLM to write that personally. I tend to write with a bit too long run on sentences like that and have to edit myself carefully to make it readable. I don't think LLMs do that.
It's like when my kids say "that's AI!" about everything now. We're overreacting and thinking everything bad about writing is because of LLMs, but in fact, I think LLMs write better than 99% of humans now. A year ago that wasn't the case, but we need to update our priors.
Sorry, good English is good grammatically and structurally while being unique and feeling creative. and AI-written English is not good. It’s correct but totally repetitive, formulaic and circular. It’s like expecting a pizza and finding it’s made of cardboard.
I liked the content of the article enough to read it to the end, but I did have a hard time due to inflation with LLM-isms. Then again I am not a native so how would I know if this is good English? I can only tell that to me, it is hard to read despite interesting content.
reply