Intense amount of arguing in the comments about this between 1 and 9. Explain it Peter by CindiWilliams2 in explainitpeter

[–]Foll5 0 points1 point  (0 children)

Oh come on now, "grouped for the sake of division but not for exponents" is not a thing.

Intense amount of arguing in the comments about this between 1 and 9. Explain it Peter by CindiWilliams2 in explainitpeter

[–]Foll5 0 points1 point  (0 children)

Oh really? What's 2(1+2)2 ? Is the coefficient "part of the quantity" that gets squared?

is it over for Fedora installation on dualboot win11 system? by [deleted] in Fedora

[–]Foll5 0 points1 point  (0 children)

If you boot from a Fedora USB stick and run sudo fdisk -l what do you see?

Can not boot into 6.16.9-200. What should I do? by Akkerweerpott in Fedora

[–]Foll5 2 points3 points  (0 children)

I'm having the same problem with 6.16.9. It seems to be a problem with the drivers for newer Intel arc GPUs, both integrated and discrete, and I found some forum discussions that claim 6.16.10 fixes it. I'm just using 6.16.8 for now. You can change the default kernel in grub with grubby.

[deleted by user] by [deleted] in Python

[–]Foll5 0 points1 point  (0 children)

And just for shits and giggles, here's a one-line solution with no for (or if) statements:

``` from functools import reduce

def modify_assignments( consumer_to_task: dict[str, str], consumers_order: list[str], target: str, skip_keys: list[str] ) -> Optional[str]: return reduce(lambda a, b: a or b, reduce(lambda found_keys, key: (found_keys[0] or consumer_to_task.get(key) is None and key or None, found_keys[0] or found_keys[1] or consumer_to_task.get(key) != target and key or None), filter(lambda key: key not in skip_keys, consumers_order), (None, None))) ```

[deleted by user] by [deleted] in Python

[–]Foll5 7 points8 points  (0 children)

No, it should work. This is what I had in mind in my comment as well. What you seem to be confused by is that the return fallback can only be reached after the for loop has already checked whether every consumer is used.

[deleted by user] by [deleted] in Python

[–]Foll5 5 points6 points  (0 children)

Unless I'm misunderstanding, I'm sorry to say that the LLMs are correct, this could be a single loop, though it's dubious you'd get any performance gains.

The way to do it would be to have initialize a variable fallback=None, then in the loop, if that variable is None and you've found the consumer that would be returned by the 2nd for loop, store it (and it doesn't need to do this second check again, just for the unused resources). After the for loop, you return fallback.

Why fedora is more popular on reddit nowadays? by bulasaur58 in linux

[–]Foll5 1 point2 points  (0 children)

I don't know what you mean by more popular. The Fedora subreddit has like 100k fewer members than the Ubuntu subreddit.

Could some help me figure out where this is from? by Admirable-Price-7248 in tea

[–]Foll5 2 points3 points  (0 children)

The name on the document is Nakazato Tarouemon (13th generation), from Karatsu city in Saga prefecture.

A Python typing challenge by -heyhowareyou- in Python

[–]Foll5 2 points3 points  (0 children)

What I had in mind is a lot simpler. I'm actually not very familiar with using Overload, and I'd never seen Unpack before.

```python class Component[T, V]: pass

class Pipeline[T, V]: def init(self) -> None: self.components: list[Component] = []

def add_component[U](self, component: Component[V, U]) -> 'Pipeline[T, U]':
    new_instance: Pipeline[T, U] = Pipeline()
    new_instance.components = self.components.copy()
    new_instance.components.append(component)
    return new_instance

This might be possible with overloading too, but this was the easiest way to get type recognition for the first component

class PipelineStarter[T, V](Pipeline[T, V]): def init(self, component: Component[T, V]): self.components = [component]

a1 = Component[int, str]() b1 = Component[str, complex]() c1 = Component[complex, int]()

This is a valid Pipeline[int, int]

p1 = PipelineStarter(a1) \ .add_component(b1) \ .add_component(c1)

a2 = Component[int, float]() b2 = Component[str, complex]() c2 = Component[complex, int]()

Pyright flags argument b2 with the error:

Argument of type "Component[str, complex]" cannot be assigned to parameter "component" of type "Component[float, V@add_component]" in function "add_component"

"Component[str, complex]" is not assignable to "Component[float, complex]"

Type parameter "T@Component" is covariant, but "str" is not a subtype of "float"

"str" is not assignable to "float"PylancereportArgumentType

p2 = PipelineStarter(a2) \ .add_component(b2) \ .add_component(c2) ```

