Re: Is duck-typing misnamed?

2016-08-29 Thread Ben Finney
cred-texts.com/neu/mphg/mphg.htm> -- \ “Most people are other people. Their thoughts are someone | `\ else’s opinions, their lives a mimicry, their passions a | _o__) quotation.” —Oscar Wilde, _De Profundis_, 1897 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: What's the best way to minimize the need of run time checks?

2016-08-29 Thread Ben Bacarisse
arnings would be a major code smell. > > "The low oil warning light in my car was always on, so I put some masking > tape over it so it wasn't bothering me any more." Yup. Gcc lets you put masking tape on (-Wno-int-conversion) but, in fairness, it also lets you treat all or selected warnings as hard errors (-Werror=int-conversion). Unfortunately there is no single option that treats all serious situations as hard errors, presumably because no two people agree on what should be considered serious for a particular architecture. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: *args and **kwargs

2016-09-02 Thread Ben Finney
ny positional arguments. Hence the SyntaxError. -- \ “I know that we can never get rid of religion …. But that | `\ doesn’t mean I shouldn’t hate the lie of faith consistently and | _o__) without apology.” —Paul Z. Myers, 2011-12-28 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't my finaliser run here?

2016-09-04 Thread Ben Finney
gion …. But that | `\ doesn’t mean I shouldn’t hate the lie of faith consistently and | _o__) without apology.” —Paul Z. Myers, 2011-12-28 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Why doesn't my finaliser run here?

2016-09-04 Thread Ben Finney
Steve D'Aprano writes: > On Sun, 4 Sep 2016 10:37 pm, Ben Finney wrote: > > > Short anser: because nothing has removed the reference to the > > instance. > > Hmmm. You're probably right, but not for the reason you think :-) Thanks to those who corrected some de

Re: Fwd: Fwd: Python freeze fails with warning: the use of `tempnam' is dangerous, better use `mkstemp'

2016-09-07 Thread Ben Finney
eak anything; then, change that usage as suggested. -- \“Consider the daffodil. And while you're doing that, I'll be | `\ over here, looking through your stuff.” —Jack Handey | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

What you can do about legalese nonsense on email (was: How to split value where is comma ?)

2016-09-08 Thread Ben Finney
too?” —Douglas Adams | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: What you can do about legalese nonsense on email

2016-09-08 Thread Ben Finney
Chris Angelico writes: > On Fri, Sep 9, 2016 at 7:17 AM, Joaquin Alzola > wrote: > > Hi Ben > > > > Thanks for the advice. You're welcome, I hope it leads to positive change. > > Basically what all comes down is to complain. I wonder if in a > >

Re: What you can do about legalese nonsense on email

2016-09-08 Thread Ben Finney
waiter said, ‘Don't I know you?’” —Steven Wright | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: How to extend a tuple of tuples?

2016-09-09 Thread Ben Finney
item for item in a ] + [(5, 6)]) -- \“Look at it this way: Think of how stupid the average person | `\ is, and then realise half of 'em are stupider than that.” | _o__) —George Carlin, _Doin' It Again_, 1990 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Expression can be simplified on list

2016-09-13 Thread Ben Finney
x27;m an idiot.’” —Steven Wright | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Expression can be simplified on list

2016-09-13 Thread Ben Finney
Lawrence D’Oliveiro writes: > On Wednesday, September 14, 2016 at 2:25:48 PM UTC+12, Ben Finney wrote: > > Lawrence D’Oliveiro writes: > > > > > It would be better if all such conversions were explicit > > > > Why? It's entirely unambiguous: the express

Re: Where is the documentation for ','?

2016-09-16 Thread Ben Finney
ned two I was really anxious, because I'd doubled my | `\ age in a year. I thought, if this keeps up, by the time I'm six | _o__) I'll be ninety.” —Steven Wright | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Official Python documentation lookup while programming (was: Is the content available in the html doc available in help()?)

