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
g the positive change
effected.
--
\ “You don't need a book of any description to help you have some |
`\kind of moral awareness.” —Dr. Francesca Stavrakoloulou, bible |
_o__) scholar, 2011-05-08 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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__)
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
have a ‘pip’ module. That's a problem, but should be easily solved
https://docs.python.org/3/library/ensurepip.html>.
--
\ “Creativity can be a social contribution, but only in so far as |
`\ society is free to use the results.” —Richard M. Stallman |
_o__)
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
a theist, and you can be a skeptic. But if you're |
`\ both, you're not very good at one of them.” —Dave Silverman, |
_o__) 2011-11-19 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
their own skin.” —furrier, |
`\Sweden |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
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
!
--
\ “I have yet to see any problem, however complicated, which, |
`\ when you looked at it in the right way, did not become still |
_o__)more complicated.” —Paul Anderson |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ought the way you're thinking, but got
> stuck at that question and had to back-track my reasoning :-)
I was not hindered by the burden to make my explanation work for
everything, just for the one example presented. This allowed me to
quickly get back to feeding my goldfish.
--
\
e, what if we chose the wrong religion? Each week we |
`\ just make God madder and madder.” —Homer, _The Simpsons_ |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Ben Finney writes:
> Steven D'Aprano writes:
>
> > (1) […] If there is a NAN in your data, the result of calling
> > median() is implementation-defined.
>
> This is the least Pythonic; there is no good reason IMO for specifying a
> behaviour in the implementati
his::
expected = {"foo", "bar", "spam"}
missing = expected - set(json.keys())
--
\ “The greater the artist, the greater the doubt; perfect |
`\ confidence is granted to the less talented as a consolation |
_o__)
iasm." -- Winston Churchill |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
g
attribute values, not calling a bunch of other methods.
--
\“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 |
Ben Finney
w this?
--
\ “Experience is that marvelous thing that enables you to |
`\ recognize a mistake when you make it again.” —Franklin P. Jones |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ilar system
http://collection.spencerart.ku.edu/eMuseumPlus?module=collection&objectId=42380>.
--
\ “I'm not a bad guy! I work hard, and I love my kids. So why |
`\ should I spend half my Sunday hearing about how I'm going to |
_o__)
we come up with new versions is not to fix bugs. |
`\ It's absolutely not.” —Bill Gates, 1995-10-23 |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
y-five percent better than you expect them |
`\ to do unto you. (The twenty-five percent is [to correct] for |
_o__)error.)” —Linus Pauling's Golden Rule |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
having ‘answers’ on a math test, they should just |
`\ call them ‘impressions’, and if you got a different |
_o__) ‘impression’, so what, can't we all be brothers?” —Jack Handey |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
orian, 1914–2004 |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
to elaborate on what the
question is?
--
\ “Natural catastrophes are rare, but they come often enough. We |
`\ need not force the hand of nature.” —Carl Sagan, _Cosmos_, 1980 |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
w-men is dishonest and infamous.” —Robert G. |
_o__) Ingersoll, _The Liberty of Man, Woman and Child_, 1877 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
slade: “What were you doing there?” |
_o__) Eccles: “Buying a tie.” —The Goon Show, _The Greenslade Story_ |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
org/3/reference/import.html>.
--
\ “If we could change ourselves, the tendencies in the world |
`\ would also change.” —Mohandas K. Gandhi, _Collected Works_, 1913 |
_o__) |
Ben Finney
--
https://mail.python.or
as no need of another thread attempting to “win” an argument
that one side believes is dishonest.
--
\ “The best in us does not require the worst in us: Our love of |
`\ other human beings does not need to be nurtured by delusion.” |
_o__) —Sam Harr
war, a world without |
`\ hate. And I can picture us attacking that world, because they'd |
_o__) never expect it.” —Jack Handey |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
name–object binding (the “variable”). The type is
a property of the object.
--
\ “It is the fundamental duty of the citizen to resist and to |
`\ restrain the violence of the state.” —Noam Chomsky, 1971 |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
?
To the extent I understand that question, the answer is no.
Rather, the ‘bytes’ and ‘str’ types are now entirely incompatible, and
implicit conversions are never done between them. Any conversions
between them must be explicit.
--
\ “There are always those who think they know what is your |
`\ responsibility better than you do.” —Ralph Waldo Emerson |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
the “a value is an
object” false equivalence needs un-learning, I can't let it pass.
--
\“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
--
https://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano writes:
> On Wed, 16 May 2018 11:30:26 +1000, Ben Finney wrote:
>
> > An object is not a value; an object *has* a value. The object
> > retains its identity even when its value changes.
>
> Here you have hit on the crux of the matter. Why cannot bo
unting fear that someone, somewhere, may be |
`\ happy.” —Henry L. Mencken |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Vonnegut |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
l answer, other than to stop thinking that's a
race that you can win.
--
\ “DRM doesn't inconvenience [lawbreakers] — indeed, over time it |
`\ trains law-abiding users to become [lawbreakers] out of sheer |
_o__)frustration.” —Charles Stross, 2010-
ugh. So
this is another way to get that result:
foo = [ [] for __ in range(5) ]
--
\ “We now have access to so much information that we can find |
`\ support for any prejudice or opinion.” —David Suzuki, 2008-06-27 |
_o__)
cise enough to write tests for,
and therefore to write in code.
--
\ “I have always wished for my computer to be as easy to use as |
`\ my telephone; my wish has come true because I can no longer |
_o__) figure out how to use my telephone.” —Bjarne Stroustrup |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Mike McClain writes:
> Steven D'Aprano and Ben Finney used these '_' and '__'.
> Steve said, "[[] for _ in range(5)]".
> Ben said, "[ [] for __ in range(5) ]".
>
> These aren't listed separately in the index
That's right,
ent to the cinema, it said ‘Adults: $5.00, Children $2.50’. |
`\ So I said ‘Give me two boys and a girl.’” —Steven Wright |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
funny gag |
_o__) would be to pretend you were swimming.” —Jack Handey |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
501 - 600 of 4138 matches
Mail list logo