In printf-style formats, you can specify the number of digits for an integer
separately from the field width. E.g.
>>> "%#0.5x" % 0x123
'0x00123'
but not in new-style formats:
>>> "{:#0.5x}".format(0x123)
Traceback (most recent call last):
File "", line 1, in
ValueErr
On Sun, Jul 10, 2016 at 9:09 AM, Ethan Furman wrote:
> On 07/09/2016 02:57 PM, Chris Angelico wrote:
>>
>> On Sun, Jul 10, 2016 at 7:37 AM, Malik Rumi wrote:
>
>
>>> I want one of those "knuckle down and learn" classes. But even more
>
>>> than that, I want a class with a real teacher who is avail
On 07/09/2016 02:57 PM, Chris Angelico wrote:
On Sun, Jul 10, 2016 at 7:37 AM, Malik Rumi wrote:
I want one of those "knuckle down and learn" classes. But even more
>> than that, I want a class with a real teacher who is available to
>> answer questions and explain things. I've done a lot of
On Sun, Jul 10, 2016 at 7:37 AM, Malik Rumi wrote:
> I want one of those "knuckle down and learn" classes. But even more than
> that, I want a class with a real teacher who is available to answer questions
> and explain things. I've done a lot of books and online video, but there's
> usually no
On Sat, Jul 9, 2016 at 3:26 PM, Steven D'Aprano wrote:
> I'd like to get a quick show of hands regarding the names. Which do you
> prefer?
>
> hmean and gmean
>
> harmonic_mean and geometric_mean
I'd prefer the shorter names.
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
I want one of those "knuckle down and learn" classes. But even more than that,
I want a class with a real teacher who is available to answer questions and
explain things. I've done a lot of books and online video, but there's usually
no help. If I search around long enough, I can often find an a
On Sat, Jul 9, 2016 at 4:08 AM, wrote:
>
> I noticed __qualname__ is exposed by locals() while defining a class.
This is an undocumented implementation detail used to pass this
information to the metaclass. You'll also see __module__ and, if the
class has a docstring, __doc__. For CPython, this
On Sat, Jul 9, 2016, 12:57 PM Robert Kern wrote:
> On 2016-07-09 17:13, Michael Selik wrote:
> > On Sat, Jul 9, 2016 at 10:17 AM Jason Friedman
> wrote:
> >
> >>> +1 for consistency
> >
> > What do other languages use?
>
> R, the most likely candidate, doesn't have them built-in.
>
> scipy.stats
On 2016-07-09 17:13, Michael Selik wrote:
On Sat, Jul 9, 2016 at 10:17 AM Jason Friedman wrote:
+1 for consistency
What do other languages use?
R, the most likely candidate, doesn't have them built-in.
scipy.stats uses gmean() and hmean()
--
Robert Kern
"I have come to believe that the
Hi all,
I noticed __qualname__ is exposed by locals() while defining a class. This is
handy but I'm not sure about its status: is it standard or just an artifact of
the current implementation? (btw, the pycodestyle linter -former pep8- rejects
its usage). I was unable to find any reference to t
Hi all,
although it doesn't fit the bill 100%, I sometimes use this extremely simple
function as a decorator:
def new(call):
return call()
For example:
@new
class MySingleton:
x = 2
y = 2
def sum(self, x, y):
return x + y
@new
def my_obj():
x = 2
y = 2
de
On Sat, Jul 9, 2016 at 10:17 AM Jason Friedman wrote:
> > +1 for consistency
>
What do other languages use?
Even though I generally prefer complete words instead of abbreviations, if
an abbreviation is a strong standard across many statistics modules (like
"stdev" instead of "standard_deviation
>
> +1 for consistency, but I'm just fine with the short names. It's in the
> statistics module after all, so the context is very narrow and clear and
> people who don't know which to use or what the one does that they find in a
> given piece of code will have to read the docs and maybe fresh up th
On 07/09/2016 03:23 AM, Stefan Behnel wrote:
Ethan Furman schrieb am 09.07.2016 um 08:27:
On 07/08/2016 10:49 PM, Random832 wrote:
On Sat, Jul 9, 2016, at 01:26, Steven D'Aprano wrote:
hmean and gmean
harmonic_mean and geometric_mean
The latter, definitely.
My preference is also for the
Ethan Furman schrieb am 09.07.2016 um 08:27:
> On 07/08/2016 10:49 PM, Random832 wrote:
>> On Sat, Jul 9, 2016, at 01:26, Steven D'Aprano wrote:
>
>>> hmean and gmean
>>>
>>> harmonic_mean and geometric_mean
>>
>> The latter, definitely.
>
> My preference is also for the latter. However, if the
Steven D'Aprano wrote:
> As requested in issue 27181 on the bug tracker, I'm adding functions to
> calculate the harmonic and geometric means to the statistics module.
>
> I'd like to get a quick show of hands regarding the names. Which do you
> prefer?
>
> hmean and gmean
>
> harmonic_mean and
16 matches
Mail list logo