2016-09-17 Thread Ben Finney
ike a dummy and people will try to | _o__)catch you because, hey, free dummy.” —Jack Handey | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: How to import all things defined the files in a module directory in __init__.py?

2016-09-21 Thread Ben Finney
the hold of | `\religion should be done and may in the end be our greatest | _o__) contribution to civilization.” —Steven Weinberg | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Pasting code into the cmdline interpreter

2016-09-21 Thread Ben Finney
estroys the | `\ spirit of society and leads to its intellectual | _o__) impoverishment.” —Albert Einstein | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Pasting code into the cmdline interpreter

2016-09-21 Thread Ben Finney
Veek M writes: > Ben Finney wrote: > > > Since you are writing code into a module file, why not just run the > > module from that file with the non-interactive Python interpreter? > > > It's part of a hexchat plugin/addon.. Which tells me that it still isn'

Re: How to import all things defined the files in a module directory in __init__.py?

2016-09-22 Thread Ben Finney
Peng Yu writes: > On Wed, Sep 21, 2016 at 11:14 PM, Ben Finney > wrote: > > [Importing ‘*’ from a module] will also make the names in the code > > impossible to automatically match against where they came from. > > Explicit is better than implicit; you are proposin

Automated refactoring tools (was: How to import all things defined the files in a module directory in __init__.py?)

2016-09-22 Thread Ben Finney
accident. I hit a bookmark and flew across the room.” —Steven | _o__) Wright | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: How to call this method from main method

2016-09-28 Thread Ben Finney
—Richard Buckminster Fuller, | `\ _Shelter_, 1932 | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: A regular expression question

2016-09-28 Thread Ben Finney
elps you understand why that expectation is wrong :-) Regular expression patterns are *not* an easy topic. Try experimenting and learning with http://www.regexr.com/>. -- \ “If I haven't seen as far as others, it is because giants were | `\

Re: ConfigParser: use newline in INI file

2016-10-01 Thread Ben Finney
>>> config_file = io.StringIO(config_text) >>> config = configparser.ConfigParser() >>> config.read_file(config_file) >>> print(config['foo']['wibble']) Lorem ipsum. -- \ “Only the shallow know themselves.” —Oscar Wilde, _Phrases and | `\ Philosophies for the Use of the Young_, 1894 | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Byte code descriptions somewhere?

2016-10-01 Thread Ben Finney
duty and blind faith the one | `\ unpardonable sin.” —Thomas Henry Huxley, _Essays on | _o__) Controversial Questions_, 1889 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Assignment versus binding

2016-10-04 Thread Ben Bacarisse
ent semantics. Haskell defines let (it's version of multiple mutually recursive bindings) in terms of the least fix point of a lambda function whose (pattern) parameter binds the expressions in the definitions. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Assignment versus binding

2016-10-04 Thread Ben Bacarisse
Steve D'Aprano writes: > On Tue, 4 Oct 2016 11:27 pm, Ben Bacarisse wrote: > >> Haskell defines let (it's version of multiple mutually recursive >> bindings) in terms of the least fix point of a lambda function whose >> (pattern) parameter binds the expression

Re: Assignment versus binding

2016-10-05 Thread Ben Bacarisse
urrent spam io = do x <- io; print x; print (x+1) main = spam (do threadDelay (2*10^6); return 1) It matches the Python in that the delay happens once. To get the behaviour being hinted at (two delays) you need to re-bind the IO action: spam io = do x <- io;

Re: Assignment versus binding

2016-10-05 Thread Ben Bacarisse
BartC writes: > On 05/10/2016 11:03, Ben Bacarisse wrote: >> Gregory Ewing writes: >> >>> Steve D'Aprano wrote: >>> >>>> And (shamelessly using Python syntax) if I have a function: >>>> >>>> def spam(x): >>>>

Code complexity analysis of Python code (was: Quick way to calculate lines of code/comments in a collection of Python scripts?)