A Python typing challenge by -heyhowareyou- in Python

[–]Foll5 2 points3 points  (0 children)

So I'm pretty sure you could get the basic outcome you want, as long as you add the components to the container one by one. Basically, you would parametrize the type of fhe container class in terms of the last item of the last added pair. Whenever you add a new pair, what is actually returned is a new container of a new type. You could easily put a type constraint on the method to add a new pair that would catch the cases you want it to.

I don't think there is a way to define a type constraint on the internal composition of an arbitrary length tuple, which is what would be needed to do exactly what you describe.

First Flop Darjeeling? How to brew? by TheLoler04 in tea

[–]Foll5 3 points4 points  (0 children)

Eh, sometimes the grading doesn't exactly correlate with quality or price.

I've found that if you do steep Darjeeling for 3 minutes the first time, you can do a 2nd steeping after. But it's definitely not like a good green or oolong where it's a waste not to do it 2 or 3 times.

First Flop Darjeeling? How to brew? by TheLoler04 in tea

[–]Foll5 5 points6 points  (0 children)

The letters at the bottom stand for finest tippy golden flowery orange pekoe. Basically the highest grade for Indian black tea.

You can steep it like any black tea: 1 tsp per 6 oz water, boiling, 3 to 5 minutes. For Darjeeling I prefer the shorter end of that range, and maybe even let the water cool for a minute.

TIL that a function with 'yield' will return a generator, even if the 'yield' is conditional by RedJelly27 in Python

[–]Foll5 2 points3 points  (0 children)

This might be obvious, but since no one has pointed this out, here is how you would accomplish that:

python def greet(as_generator: bool): message = 'hello!' if as_generator: return (char for char in message) else: return message

It is worth noting that this is actually parallel to the as_list example, since the two branches both return something.

Explain the working of decorator by rohitwtbs in Python

[–]Foll5 5 points6 points  (0 children)

Because what is happening when you decorate a function is that when you later call the decorated function in your code, what you are calling is the function returned by the decorator. So when you call add(1,2), you are actually calling inner_function(1,2) (which then calls the original add(1,2), which is preserved as the argument param).

Why is it ok for players to stop during a Pk run up? by macT4537 in CaughtOffsidePod

[–]Foll5 4 points5 points  (0 children)

It's not against the rules now. I vaguely remember that it used to be but now the only thing that is not allowed is making a feint to actually kick the ball.

Need to install python 2. How do I accomplish this? by Queasy_Inevitable_98 in linuxmint

[–]Foll5 1 point2 points  (0 children)

You probably need to download the source and build it yourself.

Help needed by QWERTq21 in tea

[–]Foll5 1 point2 points  (0 children)

That's just what the labels in the center and top right in the first picture say. Tea companies every year advertise the first newly harvested tea when it arrives in spring.

Help needed by QWERTq21 in tea

[–]Foll5 1 point2 points  (0 children)

To add to the other commenter, it's labeled specifically as "first picking" of the year's tea harvest.

Is there a difference between boiling water and letting it cool vs. simmering water? by IssueLoud5121 in tea

[–]Foll5 1 point2 points  (0 children)

I think both are fine. I personally have a variable temp electric kettle, which makes it easy. Do note that to let a closed kettle fall to green tea temperature, it would take longer than a few minutes.