Re: [Tutor] How (not!) lengthy should functions be?

2015-04-16 Thread Ben Finney
such a principle in mind, and knowing that it's worth spending effort to uphold, will serve you well. -- \ “Outside of a dog, a book is man's best friend. Inside of a | `\dog, it's too dark to read.” —Groucho Marx | _o__)

Re: [Tutor] lists, name semantics

2015-04-17 Thread Ben Finney
cts just aren't engineered for security.” —Brian | `\ Valentine, senior vice-president of Microsoft Windows | _o__)development, 2002 | Ben Finney ___ Tutor maillist - Tutor@python.org To un

Re: [Tutor] lists, name semantics

2015-04-17 Thread Ben Finney
Ben Finney writes: > Bill Allen writes: > > > If I have a list defined as my_list = ['a','b','c'], what is the is > > differnce between refering to it as my_list or my_list[:]? > > ‘my_list’ is a reference to the object you'

Re: [Tutor] sample dictionairies

2015-04-19 Thread Ben Finney
Kranzberg's First Law of Technology | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Life Grid Implementation

2015-04-20 Thread Ben Finney
ts, that is best discussed with your course supervisor, not us. -- \ “Kissing a smoker is like licking an ashtray.” —anonymous | `\ | _o__)

Re: [Tutor] sample dictionairies

2015-04-20 Thread Ben Finney
es for both.” —John Andrew | _o__) Holmes, _Wisdom in Small Doses_ | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] introspection

2015-04-20 Thread Ben Finney
2015 by Ned Batchelder https://www.youtube.com/watch?v=_AEJHKGk9ns>. -- \ “I must say that I find television very educational. The minute | `\ somebody turns it on, I go to the library and read a book.” | _o__)—Groucho Mar

Re: [Tutor] bin to dec conversion puzzlement

2015-04-20 Thread Ben Finney
nciple is that you must not fool yourself, and you are the | _o__) easiest person to fool.” —Richard P. Feynman, 1964 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Pun panic

2015-04-21 Thread Ben Finney
`\leave politics alone, but politics won't leave you alone.” | _o__) —Richard M. Stallman, 2002-07-26 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: ht

Re: [Tutor] introspection

2015-04-21 Thread Ben Finney
ject knows nothing about that relationship. -- \“I washed a sock. Then I put it in the dryer. When I took it | `\ out, it was gone.” —Steven Wright | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Pun panic

2015-04-22 Thread Ben Finney
Peter Otten <__pete...@web.de> writes: > Ben Finney wrote: > > > The Pythonic way to pronounce that would be “dunder Pete dunder” > > https://wiki.python.org/moin/DunderAlias>. > > Hm, should I campaign for a peter() builtin? You'll need a working implement

Re: [Tutor] Pun panic

2015-04-22 Thread Ben Finney
Albert-Jan Roskam writes: > - Original Message - > > From: Ben Finney > > You'll need a working implementation first. Put it on BullCodes > > https://bull.codes/> for bonus Python-based free-software > > repository hosting points! > > Is bull.co

Re: [Tutor] Pun panic

2015-04-22 Thread Ben Finney
Alex Kleider writes: > On 2015-04-22 05:40, Ben Finney wrote: > > http://mako.cc/writing/hill-free_tools.html> > > > > Kallithea (which is what powers BullCodes) is free software, meaning > > anyone is free to see how it works and change it and run their own

[Tutor] Please disable “digest mode” before participating (was: Tutor Digest, Vol 134, Issue 86)

2015-04-25 Thread Ben Finney
l-electric house. I forgot and left the | `\ porch light on all day. When I got home the front door wouldn't | _o__)open.” —Steven Wright | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscrib

Re: [Tutor] Please disable “digest mode” before participating

2015-04-26 Thread Ben Finney
Jim Mooney writes: > On 25 April 2015 at 18:03, Ben Finney wrote: > > > Digest mode should only ever be used if you know for certain you will > > never be responding to any message. > > That brings up a great shortcut if you use gmail. If you select some > text befo

[Tutor] Ancient Python versions (was: Is there a way to store and later use comparison operators (<, <=, =, >=, >) ?)

2015-04-29 Thread Ben Finney
rtrand Russell | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Ancient Python versions

2015-04-30 Thread Ben Finney
boB Stepp writes: > On Thu, Apr 30, 2015 at 12:15 AM, Ben Finney > wrote: > > If you actually need to read the documentation specifically for a > > Python version that has not been supported since 2008, then I agree > > that is a problem. > > I'm pretty much

Re: [Tutor] Having Unusual results

2015-05-02 Thread Ben Finney
plain text, and put the program text and output in the message. -- \ “Laugh and the world laughs with you; snore and you sleep | `\alone.” —anonymous | _o__)