2016-10-05 Thread Ben Finney
ing. Either is better than actually WORKING for a | _o__) living.” —ringsnake.livejournal.com, 2007-11-12 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: I am comfused about the name behavior of Python in recursion

2016-10-05 Thread Ben Finney
of trying not to fool yourself. The first | `\ principle is that you must not fool yourself, and you are the | _o__) easiest person to fool.” —Richard P. Feynman, 1964 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Function to take the minimum of 3 numbers

2016-10-09 Thread Ben Bacarisse
> min3 = b > if c < min3: > min3 = c > if b < c: > min3 = b > return min3 The last if is not needed. Forced to pretend that there is no min function already, I'd be tempted to write def min3(a, b, c):

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-09 Thread Ben Finney
ould *choose descriptive names* and use them consistently, to help the reader understand the code. -- \“Telling pious lies to trusting children is a form of abuse, | `\plain and simple.” —Daniel Dennett, 2010-01-12 | _o__)

Re: Deviding N(1, 2, 3, .., N) part from numeric list as summation of each values(don't sorted) has highest possible.

2016-10-10 Thread Ben Bacarisse
? I imagine you want the most equal partition -- the one that minimises the variance in the set of sums. > and then If I want to divide N(1,2,3,...,N) part from any numeric > list??? I don't understand this last bit at all. The repeated use of N is not helping me. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Python code is compiled before execution (was: How to process syntax errors)

2016-10-11 Thread Ben Finney
ome CPU code; that is a foolishly narrow definition. (Good sigmonster, have a cookie.) -- \ “[I]t is impossible for anyone to begin to learn that which he | `\thinks he already knows.” —Epictetus, _Discourses_ | _o__)

Re: repr/str diff between Python 2 and 3

2016-10-11 Thread Ben Finney
his particular > one. Only that one should not rely on ‘str’ preserving the value accurately, as documented in Python 2. -- \ “[Entrenched media corporations will] maintain the status quo, | `\ or die trying. Either is better than actually WORKING for a | _o__)

Re: repr/str diff between Python 2 and 3

2016-10-11 Thread Ben Finney
I believe or don’t believe in | _o__)whatever a questioner has in mind.” —Noam Chomsky | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: try-except with no exceptions

2016-10-13 Thread Ben Finney
andas K. Gandhi | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Without compilation, how to find bugs?

2016-10-13 Thread Ben Finney
-- \ “A poet can survive everything but a misprint.” —Oscar Wilde, | `\ _The Children of the Poets_, 1886-10-14 | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: How to sort this without 'cmp=' in python 3?

2016-10-14 Thread Ben Finney
, and returns a custom object, which knows how to compare itself as specified by your comparison function. >>> key_func = functools.cmp_to_key(lambda a, b: cmp(a+b, b+a)) >>> key_func("32") >>> key_func("32") < key_func("5") True See the Sorting HOWTO https://docs.python.org/3/howto/sorting.html> for this and other tricks. -- \ “I used to be an airline pilot. I got fired because I kept | `\ locking the keys in the plane. They caught me on an 80 foot | _o__)stepladder with a coathanger.” —Steven Wright | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Tkinter with native look-and-feel (was: [FAQ] "Best" GUI toolkit for python)

2016-10-17 Thread Ben Finney
`\ profit without individual responsibility.” —Ambrose Bierce, | _o__) _The Devil's Dictionary_, 1906 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Generator comprehension - list None

2016-10-18 Thread Ben Finney
) print(repr(c)) Does that help? -- \“I knew it was a shocking thing to say, but … no-one has the | `\right to spend their life without being offended.” —Philip | _o__) Pullman, 2010-03-28 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Inplace shuffle function returns none

2016-10-19 Thread Ben Finney
st never be answered: if it is, it ceases to be | `\ prayer and becomes correspondence.” —Oscar Wilde, _The Epigrams | _o__) of Oscar Wilde_, 1952 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: HTML templating tools

2016-10-20 Thread Ben Finney
ategorisation by Python 3 support. -- \ “Prayer must never be answered: if it is, it ceases to be | `\ prayer and becomes correspondence.” —Oscar Wilde, _The Epigrams | _o__) of Oscar Wilde_, 1952 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Internet Data Handling » mailbox

