Re: [Tutor] Difference(s) betweenPython 3 static methods with and without @staticmethod?

2017-08-06 Thread eryk sun
On Sun, Aug 6, 2017 at 11:35 PM, boB Stepp wrote: > > I see no difference in result, whether I use the @staticmethod decorator or > not. While a staticmethod and a function are both descriptors [1], a staticmethod is basically a no-op descriptor. Its __get__ method always returns its unbound cal

Re: [Tutor] Difference(s) betweenPython 3 static methods with and without @staticmethod?

2017-08-06 Thread Alan Gauld via Tutor
On 07/08/17 00:35, boB Stepp wrote: > = > Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 > bit (AMD64)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > p

Re: [Tutor] Tutor Digest, Vol 162, Issue 19

2017-08-06 Thread Howard Lawrence
On Aug 6, 2017 11:00 AM, wrote: Send Tutor mailing list submissions to tutor@python.org To subscribe or unsubscribe via the World Wide Web, visit https://mail.python.org/mailman/listinfo/tutor or, via email, send a message with subject or body 'help' to tutor-requ...@pyth

[Tutor] Difference(s) betweenPython 3 static methods with and without @staticmethod?

2017-08-06 Thread boB Stepp
I am looking more deeply into the subject of decorators for a bit (So I can thoroughly digest Steve's information in the thread "basic decorator question".) and have been first looking at static and class methods. As a start, I have tried the following: ===

Re: [Tutor] unorderable types

2017-08-06 Thread boB Stepp
Curses! I screwed up my later insertion. I should have written in my footnote: On Sun, Aug 6, 2017 at 3:20 PM, boB Stepp wrote: > [1] An exception is "Beginning Python -- From Novice to Professional, > 3rd ed." by Magnus Lie Hetland, c. 2017. I recently acquired this > book and so far I am e

Re: [Tutor] unorderable types

2017-08-06 Thread boB Stepp
On Sun, Aug 6, 2017 at 1:23 PM, Mats Wichmann wrote: > Meanwhile, it is worth pointing out that while: (as with other python > loops) can take an else: clause, which is executed if the loop runs to > completion and was not exited via break. That means you could ALSO > write (this is pseudo-code

Re: [Tutor] unorderable types

2017-08-06 Thread Mats Wichmann
On 08/06/2017 11:35 AM, boB Stepp wrote: > So these final two "if" groupings should be _outside_ your while loop: > > while guessesTaken < 6: > > > if guess_value == number: > print('good job, ' + myName + '! you guessed my number in', > guessesTaken, 'guesses!') > > else: > print(

Re: [Tutor] unorderable types

2017-08-06 Thread boB Stepp
On Sat, Aug 5, 2017 at 1:28 PM, Howard Lawrence <1019sh...@gmail.com> wrote: > # this is a guess number game. > import random > > guessesTaken = 0 > > print('hello! What is your name?') > myName = input() > > number = random.randint(1, 20) > print('Well, ' + myName + ', i am thinking of a number be

Re: [Tutor] unorderable types

2017-08-06 Thread Cameron Simpson
On 06Aug2017 07:19, Alan Gauld wrote: On 05/08/17 19:28, Howard Lawrence wrote: if guess_value != number: number = str(number) print ('nope. the number i was thinking of was ' + number) There is the problem, you convert number to a str before printing it. so next iteration