Re: [Tutor] Creating an email option in Python

2015-05-02 Thread Ben Finney
and | `\action, where it often substitutes for both.” —John Andrew | _o__) Holmes, _Wisdom in Small Doses_ | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] python dictionaries (copy by reference or copy by value?)

2015-05-02 Thread Ben Finney
es, it only binds a reference to some value. -- \“If you continue running Windows, your system may become | `\unstable.” —Microsoft, Windows 95 bluescreen error message | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] Tip (thank) your mentors

2015-05-07 Thread Ben Finney
Thank you for keeping our community welcoming and happy. -- \ “Oh, I realize it's a penny here and a penny there, but look at | `\ me: I've worked myself up from nothing to a state of extreme | _o__) poverty.” —Groucho Ma

Re: [Tutor] Terminology question

2015-05-14 Thread Ben Finney
“It's all in the mind, you know.” —The Goon Show | `\ | _o__) | Ben Finney ___ Tutor maillist - Tutor@p

Re: [Tutor] Getting import to use a variable name

2015-05-19 Thread Ben Finney
p destroys the | `\ spirit of society and leads to its intellectual | _o__)impoverishment.” —Albert Einstein | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] python 3.4 documentation

2015-06-15 Thread Ben Finney
maintain and improve their docstrings :-) -- \ “It's my belief we developed language because of our deep inner | `\ need to complain.” —Jane Wagner, via Lily Tomlin | _o__) | Ben Finney

Re: [Tutor] __repr__ and __str__

2015-06-30 Thread Ben Finney
, and not complicate the connextions back and forth. > Thank you for any help. Hope that helps. Thank you for teaching Python 3 to more students! -- \ “DRM doesn't inconvenience [lawbreakers] — indeed, over time it | `\ trains law-abiding users to become [lawbreakers] out of

[Tutor] Inheritance, superclass, ‘super’ (was: __repr__ and __str__)

2015-06-30 Thread Ben Finney
\“I took it easy today. I just pretty much layed around in my | `\ underwear all day. … Got kicked out of quite a few places, | _o__) though.” —Bug-Eyed Earl, _Red Meat_ | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Inheritance, superclass, ‘super’

2015-07-02 Thread Ben Finney
Steven D'Aprano writes: > I mostly agree with what Ben says, comments below. > > On Wed, Jul 01, 2015 at 12:48:47PM +1000, Ben Finney wrote: > > So please use `super`, even in single inheritance. Otherwise you are > > restricting the usefulness of your class:

Re: [Tutor] Inheritance, superclass, ‘super’

2015-07-02 Thread Ben Finney
Alan Gauld writes: > On 01/07/15 03:48, Ben Finney wrote: > > Alan Gauld writes: > > > >> Whilst I agree with the general use of super I'm not sure what > >> the MRO resolution has to do with this case? > > > > When accessing the superclass, t

Re: [Tutor] _ vs. _name vs. __name vs. name_ vs. __name__ usages

2015-07-25 Thread Ben Finney
a newly-encoutered name really is. All the ones I've seen in third-party code would always be improved for clarity by choosing a normal ‘foo’ or ‘_foo’ name. > Are my understandings above correct or flawed? I hope that helps. -- \ “It's dangerous to be right when the governmen

Re: [Tutor] Pep 8, about indentation

2015-08-05 Thread Ben Finney
e Laurasian | `\ Separatist Movement!” —wiredog, http://kuro5hin.org/ | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail

Re: [Tutor] How to skip a single file when using shutil.make_archive()

2015-08-14 Thread Ben Finney
on is educational television. The question is: | `\ what is it teaching?” —Nicholas Johnson | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsu

Re: [Tutor] How to test my code's interactions with SQLite db?

2015-08-16 Thread Ben Finney
litical | `\ office he's ever held legally.” —George Carlin, 2008 | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] variable naming conventions

2015-08-16 Thread Ben Finney
Adams | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Is it possible to archive subsets of data from an SQLite db and restore it later?