2016-10-21 Thread Ben Finney
ce them, | `\ unless we are trapped into it by comedy. To label any subject | _o__)unsuitable for comedy is to admit defeat.” —Peter Sellers | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: ImportError: No module named 'simstring'

2016-10-26 Thread Ben Finney
“Pinky, are you pondering what I'm pondering?” “I think so, | `\ Brain, but can the Gummi Worms really live in peace with the | _o__) Marshmallow Chicks?” —_Pinky and The Brain_ | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

[RELEASE] ‘python-daemon’ version 2.1.2 released

2016-10-26 Thread Ben Finney
o__) | Ben Finney signature.asc Description: PGP signature -- https://mail.python.org/mailman/listinfo/python-list

Re: pip3 : command not found

2016-10-30 Thread Ben Finney
know that ain't so.” —Artemus Ward | _o__) (1834–1867), U.S. journalist | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: pip3 : command not found

2016-10-30 Thread Ben Finney
Vishal Subbiah writes: > Hi, (Please don't top-post in responses. Instead, post your responses interleaved with only the quoted material you are responding to https://en.wikipedia.org/wiki/Posting_style#Interleaved_style>.) > Thanks Ben for the response. I followed your suggesti

Call a shell command from Python (was: Calling Bash Command From Python)

2016-10-30 Thread Ben Finney
7;s not what happens. Instead, the ‘subprocess.Popen.communicate’ method will invoke the program directly, without involving a shell. See the documentation for ‘subprocess.Popen’. -- \“If you continue running Windows, your system may become | `\unstable.” —Microsoft, Windo

Re: Call a shell command from Python

2016-10-31 Thread Ben Finney
Wildman via Python-list writes: > On Mon, 31 Oct 2016 15:44:13 +1100, Ben Finney wrote: > > > One immediate difference I see is that you specify different > > arguments to ‘grep’. You have a different pattern for each command. > > > > * The ‘^user\:’ pattern matc

Re: Call a shell command from Python

2016-10-31 Thread Ben Finney
ormation | `\ technology as a McDonalds Certified Food Specialist is to the | _o__) culinary arts.” —Michael Bacarella | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Ben Bacarisse
SAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; > NSLog (@"Hello, World!"); > [pool drain]; > return 0; > } > > --- cut --- > > Which would you rather write? That's a rather odd comparison. Why not #import int mai

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Ben Bacarisse
"Mr. Wrobel" writes: > ... However the most important is second part of my question. > > What do you think about using GPU processing or pypy? Sorry, I don't have enough experience of them to offer any useful advice. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: pip3 : command not found

2016-11-05 Thread Ben Finney
Steve D'Aprano writes: > Oh, and ironically, you'll see that Ben anticipated and answered your > question about activate. Here's the link again, to save you scrolling up: > > https://mail.python.org/pipermail/python-list/2016-October/715994.html > > where he sa

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Ben Bacarisse
Steve D'Aprano writes: > On Sun, 6 Nov 2016 08:17 am, Ben Bacarisse wrote: > >> Steve D'Aprano writes: > >>> Here's the same program in Objective C: >>> >>> --- cut --- >>> >>> #import >>> &g

Re: pip3 : command not found

2016-11-05 Thread Ben Finney
nce.” —Oscar Wilde, _The Epigrams | _o__) of Oscar Wilde_, 1952 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: pip3 : command not found

2016-11-05 Thread Ben Finney
the same thing out twice.” | _o__) —Henry L. Mencken | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Promoting your own library

2016-11-11 Thread Ben Finney
y people can't | _o__) tell the difference.” —Paul Z. Myers, 2010-04-18 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: how to print variable few time?

2016-11-12 Thread Ben Bacarisse
in(['a', 'b', 'c'])? Can you find a way now? -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

