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
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
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
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
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
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
too?” —Douglas Adams |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
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
> >
waiter said, ‘Don't I know you?’” —Steven Wright |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
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
x27;m an idiot.’” —Steven Wright |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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
estroys the |
`\ spirit of society and leads to its intellectual |
_o__) impoverishment.” —Albert Einstein |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
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'
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
accident. I hit a bookmark and flew across the room.” —Steven |
_o__) Wright |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
—Richard Buckminster Fuller, |
`\ _Shelter_, 1932 |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
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 |
`\
>>> 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
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
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
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
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;
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):
>>>>
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
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
> 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):
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__)
? 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
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__)
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__)
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
andas K. Gandhi |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
--
\ “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
, 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
`\ profit without individual responsibility.” —Ambrose Bierce, |
_o__) _The Devil's Dictionary_, 1906 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
)
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
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
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
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
“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
o__) |
Ben Finney
signature.asc
Description: PGP signature
--
https://mail.python.org/mailman/listinfo/python-list
know that ain't so.” —Artemus Ward |
_o__) (1834–1867), U.S. journalist |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
"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
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
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
nce.” —Oscar Wilde, _The Epigrams |
_o__) of Oscar Wilde_, 1952 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
the same thing out twice.” |
_o__) —Henry L. Mencken |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
y people can't |
_o__) tell the difference.” —Paul Z. Myers, 2010-04-18 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
in(['a', 'b', 'c'])?
Can you find a way now?
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
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
r you.” —Prince, 2010-07-05 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
cLaughlin |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
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
Bill Moyers |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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
\ “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
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
can no longer |
_o__) figure out how to use my telephone.” —Bjarne Stroustrup |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
is if they ever press charges.” —Jack Handey |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
> 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
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
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
their own skin.” —furrier, |
`\Sweden |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
#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
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
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.
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
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?
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
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
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
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
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
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
also incoherent.” —Victor J. Stenger, 2001 |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
much you can coerce others to do what you |
_o__) want.” —Larry Wall |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
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 .
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
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
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
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
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
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
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
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
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
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
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
701 - 800 of 5100 matches
Mail list logo