2015-08-17 Thread Ben Finney
u're not | `\aiming high enough.” —Alan Kay | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Is it possible to archive subsets of data from an SQLite db and restore it later?

2015-08-18 Thread Ben Finney
that value with whatever point in time is of interest. -- \ “Faith is the determination to remain ignorant in the face of | `\ all evidence that you are ignorant.” —Shaun Mason | _o__) |

Re: [Tutor] OT: Searching Tutor Archives

2015-08-19 Thread Ben Finney
gustine of Hippo (354–430 CE) | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] indent error on if/elif/else

2015-09-10 Thread Ben Finney
\ “To have the choice between proprietary software packages, is | `\ being able to choose your master. Freedom means not having a | _o__)master.” —Richard M. Stallman, 2007-05-16 | Ben Finney ___ Tutor maillist -

Re: [Tutor] Python 3.5 Question

2015-10-09 Thread Ben Finney
and a half.” —Gracie Allen | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python 3.5 Question

2015-10-09 Thread Ben Finney
Ben Finney writes: > You may also be interested in the Python Tutor forum > https://mail.python.org/mailman/listinfo/tutor> which is specially > focussed on collaboratively teaching Python beginners. Whoops, my apology! I failed to notice we are already in that forum :-) -- \

Re: [Tutor] Python 3.5 Question

2015-10-09 Thread Ben Finney
Mark Lawrence writes: > On 09/10/2015 16:47, Ben Finney wrote: > > Whoops, my apology! I failed to notice we are already in that forum > > :-) > > I simply had to roar with laughter at the signature you used for the > above as it just seemed so apt, nothing personal :) &g

Re: [Tutor] how to unittest cli input

2015-10-10 Thread Ben Finney
r that function's class. All the produced test cases will run separately, identified by the test case method and the scenario name; and each one will fail or pass separately. This makes it very easy to test a matrix of assertions versus input/output expectations. The ‘unittest.mock’ library

Re: [Tutor] how to unittest cli input

2015-10-12 Thread Ben Finney
but how will we get three pink flamingos into one | _o__) pair of Capri pants?” —_Pinky and The Brain_ | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

tutor@python.org

2015-10-14 Thread Ben Finney
“Telling pious lies to trusting children is a form of abuse, | `\plain and simple.” —Daniel Dennett, 2010-01-12 | _o__) | Ben Finney ___ Tutor maillist - Tuto

Re: [Tutor] accessing modules found throughout a package?

2015-10-17 Thread Ben Finney
s you may have will be very welcomed. I hope that helps. -- \ “Faith is generally nothing more than the permission religious | `\ people give to one another to believe things strongly without | _o__) evidence.” —Sam Harris, _Letter to a

Re: [Tutor] accessing modules found throughout a package?

2015-10-18 Thread Ben Finney
irectory to allow the ‘sys.path’ modification to work as expected. -- \ “Alternative explanations are always welcome in science, if | `\ they are better and explain more. Alternative explanations that | _o__) explain nothing are not welcome.” —Victor J. S

Re: [Tutor] accessing modules found throughout a package?

2015-10-18 Thread Ben Finney
Ben Finney writes: > * Python will automatically add a ‘sys.path’ entry for the directory > containing the script named on the command line. So this: > > $ cd ~/Projects/lorem/ > $ python3 ./setup.py test > > will run the ‘setup.py’ program with ‘sys.path

[Tutor] Working collaboratively (was: accessing modules found throughout a package?)

2015-10-19 Thread Ben Finney
H. Lawrence | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Create complex dictionary

2015-10-22 Thread Ben Finney
themselves containers, so I suppose it counts as a “complex” dictionary. -- \ “I went to the museum where they had all the heads and arms | `\ from the statues that are in all the other museums.” —Steven | _o__) Wright | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] noob python question

2015-10-25 Thread Ben Finney
us amount of innovation | _o__) happening.” —Steve Jobs | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] super and __init__ methods

2015-11-27 Thread Ben Finney
ll Moyers | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] interface

2015-12-14 Thread Ben Finney
law on your side, pound the law. If you have neither | _o__) on your side, pound the table.” —anonymous | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] interface

2015-12-14 Thread Ben Finney
that it might | `\ be wrong.” —Chris Torek | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/ma

Re: [Tutor] interface

2015-12-18 Thread Ben Finney
of which shouldn't be changed only to fix this – which violates that idiom. -- \ “If we don't believe in freedom of expression for people we | `\ despise, we don't believe in it at all.” —Noam Chomsky, | _o__)