How to distribute your Python software (was: Promoting your own library)

2016-11-12 Thread Ben Finney
sarily true because a man dies for it.” | `\—Oscar Wilde, _The Portrait of Mr. W. H._, 1889-07 | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Best way to go about embedding python

2016-11-13 Thread Ben Finney
r you.” —Prince, 2010-07-05 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Farewell to Rob Collins

2016-11-16 Thread Ben Finney
cLaughlin | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Farewell to Rob Collins

2016-11-16 Thread Ben Finney
Ben Finney writes: > Robert and I had many conversations […]. My apologies for the confusion! This is not the same person. I did not know the Rob Collins described in the obituary http://www.europython-society.org/post/153253946400/farewell-to-rob-collins> so my comments were mis

Re: What exactly is a python variable?

2016-11-17 Thread Ben Finney
Bill Moyers | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Clean way to return error codes

2016-11-21 Thread Ben Finney
t;cleanup failed: {message}", 8), } -- \ “God forbid that any book should be banned. The practice is as | `\ indefensible as infanticide.” —Dame Rebecca West | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Ben Bacarisse
you like happen to be exactly those in cmd.exe. You are very lucky that cmd.exe happened to get exactly the right interpretation of the input or you would be raining against /every/ shell on both systems. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread Ben Bacarisse
BartC writes: > On 07/12/2016 15:25, Ben Bacarisse wrote: >> BartC writes: >> >>> [...] But remember: >>> >>> cp *.c >>> >>> There might be some irate users out there if it can't detect a simple >>> user error like tha

Re: Is there a replement for bsddb in python3?

2016-12-09 Thread Ben Finney
ird party interface to the Oracle Berkeley DB. -- \ “Give a man a fish, and you'll feed him for a day; give him a | `\religion, and he'll starve to death while praying for a fish.” | _o__) —Anonymous | Be

Re: The right way to 'call' a class attribute inside the same class

2016-12-12 Thread Ben Finney
\ “DRM doesn't inconvenience [lawbreakers] — indeed, over time it | `\ trains law-abiding users to become [lawbreakers] out of sheer | _o__)frustration.” —Charles Stross, 2010-05-09 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Python constructors have particular semantics, and ‘Foo.__init__’ doesn't qualify (was: The right way to 'call' a class attribute inside the same class)

2016-12-12 Thread Ben Finney
Chris Angelico writes: > On Tue, Dec 13, 2016 at 10:17 AM, Ben Finney > wrote: > > If the differences didn't matter I would agree that “overly > > pedantic” is fair. But those differences trip up newcomers. Thinking > > of ‘Foo.__init__’ leads people to wond

Re: Running python from pty without prompt

2016-12-13 Thread Ben Finney
can no longer | _o__) figure out how to use my telephone.” —Bjarne Stroustrup | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: To improve a script

2016-12-17 Thread Ben Finney
is if they ever press charges.” —Jack Handey | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: python list index - an easy question

2016-12-18 Thread Ben Bacarisse
> some can have any lower bound. > > But a strong argument for using 1 is that in real life things are > usually counted from 1 (and measured from 0). The index of an element is a measure, not a count. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: python list index - an easy question

