[Tutor] Need to discuss about a class that can be used to print number of vowels, consonants, uppercase and lowercase letters and spaces in a string

dn PyTutor at DancesWithMice.info
Fri Aug 20 19:06:40 EDT 2021


On 21/08/2021 00.09, Peter Otten wrote:
> On 19/08/2021 23:44, dn via Tutor wrote:
> 
>> language where it is a requirement) that all data-attributes should
>> either be defined in the class or __init__()?
>>
>> (I realise that in Python we (usually) initialise value, which
>> (inherently) defines the attribute's type, rather than considering them
>> two potentially-separate steps)
>>
>> I remember being 'dinged' about this by some 'checker' facility. Regret
>> unable to reference which one.
> 
> pylint, probably:
> 
> PS C:\Users\Peter> type demo.py
> class Stuff:
>     def __init__(self):
>         self.x = 0
>     def update(self):
>         self.y = 0
> PS C:\Users\Petery> pylint demo.py
> ************* Module demo
> ...
> demo.py:5:8: W0201: Attribute 'y' defined outside __init__
> (attribute-defined-outside-init)
> ...
> ------------------------------------
> Your code has been rated at -4.00/10

Thanks Peter, yes that looks vaguely-familiar!


> But it's  hard to take a checker that awards minus four out of ten
> points seriously:)

In which case, there's a treat in-store for you!

Somewhat following in the tradition of Monty Python and 'clever' British
comedy, may I introduce you to a TV show called "QI" (Quite
Interesting). Seldom does any of the four panellists manage to achieve a
positive-score - and even less frequently can anyone explain or justify
the scores anyway:-

«Quite Interesting - or 'QI' to its friends - could loosely be described
as a comedy panel quiz. However, none of the stellar line-up of
comedians is expected to be able to answer any questions, and if anyone
ends up with a positive score, they can be very happy with their
performance. Points are awarded for being interesting or funny (and,
very occasionally, right) but points are deducted for answers which
merely repeat common misconceptions and urban myth. (Alan Davies has
turned this aspect of the game into somewhat of an artform.) It's okay
to be wrong, but don't be obviously, boringly wrong. In this way, QI
tries to rid the world of the flotsam of nonsense and old wives' tales
that can build up in your mind. QI not only makes us look more closely
at things, it encourages us to question all the received wisdom we have
carried with us since childhood. Think of the program as a humorous
cranial de-scaler.

QI isn't really about pointless information, or shoring up vast banks of
trivia, It's about finding undiscovered connections and seeing hidden
patterns, just like the best comedy. After all, curiosity is hardwired
in all of us; we just lose the ability to indulge it. "The lust of the
mind", Thomas Hobbes called it, "that exceedeth the short vehemence of
any carnal pleasure". There you have it, and from a philosopher not a
press release. QI: better than sex.
...
»
http://old.qi.com/tv/


Strangely-enough, the current or up-to-date web coverage is decidedly
boring and lacking in humor:-
«Our flagship show, QI (Quite Interesting), is a BBC comedy panel quiz
with impossible questions and points for being interesting. Each series
looks at a different letter of the alphabet.
...
»
https://qi.com/shows/qi
-- 
Regards,
=dn


More information about the Tutor mailing list