Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-04 Thread Chris Angelico
On Mon, Apr 5, 2021 at 2:21 AM jak wrote: > > I modified your code in the following way: > > line 65-66: > from: > > if (qty <= alternate["per_minute"] > and (costs[Extractor], costs) > (alternate["costs"][Extractor], > alternate["costs"]) > > to: > if (qty <=

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-04 Thread jak
Il 04/04/2021 18:18, jak ha scritto: Il 04/04/2021 11:13, Chris Angelico ha scritto: On Sun, Apr 4, 2021 at 6:26 PM jak wrote: Il 01/04/2021 01:14, Chris Angelico ha scritto: copy / paste corrupted the tabs, sorry -- https://mail.python.org/mailman/listinfo/python-list

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-04 Thread jak
Il 04/04/2021 11:13, Chris Angelico ha scritto: On Sun, Apr 4, 2021 at 6:26 PM jak wrote: Il 01/04/2021 01:14, Chris Angelico ha scritto: I think this code makes some sort of argument in the debate about whether Python has too much flexibility or if it's the best metaprogramming toolset in

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-04 Thread Chris Angelico
On Sun, Apr 4, 2021 at 6:26 PM jak wrote: > > Il 01/04/2021 01:14, Chris Angelico ha scritto: > > I think this code makes some sort of argument in the debate about > > whether Python has too much flexibility or if it's the best > > metaprogramming toolset in the world. I'm not sure which side of

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-04 Thread jak
Il 01/04/2021 01:14, Chris Angelico ha scritto: I think this code makes some sort of argument in the debate about whether Python has too much flexibility or if it's the best metaprogramming toolset in the world. I'm not sure which side of the debate it falls on, though. class Building:

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-03 Thread dn via Python-list
On 03/04/2021 18.45, Greg Ewing wrote: > On 3/04/21 10:36 am, Chris Angelico wrote: >> It means exactly what you'd expect. The tricky part comes when you try >> to knife the block of chocolate, and it makes for a hilarious party >> game. > > A guillotine could be useful in the case of

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread Greg Ewing
On 3/04/21 10:36 am, Chris Angelico wrote: It means exactly what you'd expect. The tricky part comes when you try to knife the block of chocolate, and it makes for a hilarious party game. A guillotine could be useful in the case of Whittaker's. IMO they don't make the grooves deep enough,

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread Alan Gauld via Python-list
On 02/04/2021 21:33, dn via Python-list wrote: > Bournville was the only Cadbury chocolate I would > consider. Today, even that seems to lack Cadbury has always been a budget chocolate brand(*) here; its a mass market option loaded with sugar and little else. Certainly doesn't compare to

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread Chris Angelico
On Sat, Apr 3, 2021 at 8:16 AM dn via Python-list wrote: > Is there such a thing as F/LOSS in the chocolate world? What does it > mean to fork a block of chocolate? Where is their repository? > It means exactly what you'd expect. The tricky part comes when you try to knife the block of

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread dn via Python-list
On 02/04/2021 13.00, Chris Angelico wrote: > On Fri, Apr 2, 2021 at 10:43 AM dn via Python-list > wrote: >> >> On 02/04/2021 10.13, Chris Angelico wrote: >>> Well, it's a simple matter of chronology. First you have crude oil, >>> then time passes, and then you have plastic and residue. It makes

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread dn via Python-list
On 02/04/2021 21.32, Alan Gauld via Python-list wrote: > On 02/04/2021 00:42, dn via Python-list wrote: > >> Contrarily "tuck" in (old) English slang represented "sweets" (or > > Not that old. We still use it occasionally today. And we > certainly had a "tuck shop" at school. It was where you >

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread Chris Angelico
On Sat, Apr 3, 2021 at 3:51 AM Avi Gross via Python-list wrote: > > Chris, > > Now that it is April 2, I have to ask which of the methods for dealing with > chocolate is more pythonic and is there a module for that? I have a JavaScript front end package called "Chocolate Factory", which works

RE: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread Avi Gross via Python-list
, 2021 8:00 PM To: Python Subject: Re: Horrible abuse of __init_subclass__, or elegant hack? On Fri, Apr 2, 2021 at 10:43 AM dn via Python-list wrote: > > On 02/04/2021 10.13, Chris Angelico wrote: > > Well, it's a simple matter of chronology. First you have crude oil, > >

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread Alan Gauld via Python-list
On 02/04/2021 00:42, dn via Python-list wrote: > Contrarily "tuck" in (old) English slang represented "sweets" (or Not that old. We still use it occasionally today. And we certainly had a "tuck shop" at school. It was where you bought lunch if not eating in the refectory. ie. sandwiches, crisps,

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-02 Thread Chris Angelico
On Fri, Apr 2, 2021 at 10:43 AM dn via Python-list wrote: > > On 02/04/2021 10.13, Chris Angelico wrote: > > Well, it's a simple matter of chronology. First you have crude oil, > > then time passes, and then you have plastic and residue. It makes > > sense ONLY if you think of it with a specific

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-01 Thread dn via Python-list
On 02/04/2021 10.13, Chris Angelico wrote: > On Fri, Apr 2, 2021 at 7:52 AM David L Neil via Python-list > wrote: >> Officially April-Fools Day is over (here), but... > This wasn't a prank post, although it was intended to give amusement > rather than real education or debate or anything. So

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-01 Thread Chris Angelico
On Fri, Apr 2, 2021 at 7:52 AM David L Neil via Python-list wrote: > > Officially April-Fools Day is over (here), but... This wasn't a prank post, although it was intended to give amusement rather than real education or debate or anything. So there's nothing wrong with keeping it going. :) > On

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-01 Thread David L Neil via Python-list
Officially April-Fools Day is over (here), but... On 01/04/2021 19.25, Chris Angelico wrote: > On Thu, Apr 1, 2021 at 3:36 PM dn via Python-list > wrote: >> >> On 01/04/2021 13.54, Chris Angelico wrote: >>> Real and imaginary are the same thing, just rotated a quarter turn >> >> In which

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-01 Thread Chris Angelico
On Thu, Apr 1, 2021 at 3:36 PM dn via Python-list wrote: > > On 01/04/2021 13.54, Chris Angelico wrote: > > Real and imaginary are the same thing, just rotated a quarter turn > > In which dimension(s)? Cartesian. > >> Without looking into the details/context: surely there's a more > >>

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-04-01 Thread Alan Gauld via Python-list
On 01/04/2021 00:14, Chris Angelico wrote: > On a scale of 1 to "submit this to The Daily WTF immediately", how bad > is this code? :) The only worthwhile test of code quality is whether a new member of the team, competent in the language but not an expert can understand the code in two readings

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-03-31 Thread dn via Python-list
On 01/04/2021 13.54, Chris Angelico wrote: > On Thu, Apr 1, 2021 at 11:39 AM dn via Python-list > wrote: >> >> On 01/04/2021 12.14, Chris Angelico wrote: >>> I think this code makes some sort of argument in the debate about >>> whether Python has too much flexibility or if it's the best >>>

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-03-31 Thread Chris Angelico
On Thu, Apr 1, 2021 at 11:39 AM dn via Python-list wrote: > > On 01/04/2021 12.14, Chris Angelico wrote: > > I think this code makes some sort of argument in the debate about > > whether Python has too much flexibility or if it's the best > > metaprogramming toolset in the world. I'm not sure

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-03-31 Thread dn via Python-list
On 01/04/2021 12.14, Chris Angelico wrote: > I think this code makes some sort of argument in the debate about > whether Python has too much flexibility or if it's the best > metaprogramming toolset in the world. I'm not sure which side of the > debate it falls on, though. > > class Building: >

Re: Horrible abuse of __init_subclass__, or elegant hack?

2021-03-31 Thread Ethan Furman
On 3/31/21 4:14 PM, Chris Angelico wrote: I think this code makes some sort of argument in the debate about whether Python has too much flexibility or if it's the best metaprogramming toolset in the world. I'm not sure which side of the debate it falls on, though. Well, `__init_subclass__` is

Horrible abuse of __init_subclass__, or elegant hack?

2021-03-31 Thread Chris Angelico
I think this code makes some sort of argument in the debate about whether Python has too much flexibility or if it's the best metaprogramming toolset in the world. I'm not sure which side of the debate it falls on, though. class Building: resource = None @classmethod def