On 30/08/2021 00.47, Peter Otten wrote:
> On 29/08/2021 12:13, dn via Python-list wrote:
>> On 29/08/2021 20.06, Peter Otten wrote:
>> ...
>>> OK, maybe a bit complicated... but does it pay off if you want to
>>> generalize?
>>>
>> def roll_die(faces):
>>> while True: yield random.randrang
The proposed semantics would be the same as self.__privs__[__class__,
"foo"]; yes I can say the problem is ugliness. The following is an example
where name mangling can be problematic (of course there are workarounds,
yet if double-underscores are meant to represent class-specific members,
the foll
On Mon, Aug 30, 2021 at 9:53 AM dn via Python-list
wrote:
>
> On 29/08/2021 22.24, Chris Angelico wrote:
> > On Sun, Aug 29, 2021 at 8:14 PM dn via Python-list
> > wrote:
> >> Efficiency:
> >> - wonder how max( d ) == min( d ) compares for speed with the set() type
> >> constructor?
> >
> > That
On 29/08/2021 22.24, Chris Angelico wrote:
> On Sun, Aug 29, 2021 at 8:14 PM dn via Python-list
> wrote:
>> Efficiency:
>> - wonder how max( d ) == min( d ) compares for speed with the set() type
>> constructor?
>
> That may or may not be an improvement.
>
>> - alternately len( d ) < 2?
>> - or
On Mon, Aug 30, 2021 at 5:49 AM Mehrzad Saremi wrote:
>
> No, a class ("the class that I'm lexically inside") cannot be accessed from
> outside of the class. This is why I'm planning to offer it as a core
> feature because only the parser would know. There's apparently no elegant
> solution if you
No, a class ("the class that I'm lexically inside") cannot be accessed from
outside of the class. This is why I'm planning to offer it as a core
feature because only the parser would know. There's apparently no elegant
solution if you want to implement it yourself. You'll need to write
self.__privs
Loris Bennett ezt írta (időpont: 2021. aug.
26., Cs, 16:02):
> George Fischhof writes:
>
> [snip (79 lines)]
>
> >> > Hi,
> >> >
> >> > Also you can give a try to click and / or typer packages.
> >> > Putting args into environment variables can be a solution too
> >> > All of these depends on s
On 29/08/2021 20:44, joseph pareti wrote:
In the code attached below, the A-variant is from somebody else who knows
Python better than I. But I do not like to just use any code without having
a grasp, specifically the line in* bold*, so I wrote the B-variant which
gives the same results. The C-va
In the code attached below, the A-variant is from somebody else who knows
Python better than I. But I do not like to just use any code without having
a grasp, specifically the line in* bold*, so I wrote the B-variant which
gives the same results. The C-variant is identical to A and is there for
ver
On 29/08/2021 12:13, dn via Python-list wrote:
On 29/08/2021 20.06, Peter Otten wrote:
...
OK, maybe a bit complicated... but does it pay off if you want to
generalize?
def roll_die(faces):
while True: yield random.randrange(1, 1 + faces)
def hmt(faces, dies):
for c, d in enumera
On Sun, Aug 29, 2021 at 8:14 PM dn via Python-list
wrote:
> Efficiency:
> - wonder how max( d ) == min( d ) compares for speed with the set() type
> constructor?
That may or may not be an improvement.
> - alternately len( d ) < 2?
> - or len( d ) - 1 coerced to a boolean by the if?
Neither of t
On 29/08/2021 20.06, Peter Otten wrote:
...
> OK, maybe a bit complicated... but does it pay off if you want to
> generalize?
>
def roll_die(faces):
> while True: yield random.randrange(1, 1 + faces)
>
def hmt(faces, dies):
> for c, d in enumerate(zip(*[roll_die(faces)]*dies), 1
> On 28 Aug 2021, at 22:42, Hope Rouselle wrote:
>
> I'd like get a statistic of how often each loop is used in practice.
>
> I was trying to take a look at the Python's standard libraries --- those
> included in a standard installation of Python 3.9.6, say --- to see
> which loops are mor
On 28/08/2021 14:00, Hope Rouselle wrote:
def how_many_times():
x, y = 0, 1
c = 0
while x != y:
c = c + 1
x, y = roll()
return c, (x, y)
--8<---cut here---end--->8---
Why am I unhappy? I'm wish I could confine x, y to the while loop. T
14 matches
Mail list logo