Re: [Tutor] File reading-(encoding problems)

2015-12-23 Thread Ben Finney
t of quite a few places, | _o__) though.” —Bug-Eyed Earl, _Red Meat_ | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Using python 3 on Ubuntu 14.04

2015-12-23 Thread Ben Finney
modules for the correct Python 3 version. -- \“It is undesirable to believe a proposition when there is no | `\ ground whatever for supposing it true.” —Bertrand Russell, _The | _o__) Value of Scepticism_, 1928

Re: [Tutor] Using python 3 on Ubuntu 14.04

2015-12-24 Thread Ben Finney
ps://docs.python.org/3/library/tkinter.ttk.html> http://www.tkdocs.com/> -- \ “I’ve been an atheist ever since I heard there was only a | `\ stairway to heaven.” —Stella Young, 1982–2014 | _o__)

Re: [Tutor] s.insert(i, x) explanation in docs for Python 3.4 confusing to me

2016-01-16 Thread Ben Finney
would fall into the domain of mental | _o__) disturbance.” —John F. Schumaker | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Source of MySQL Command Interpreter

2016-01-16 Thread Ben Finney
small, and put them in your message for discussion. -- \ “I call him Governor Bush because that's the only political | `\ office he's ever held legally.” —George Carlin, 2008 | _o__)

Re: [Tutor] Console application

2016-01-16 Thread Ben Finney
ple.” —Daniel Dennett, 2010-01-12 | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] s.insert(i, x) explanation in docs for Python 3.4 confusing to me

2016-01-17 Thread Ben Finney
others) to represent “please replace the text ‘nor’ in that line, with the text ‘not’ instead”. -- \ “Do I believe in God? … without clarification of a kind I have | `\never seen, I don’t know whether I believe or don’t believe in | _o__)whatever a questioner has

Re: [Tutor] Should a "data" directory have a __init__.py file?

2016-01-17 Thread Ben Finney
epest sin against the human mind is to believe things | `\ without evidence.” —Thomas Henry Huxley, _Evolution and | _o__) Ethics_, 1893 | Ben Finney ___ Tutor maillist - Tutor@pyt

Re: [Tutor] An Advice to a dedicated beginner

2016-01-18 Thread Ben Finney
\ landfill sites but fewer shopping centres.” —Clive Hamilton, | _o__)_Affluenza_, 2005 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why is the name "self" optional instead of mandatory?

2016-01-20 Thread Ben Finney
little kid we had a sand box. It was a quicksand | `\ box. I was an only child... eventually.” —Steven Wright | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Why do I not get an error when I mistakenly type "humdrum.sigh_strenght" instead of the correct "humdrum.sigh_strength"?

2016-01-20 Thread Ben Finney
tion of inputs that will trigger them at run time. For this and other reasons, it is highly recommended to develop unit tests with your code, to make explicit assertions about exactly what will trigger each branch of the code. This, in turn, will lead to making your code simpler and less-branch

Re: [Tutor] Why is an OrderedDict not sliceable?

2016-01-21 Thread Ben Finney
‘foo[key]’ for a mapping. -- \ “[I]t is impossible for anyone to begin to learn that which he | `\thinks he already knows.” —Epictetus, _Discourses_ | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Why is an OrderedDict not sliceable?

2016-01-21 Thread Ben Finney
y. So accessing an item in a mapping by key is not indexed access. -- \ “When we pray to God we must be seeking nothing — nothing.” | `\—Francis of Assisi | _o__) | Ben

Re: [Tutor] Why is an OrderedDict not sliceable?

2016-01-21 Thread Ben Finney
Ben Finney writes: > Oscar Benjamin writes: > > > According to a narrow definition of indexed access. I would say that > > d[k] is index access even if d is a dict and k a key. The sense of “index” implied is used consistently throughout Python https://docs.python.org/3/gloss

Re: [Tutor] How to call the path of an input file

2016-01-21 Thread Ben Finney
e Pascal (1623–1662), | _o__) Pensées, #894. | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How do I test file operations (Such as opening, reading, writing, etc.)?

2016-01-27 Thread Ben Finney
made in a very narrow field.” —Niels Bohr | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

[Tutor] [ANN] Gajja 0.1 (was: How do I test file operations (Such as opening, reading, writing, etc.)?)

2016-01-28 Thread Ben Finney
Ben Finney writes: > I have today published a different approach, which I designed for one > code base ad is to date its only user. I'm looking for more feedback. > > https://pypi.python.org/pypi/gajja/> I forgot to mention the appropriate channels for feedback: Plea

Re: [Tutor] How do I test file operations (Such as opening, reading, writing, etc.)?

2016-01-29 Thread Ben Finney
ieve in immortality of the individual, and I | `\consider ethics to be an exclusively human concern with no | _o__) superhuman authority behind it.” —Albert Einstein, letter, 1953 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How do I test file operations (Such as opening, reading, writing, etc.)?