2016-12-19 Thread Ben Bacarisse
BartC writes: > On 19/12/2016 01:10, Ben Bacarisse wrote: >> BartC writes: >> >>> On 18/12/2016 10:59, Paul Götze wrote: >>>> there is a nice short article by E. W. Dijkstra about why it makes sense >>>> to start numbering at zero (and exclude

Re: python list index - an easy question

2016-12-19 Thread Ben Bacarisse
Jussi Piitulainen writes: > Ben Bacarisse writes: > >> BartC writes: >> >>> You need to take your C hat off, I think. >> >> It's a computing hat. Indexes are best seen as offsets (i.e. as a >> measured distances from some origin or base). It&#x

Re: Metaclasses - magic functions

2016-12-20 Thread Ben Finney
their own skin.” —furrier, | `\Sweden | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Another security question

2016-12-23 Thread Ben Bacarisse
#x27;s too efficient and therefore open to brute-force attacks. The hashing schemes that use BLAKE2 are deliberately designed to be costly. > I propose to ignore this warning. I feel that, for my purposes, the > above procedure is adequate. > > Does all this sound reasonable? That depends on the purposes, of course, so it's hard to offer advice. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Temporary variables in list comprehensions

2017-01-09 Thread Ben Bacarisse
ista). However I would use a lambda as the natural way to create a local binding: [(lambda tmp: (tmp, tmp+1))(expensive_calculation(x)) for x in data] -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: How coding in Python is bad for you

2017-01-24 Thread Ben Bacarisse
s many cases where the > indentation's fine and the bracket nesting isn't. Can I ask what editor(s) your students have available? I ask because I've not given a moment's thought to indentation or what bracket matches what for decades due to having a helpful editor. -- Ben.

Re: How coding in Python is bad for you

2017-01-24 Thread Ben Bacarisse
Chris Angelico writes: > On Wed, Jan 25, 2017 at 2:51 AM, Ben Bacarisse wrote: >> Chris Angelico writes: >> >>> ... I teach JavaScript as well as Python, and I've seen some >>> pretty horrendous indentation flaws (examples available if people ask &g

Re: How coding in Python is bad for you

2017-01-24 Thread Ben Bacarisse
Steve D'Aprano writes: > On Wed, 25 Jan 2017 03:21 am, Ben Bacarisse wrote: > >> Chris Angelico writes: >> >>> On Wed, Jan 25, 2017 at 2:51 AM, Ben Bacarisse >>> wrote: > [...] >>>> Can I ask what editor(s) your students have available?

Re: How coding in Python is bad for you

2017-01-24 Thread Ben Bacarisse
BartC writes: > On 24/01/2017 15:51, Ben Bacarisse wrote: >> Chris Angelico writes: >> >>> ... I teach JavaScript as well as Python, and I've seen some >>> pretty horrendous indentation flaws (examples available if people ask >>> privately, bu

Re: How coding in Python is bad for you

2017-01-24 Thread Ben Bacarisse
Chris Angelico writes: > On Wed, Jan 25, 2017 at 3:21 AM, Ben Bacarisse wrote: >> Chris Angelico writes: >> >>> On Wed, Jan 25, 2017 at 2:51 AM, Ben Bacarisse wrote: >>>> Chris Angelico writes: >>>> >>>>> ... I teach JavaScrip

Re: How an editor can help with block nesting (was Re: How coding in Python is bad for you)

2017-01-25 Thread Ben Iannitelli
On Wed, Jan 25, 2017 at 6:31 AM, Ben Bacarisse <mailto:ben.use...@bsb.me.uk> wrote: In Python the editor could, for example, highlight the block you are typing in, so as soon as you leave the body of the 'if' it would stop being marked and the containing code would be highlight

Re: Overriding True and False ?

2017-01-29 Thread Ben Finney
ity" software, | `\ because it makes them secure from their customers.” —Cory | _o__) Doctorow, 2014-02-05 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Rename file without overwriting existing files

2017-01-30 Thread Ben Finney
ot true for all filesystems, even on Linux. -- \ “[Entrenched media corporations will] maintain the status quo, | `\ or die trying. Either is better than actually WORKING for a | _o__) living.” —ringsnake.livejournal.com, 2007-11-12 | Ben Finney -- https://mail.pyt

Re: Overriding True and False ?

2017-01-30 Thread Ben Finney
he right time, and the rest do not | `\ happen at all. The conscientious historian will correct these | _o__) defects.” —Mark Twain, _A Horse's Tale_ | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: command line micro wiki written in Python

2017-01-31 Thread Ben Finney
also incoherent.” —Victor J. Stenger, 2001 | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Ben Finney
much you can coerce others to do what you | _o__) want.” —Larry Wall | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: best way to ensure './' is at beginning of sys.path?

