humdrum.sigh_strenght = 'high'
humdrum.snort()
> Snort!
>
> At this point I wondered why my output was not "SNORT!!!". Then I
> noticed my typo. But now I wonder why I did not get an error from
> this typo?
Hi boB,
Just to be explicit: you are pointing out that:
On 20Jan2016 22:34, boB Stepp wrote:
My intent was to deliberately introduce an error into my class definition:
class Hmm(object):
def __init__(self, sigh_type, sigh_strength):
self.sigh_type = sigh_type
self.sigh_strength = sigh_strength
I'm whizzing along in "Python Crash Course" and am in the chapter on
classes. Just to satisfy my suspicion that "self" is just a
placeholder for creating an object instance, I tried the following:
>>> class Dog(object):
def __init__(this, name, age):
this.name = name
On 20Jan2016 21:42, boB Stepp wrote:
I'm whizzing along in "Python Crash Course" and am in the chapter on
classes. Just to satisfy my suspicion that "self" is just a
placeholder for creating an object instance,
No, it is a placeholder for a _preexiting_ object
My intent was to deliberately introduce an error into my class definition:
>>> class Hmm(object):
def __init__(self, sigh_type, sigh_strength):
self.sigh_type = sigh_type
self.sigh_strength = sigh_strength
def snort(self):
if self.sigh_strength
> So I really only have one question: Why not make Python's
> *traditional* name, "self", mandatory? Why give the programmer this
> kind of choice? [OK, that was two questions.]
There are situations where it might not be mandatory.
This is definitely not beginner Python material, so I don't
boB Stepp writes:
> So I really only have one question: Why not make Python's
> *traditional* name, "self", mandatory? Why give the programmer this
> kind of choice?
For the same reason that four-space indentation is not mandatory, yet
anyone who chooses a different
boB Stepp writes:
> My intent was to deliberately introduce an error into my class definition:
>
> >>> class Hmm(object):
> def __init__(self, sigh_type, sigh_strength):
> self.sigh_type = sigh_type
> self.sigh_strength = sigh_strength
>
On Wed, Jan 20, 2016 at 01:33:17PM +, Albert-Jan Roskam wrote:
> Hi,
>
> Like the subject says: Why is an OrderedDict not sliceable? (From the
> collections library). Was that an intentional omission, or a mistake?
> [1]
Because slicing a dict makes no sense. A dict is a mapping, not a
After successfully installing dlib and cv2, I have now been asked to
install the cv library on Ubuntu.
>From what I have read, it seems OpenCV has discontinued support for cv and
only cv2 is used now. Am I correct? Regardless, does anyone know how I can
get this library?
I apologize in advance
On 20/01/16 10:55, Rheeya Uppaal wrote:
> After successfully installing dlib and cv2, I have now been asked to
> install the cv library on Ubuntu.
>
> From what I have read, it seems OpenCV has discontinued support for cv and
> only cv2 is used now. Am I correct? Regardless, does anyone know how
Hi,
Like the subject says: Why is an OrderedDict not sliceable? (From the
collections library). Was that an intentional omission, or a mistake? [1]
Background: I do not use OrderedDict very often, but I thought I could use it
to look up street and city names using postcodes ([0-9]{4} [a-z]{2}
12 matches
Mail list logo