2016-01-29 Thread Ben Finney
hey said my | `\ personality was weird. … That's okay, I have four more.” | _o__) —Bug-Eyed Earl, _Red Meat_ | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscriptio

Re: [Tutor] Why define a function inside a function?

2016-01-29 Thread Ben Finney
ogramming” which Python has good support for. This is how it's done. -- \“Like the creators of sitcoms or junk food or package tours, | `\ Java's designers were consciously designing a product for | _o__) people not as smart as them.” —Paul

Re: [Tutor] File extension change

2016-02-02 Thread Ben Finney
| _o__) of everyone.” —John Maynard Keynes | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] date range

2016-02-02 Thread Ben Finney
ou too? I thought I was the only one!’” —C.S. | _o__) Lewis | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] How to write tests for main() function that does not return anything

2016-02-03 Thread Ben Finney
\“The idea that He would take his attention away from the | `\ universe in order to give me a bicycle with three speeds is | _o__) just so unlikely that I can't go along with it.” —Quentin Crisp | Ben Finney ___ Tutor maillist -

Re: [Tutor] Enumerate vs DictReader object manipulation:

2016-02-03 Thread Ben Finney
s elevator | _o__)practice.” —Steven Wright | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Enumerate vs DictReader object manipulation:

2016-02-03 Thread Ben Finney
“The generation of random numbers is too important to be left | `\to chance.” —Robert R. Coveyou | _o__) | Ben Finney ___ Tutor maillist -

Re: [Tutor] Syntax for list comps

2016-02-03 Thread Ben Finney
unbearable.” —hotel, Bucharest | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] recursion

2016-02-05 Thread Ben Finney
1 >>> "Z"[:i] + "Z"[i+1:] 'Z' Can you explain why that would be the case? -- \ “I think a good gift for the President would be a chocolate | `\ revolver. And since he's so busy, you'd pr

Re: [Tutor] recursion

2016-02-05 Thread Ben Finney
the purpose. An opaque name like ‘n’ is not helpful. -- \ “Why doesn't Python warn that it's not 100% perfect? Are people | `\ just supposed to “know” this, magically?” —Mitya Sirenef, | _o__)

[Tutor] Mock filesystem operations only for specific test doubles (was: mock file reader object)

2016-02-11 Thread Ben Finney
o/testing-in-python>. -- \ “I never forget a face, but in your case I'll be glad to make | `\ an exception.” —Groucho Marx | _o__) | Ben Finney _

Re: [Tutor] library terminology and importing

2016-02-21 Thread Ben Finney
Namespaces are a honking good idea in Python, you should not seek to avoid them. -- \ “I may disagree with what you say, but I will defend to the | `\death your right to mis-attribute this quote to Voltaire.” | _o__) —A

Re: [Tutor] Recommendations for best tool to write/run Python

2016-03-02 Thread Ben Finney
learn. -- \ “Unix is an operating system, OS/2 is half an operating system, | `\Windows is a shell, and DOS is a boot partition virus.” —Peter | _o__)H. Coffin | Ben Finney ___ Tutor ma

Re: [Tutor] Recommendations for best tool to write/run Python

2016-03-02 Thread Ben Finney
ting system's facilities for managing files and processes. -- \“Humanity has advanced, when it has advanced, not because it | `\ has been sober, responsible, and cautious, but because it has | _o__)been playful,

Re: [Tutor] Recommendations for best tool to write/run Python

2016-03-02 Thread Ben Finney
Ben Finney writes: > Short of [the heavyweights Vim and Emacs], I'd still recommend a > community-owned, free-software, highly flexible programmer's editor. > If you're on GNU+Linux, use the Kate or GEdit editors; they integrate > very nicely with the default desktop