2017-02-03 Thread Ben Finney
Steve D'Aprano writes: > On Sat, 4 Feb 2017 10:13 am, Ben Finney wrote: > > See https://www.python.org/dev/peps/pep-0328/>, in particular > > https://www.python.org/dev/peps/pep-0328/#guido-s-decision>. > > I think you are conflating the package directory and .

Re: Which part of the loop is it going through in this class frame?

2018-03-07 Thread Ben Finney
prints it out. -- \ “As the most participatory form of mass speech yet developed, | `\the Internet deserves the highest protection from governmental | _o__) intrusion.” —U.S. District Court Judge Dalzell | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Spot the invalid syntax

2018-03-08 Thread Ben Finney
ryone. Nothing worth | `\saying will fail to make you enemies. And nothing worth saying | _o__) will not produce a confrontation.” —Johann Hari, 2011 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Spot the invalid syntax

2018-03-08 Thread Ben Finney
pair of eyes looking for mistakes while you type. -- \ “Giving every man a vote has no more made men wise and free | `\ than Christianity has made them good.” —Henry L. Mencken | _o__) | Ben Finney -- https://ma

Re: Spot the invalid syntax

2018-03-08 Thread Ben Finney
Chris Angelico writes: > On Fri, Mar 9, 2018 at 10:33 AM, Ben Finney > wrote: > > In many cases, those eyes can be virtual and non-human. > > > > That's what syntax highlighting, and tools even more impressive > > (e.g. linting tools that run continually

Relationship between ‘object’ and the name of an object (was: Which part of the loop is it going through in this class frame?)

2018-03-08 Thread Ben Finney
o real limp, | `\ because maybe you'll look like a dummy and people will try to | _o__)catch you because, hey, free dummy.” —Jack Handey | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: I found strange thing while studying through idle

2018-03-08 Thread Ben Finney
ee exactly what you're seeing. -- \ “Better not take a dog on the space shuttle, because if he | `\ sticks his head out when you're coming home his face might burn | _o__)up.” —Jack Handey | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: I found strange thing while studying through idle

2018-03-08 Thread Ben Finney
what they meant. -- \ “The Vatican is not a state.… a state must have people. There | `\are no Vaticanians.… No-one gets born in the Vatican except by | _o__)an unfortunate accident.” —Geoffrey Robertson, 2010-09-18 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Enumerating all 3-tuples

2018-03-09 Thread Ben Bacarisse
lt;-> 1 2,1 <-> 2 1,2 <-> 3 3,1 <-> 4 2,2 <-> 5 1,3 <-> 6 ... but replace the first element by the numbered pair from this same list: (1,1),1 (2,1),1 (1,1),2 (1,2),1 (2,1),2 (1,1),3 ... If it were a sane time here I'd try to code this. Looks like fun but it must wait... -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Enumerating all 3-tuples

2018-03-10 Thread Ben Bacarisse
Ben Bacarisse writes: > Steven D'Aprano writes: > >> I am trying to enumerate all the three-tuples (x, y, z) where each of x, >> y, z can range from 1 to ∞ (infinity). > ... But I think that is an easier way (no code yet though!) unless > you are set on one par

Re: Enumerating all 3-tuples

2018-03-10 Thread Ben Bacarisse
Sorry for following up to myself again... Ben Bacarisse writes: >> ... But I think that is an easier way (no code yet though!) unless >> you are set on one particular enumeration: consider the triple as a pair >> one element of which runs over the enumeration of pairs y

Re: Enumerating all 3-tuples

2018-03-10 Thread Ben Bacarisse
bartc writes: > [repost as original seems to have gone to email; my newsreader has > somehow acquired a 'Reply' button where 'Followup' normally goes.] [I thought it was intended but my reply bounced.] > On 10/03/2018 14:23, Ben Bacarisse wrote: >> Ben B

<    3   4   5   6   7   8   9   10   11   12   >