On 07Jan2016 00:06, ALAN GAULD wrote:
On 06/01/16 23:00, Cameron Simpson wrote:
... ensures that if you subclass the class, you automatically
get a valid constructor as well.
Wouldn't it return an instance of the superclass rather than
the sub class? You'd need to override it wouldn't you?
On Thu, Jan 07, 2016 at 12:06:17AM +, Alan Gauld wrote:
> On 06/01/16 23:00, Cameron Simpson wrote:
>
> >>> ... ensures that if you subclass the class, you automatically
> >>> get a valid constructor as well.
> >>
> >> Wouldn't it return an instance of the superclass rather than
> >> the sub c
On Wed, Jan 06, 2016 at 07:04:24PM +, Alan Gauld wrote:
> On 06/01/16 18:23, yehudak . wrote:
> > My grandson Guy (8th grader) is learning Python at school. That's what made
> > me teach myself Python programming as well.
> > Yesterday he asked my help in his homework:
> >
> > Write a FOR-loop
On Wed, Jan 06, 2016 at 06:57:31PM +, Alan Gauld wrote:
> On 06/01/16 14:46, Steven D'Aprano wrote:
> > I don't understand what you mean by "Python doesn't support named
> > constructors". It seems to me that this is the *only* sort of
> > constructor that Python supports.
>
> No, Python co
On 06/01/16 18:57, Alan Gauld wrote:
>> The solution is to use constructors with different names, which C++
>> calls "named constructors".
>
> I stopped using C++ around v2 and it didn't have such a feature.
> Maybe its been added since. If so that's good to know. (Time
> for some googling methi
On 06/01/16 23:00, Cameron Simpson wrote:
>>> ... ensures that if you subclass the class, you automatically
>>> get a valid constructor as well.
>>
>> Wouldn't it return an instance of the superclass rather than
>> the sub class? You'd need to override it wouldn't you?
>
> No, when you call:
>
>
Hello there,
>I refer to this website
>https://www.codecademy.com/forum_questions/50721fce7c7091000201e56a
>
>dic = {'key1': ["value1", "value2"],
> 'key2': ["value77", "something"] }
>
>what I wanted to learn is :
>
>a) how do i get the key only by providing value i.e value77 ?
N.B. Fir
On 06Jan2016 18:57, ALAN GAULD wrote:
On 06/01/16 14:46, Steven D'Aprano wrote:
It would be reasonable to make this a factory function declared in the
global module level. But I think making it a classmethod is better.
I won't put up much of an argument here. In C++ or Java I'd
definitely say
Hi All,
I refer to this website
https://www.codecademy.com/forum_questions/50721fce7c7091000201e56a
dic = {'key1': ["value1", "value2"],
'key2': ["value77", "something"] }
what I wanted to learn is :
a) how do i get the key only by providing value i.e value77 ?
b) Please help to break t
On Wed, Jan 6, 2016 at 9:07 PM, yehudak . wrote:
> Alan, Tahir & friends,
> My post was not a question, merely an observation.
> I hope there's no objection to my mail.
>
> Yehuda
>
> On Wed, Jan 6, 2016 at 10:59 PM, wrote:
>
> > Send Tutor mailing list submissions to
> > tutor@python.or
Alan, Tahir & friends,
My post was not a question, merely an observation.
I hope there's no objection to my mail.
Yehuda
On Wed, Jan 6, 2016 at 10:59 PM, wrote:
> Send Tutor mailing list submissions to
> tutor@python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>
Ahlan Tahir, That's EXACTLY my point.
Thank you,
Yehuda
On Wed, Jan 6, 2016 at 10:59 PM, Tahir Hafiz wrote:
> Yes that is a huge for loop.
> I can do it like this but I won't try:
> >>> for num in list(range(100)):
> >>> print(num)
>
> Sort of strange that the school wanted so much loopin
Yes that is a huge for loop.
I can do it like this but I won't try:
>>> for num in list(range(100)):
>>> print(num)
Sort of strange that the school wanted so much looping for your grandson,
they could have picked a lower number to demonstrate a for loop.
By the way there is the tqdm module
On Wed, Jan 6, 2016 at 10:23 AM, yehudak . wrote:
> My grandson Guy (8th grader) is learning Python at school. That's what
made
> me teach myself Python programming as well.
> Yesterday he asked my help in his homework:
>
> Write a FOR-loop that prints all numbers up to 100
Try to say explici
yehudak . wrote:
> My grandson Guy (8th grader) is learning Python at school. That's what
> made me teach myself Python programming as well.
> Yesterday he asked my help in his homework:
>
> Write a FOR-loop that prints all numbers up to 100
>
> Thank you, the gods of Ctrl+C
Did you mean to
On 06/01/16 18:23, yehudak . wrote:
> My grandson Guy (8th grader) is learning Python at school. That's what made
> me teach myself Python programming as well.
> Yesterday he asked my help in his homework:
>
> Write a FOR-loop that prints all numbers up to 100
And the question is?
Python has
Second attempt, my PC crashed just as I was sending the first
one. You might see two similar posts, if so apologies...
On 06/01/16 14:46, Steven D'Aprano wrote:
> I don't understand what you mean by "Python doesn't support named
> constructors". It seems to me that this is the *only* sort of
> c
My grandson Guy (8th grader) is learning Python at school. That's what made
me teach myself Python programming as well.
Yesterday he asked my help in his homework:
Write a FOR-loop that prints all numbers up to 100
Thank you, the gods of Ctrl+C
Yehuda
On Wed, Jan 6, 2016 at 9:57 AM, yehudak . wrote:
> Not a question, just ranting.
>
> My 2 commonest coding errors are forgetting the : before a block, and
> mismatch between the number of ('s and )'s. The error message is a simple
> 'Syntax Error', but the line quoted is not the offending line. I
Not a question, just ranting.
My 2 commonest coding errors are forgetting the : before a block, and
mismatch between the number of ('s and )'s. The error message is a simple
'Syntax Error', but the line quoted is not the offending line. I would love
a much more explicit 'syntax error'.
Anyone her
On Wed, Jan 06, 2016 at 09:59:49AM +, Alan Gauld wrote:
> On 06/01/16 04:58, Alex Kleider wrote:
>
> > class JournalLineItem(object):
> > def __init__(self, account, debit_or_credit, amount):
> > self.account = account
> > self.debit_or_credit = debit_or_credit
> >
On Tue, Jan 05, 2016 at 08:58:42PM -0800, Alex Kleider wrote:
> class JournalLineItem(object):
> def __init__(self, account, debit_or_credit, amount):
> self.account = account
> self.debit_or_credit = debit_or_credit
> self.amount = float(amount)
> def show(self):
>
On 06/01/16 04:58, Alex Kleider wrote:
> class JournalLineItem(object):
> def __init__(self, account, debit_or_credit, amount):
> self.account = account
> self.debit_or_credit = debit_or_credit
> self.amount = float(amount)
>
...
> def get_line_item(text):
>
On 06/01/16 07:06, yehudak . wrote:
> eryk,
> Thank you.
> What's wrong with upgrading to newer version?
There's nothing wrong with it. It's just more work and for
minor releases often for very little gain. So unless you
know why you are upgrading you can probably spend your
time more productively
I'll look into it.
Yehuda
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
Thanks eryk.
I've downloaded and installed 3.5.1 64 bit, as Alan suggested.
So far no problem. I can anytime return to 3.5 if it will be needed.
Yehuda
On Wed, Jan 6, 2016 at 10:01 AM, eryk sun wrote:
> On Wed, Jan 6, 2016 at 1:06 AM, yehudak . wrote:
> > What's wrong with upgrading to newer v
eryk,
Thank you.
What's wrong with upgrading to newer version?
Yehuda
On Wed, Jan 6, 2016 at 8:32 AM, eryk sun wrote:
> On Tue, Jan 5, 2016 at 5:50 PM, Alan Gauld
> wrote:
> > On 05/01/16 19:47, yehudak . wrote:
> >> I'm using version 3.5 of Python and want to upgrade.
> >
> > 3.5 is the lates
Alex Kleider wrote:
> #!/usr/bin/env python3
> # OS: Ubuntu 10.4LTS
>
> # My code:
>
> class JournalLineItem(object):
> """
> """
>
> def __init__(self, account, debit_or_credit, amount):
> self.account = account
> self.debit_or_credit = debit_or_credit
>
On Wed, Jan 6, 2016 at 1:06 AM, yehudak . wrote:
> What's wrong with upgrading to newer version?
It depends on how many systems and virtual environments that you're
upgrading. It shouldn't be an issue if it's just a new micro release
for your own development machine. If you come across a regressi
29 matches
Mail list logo