Re: [Tutor] Recommendations for best tool to write/run Python

2016-03-02 Thread Ben Finney
Ben Finney writes: > In that case, my recommendation is to learn a good programmer's > editor, and let your students gain exposure to that. > > Emacs and Vim are the unchallenged masters here […] > > They aren't a small investment, though. […] it may be too much t

Re: [Tutor] Recommendations for best tool to write/run Python :p:

2016-03-03 Thread Ben Finney
e very interested to see that. -- \ “Pinky, are you pondering what I'm pondering?” “I think so, | `\Brain, but don't you need a swimming pool to play Marco Polo?” | _o__) —_Pinky and The Bra

Re: [Tutor] Why does 01 give a syntax error, but 00 (or 00...0) does not?

2016-03-05 Thread Ben Finney
ion was made, and on the face of it I disagree. -- \“But it is permissible to make a judgment after you have | `\examined the evidence. In some circles it is even encouraged.” | _o__)—Carl Sagan, _The Burden of Skepticism_, 1987 | Ben Finney _

Re: [Tutor] Why does 01 give a syntax error, but 00 (or 00...0) does not?

2016-03-05 Thread Ben Finney
Ben Finney writes: > Hmm. That is a confusing inconsistency, I agree. It is deliberate, and > explicitly documented: > > Note that leading zeros in a non-zero decimal number are not > allowed. This is for disambiguation with C-style octal literals, > which Python u

Re: [Tutor] Surprised that print("a" "b") gives "ab"

2016-03-05 Thread Ben Finney
ution to mountains of waste is not more | `\ landfill sites but fewer shopping centres.” —Clive Hamilton, | _o__)_Affluenza_, 2005 | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Surprised that print("a" "b") gives "ab"

2016-03-05 Thread Ben Finney
Ben Finney writes: > The first one is defined (by the syntax for literals) to create a > *single* string object. Semantically, the fragments are specifying one > object in a single step. > > The second is semantically (i.e. by the semantics of how such > expressions are defined

Re: [Tutor] Surprised that print("a" "b") gives "ab"

2016-03-05 Thread Ben Finney
g; where would you put it?” —Steven | `\Wright | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] newbie in programming

2016-03-09 Thread Ben Finney
ve only joined recently; so they do not automatically benefit from past conversations here. -- \ “DRM doesn't inconvenience [lawbreakers] — indeed, over time it | `\ trains law-abiding users to become [lawbreakers] out of sheer | _o__)frustration.” —Charles Stros

Re: [Tutor] How to test function using random.randint()?

2016-03-18 Thread Ben Finney
known seed. Hopefully you can take this as an example of how to better design systems so they don't have tightly-entangled external dependencies. -- \ “The good thing about science is that it's true whether or not | `\ you believe in it.” —Neil deGrasse Tyson, 2011-02-04 | _o__)

Re: [Tutor] How to test function using random.randint()?

2016-03-20 Thread Ben Finney
boB Stepp writes: > On Sat, Mar 19, 2016 at 8:03 AM, Steven D'Aprano wrote: > > On Sat, Mar 19, 2016 at 04:05:58PM +1100, Ben Finney wrote: > >> if rng is None: > >> rng = random.random > > > > Typo: you want rng = random.

Re: [Tutor] How to test function using random.randint()?

2016-03-20 Thread Ben Finney
Steven D'Aprano writes: > On Mon, Mar 21, 2016 at 12:18:01AM +1100, Ben Finney wrote: > > No, I meant what I wrote. The ‘rng’ parameter is expected to be > > bound to a RNG. If the caller has not specified a custom RNG > > instance, we bind ‘rng’ to the stan

Re: [Tutor] How to test function using random.randint()?

2016-03-20 Thread Ben Finney
boB Stepp writes: > On Sun, Mar 20, 2016 at 8:19 PM, Ben Finney > wrote: > > if rng is None: > > rng = random._inst > > > > which is the default RNG instance in the module. > > Can I not use: > > if rng is None: > rng = random.Random

Re: [Tutor] How python keeps track of data types

2016-03-28 Thread Ben Finney
Kulawiec | _o__) | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Fw: About the Round Function

2016-04-01 Thread Ben Finney
them to sit down and shut up.” —Phyllis Diller | Ben Finney ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

  1   2   3   >