Paul Moore writes:
> On 24 October 2017 at 11:23, Ben Bacarisse wrote:
>> For example, run the complete works of Shakespeare through your program.
>> The result is very much not random data, but that's the sort of data
>> people want to compress. If you can c
Steve D'Aprano writes:
> On Tue, 24 Oct 2017 09:23 pm, Ben Bacarisse wrote:
>
>> Forget random data. For one thing it's hard to define,
>
> That bit is true.
>
>> but more importantly no one cares about it.
>
> But that's wrong.
All generalisa
bbling) they get an
endless stream of highly prized attention.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
Gregory Ewing writes:
> Ben Bacarisse wrote:
>> The trouble is a pedagogic one. Saying "you can't compress random data"
>> inevitably leads (though, again, this is just my experience) to endless
>> attempts to define random data.
>
> It's more
Marko Rauhamaa writes:
> Ben Bacarisse :
>
>>> In this context, "random data" really means "uniformly distributed
>>> data", i.e. any bit sequence is equally likely to be presented as
>>> input. *That's* what information theory says can
Steve D'Aprano writes:
> On Fri, 27 Oct 2017 09:53 am, Ben Bacarisse wrote:
>
>> A source of random can be defined but "random data" is much more
>> illusive.
>
> Random data = any set of data generated by "a source of random".
(I had an edit
Gregory Ewing writes:
> Ben Bacarisse wrote:
>> But that has to be about the process that gives rise to the data, not
>> the data themselves.
>
>> If I say: "here is some random data..." you can't tell if it is or is
>> not from a random sou
ttp://www.bsb.me.uk/software/utf-8-dump/
I use it all the time (but then I would!).
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
; The 0xc2 0x20 byte
> pair that you misidentify as a space is another matter entirely.
>
> 0xc2 0x20 is not a space in UTF-8. It is an invalid code sequence. I
> don't know how or where it was generated, but it really shouldn't have
> been.
It wasn't there. It was down to a misreading of the byte-order in the
hex dump.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
s the risk of the identifier »os«
> already being used in the sorrounding code. While
>
> __import__( "os" ).getcwd()
>
> does not seem to "leak" names into the enclosing scope.
Also it's an expression which may be important in your "quick and dirty"
scripts.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
at all (the for-loop
> sequence is empty, or the while-loop condition is initially false).
>
>
>> Off course, it should not be changed in Python 3, maybe in Python 4 or
>> 5, but in Python 3 `then` could be an alias of `else` in these contexts.
>
> Unfortunately, this is almost certainly not going to happen. It would require
> adding a new keyword, and unless Guido changes his mind, he doesn't think
> this change is worthwhile.
Re-using finally would not need a new keyword and might be close enough
in meaning.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
Steve D'Aprano writes:
> On Thu, 2 Nov 2017 12:50 pm, Ben Bacarisse wrote:
>
>> Steve D'Aprano writes:
>>
>>> On Thu, 2 Nov 2017 08:12 am, Alexey Muranov wrote:
>>>
>>>> what do you think about the idea of replacing "`else`"
Steve D'Aprano writes:
> On Thu, 2 Nov 2017 10:09 pm, Ben Bacarisse wrote:
>
>> Sure, but your argument seemed to that else has entirely the wrong
>> meaning (I certainly to a double take when I have to remember what it
>> means) and, in that context, finally has
Wright |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Jon Ribbens writes:
> On 2017-11-04, Ben Finney wrote:
> > To respond to the criticism of an idea – criticism containing no
> > mention of the person – as though it “clearly refers to the
> > [person]”, is of significant concern on a software dicussion forum
> > such
e Zen.
--
\“Perchance you who pronounce my sentence are in greater fear |
`\ than I who receive it.” —Giordano Bruno, burned at the stake by |
_o__) the Catholic church for the heresy of heliocentrism, 1600-02-16 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
hat anybody else is going to do. The best |
`\ way to predict the future is to invent it.” —Alan Kay |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Jon Ribbens writes:
> On 2017-11-05, Ben Finney wrote:
> > Jon Ribbens writes:
> >> I've provided you with a way of thinking about 'for...else' that makes
> >> its purpose and meaning intuitively obvious.
> >
> > I've read that sentenc
her investigation.” —Thomas W. Clark, 2009 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
boisterous sea |
`\of liberty.” —Thomas Jefferson |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Jon Ribbens writes:
> On 2017-11-08, Ben Finney wrote:
> > I also think Jon had cause to bristle somewhat at the characterisation.
> > I don't think Jon was attacked by Steve's remark, but I do sympathise
> > with the instinct to feel a criticism as an attac
Ned Batchelder writes:
> On 11/8/17 5:22 PM, Ben Finney wrote:
> > To say that someone is being arrogant simply is not an attack, and I
> > really want you to see that.
> Ben, this idea is really stupid!
>
> Be honest: when you read what I just wrote, did you feel a
&g
|
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
t;mistaken".
I accept all of that, and I do think tact is too often in short supply.
--
\ “Begin with false premises and you risk reaching false |
`\ conclusions. Begin with falsified premises and you forfeit your |
_o__) authority.” —Kathryn Schulz, 2015-10-19 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Ned Batchelder writes:
> On 11/8/17 10:18 PM, Ben Finney wrote:
> > What has been made clear to me is that we have a long way to go in
> > pursuit of allowing ideas to be held at arm's length, discussed and
> > criticised, with respect and compassion for one another
Ned Batchelder writes:
> On 11/10/17 6:03 PM, Ben Finney wrote:
> > Ned Batchelder writes:
> >> Beyond just respect and compassion, this discussion has mentioned
> >> "changing people's minds" a few times. How's that going?
> > Impressive
r ‘target audience’ also owns a |
`\ broadcasting station. These ‘targets’ can shoot back.” —Michael |
_o__) Rathbun to advertisers, news.admin.net-abuse.email |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
“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
Ben Finney writes:
> import itertools
>
> month_values = sorted(list(fut_suffix.keys()))
> month_cycle = itertools.cycle(month_values)
>
> month_choice = 7
> three_months_starting_at_choice = []
> while len(three_months_starting_at_choice) < 3:
n't mean to denigrate |
`\ those who do. And for the people who like country music, |
_o__) denigrate means ‘put down’.” —Bob Newhart |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
eters to the function?
--
\ “How wonderful that we have met with a paradox. Now we have |
`\some hope of making progress.” —Niels Bohr |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
t be uncomfortable for us, but it is a necessary
adaptation the community needs to undergo.
--
\ “In any great organization it is far, far safer to be wrong |
`\ with the majority than to be right alone.” —John Kenneth |
_o__)Galbraith, 1989-07-28 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
out to understand what's happening?
--
\ “If you're not part of the solution, you're part of the |
`\ precipitate.” —Steven Wright |
_o__) |
Ben Finney
--
https://ma
know you?’” —Steven Wright |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
take.
--
\“You can't have everything; where would you put it?” —Steven |
`\Wright |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ing worth saying is inoffensive to everyone. 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
. Given more than one positional argument, it should raise a
TypeError.
--
\ Legionnaire: “We have their leader captive!” Cæsar: “Is he |
`\ bound?” Legionnaire: “Of his health I know not, sir.” —The |
_o__)Goon Show, _The Histories Of Pliny The Elder_ |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
iki/Identity_function>
--
\ “But Marge, 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
“Jealousy: The theory that some other fellow has just as little |
`\ taste.” —Henry L. Mencken |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
it seriously.” —Douglas Adams |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
will, within limits drawn around us by the equal rights of |
_o__) others.” —Thomas Jefferson, 1819 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
other museums.” —Steven |
_o__) Wright |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
e else piling on with suggestions, can we let Duram answer?
--
\ “Think for yourselves and let others enjoy the privilege to do |
`\ so too.” —Voltaire, _Essay On Tolerance_ |
_o__) |
Ben Finney
--
ht
t and |
`\keep their eyes glued on a screen: the average American family |
_o__) hasn't time for it.” —_The New York Times_, 1939 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
gotos.
> If it looks better than what I'd come up with, then I'll use that instead.
What looks better is always going to be an unreliable and subjective
measure, but calling a named function almost certainly scales better and
will allow for better structuring (such as when one block needs to use
another one).
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
bartc writes:
> On 30/12/2017 20:36, Ben Bacarisse wrote:
>> bartc writes:
>>
>>> On 30/12/2017 16:53, mm0fmf wrote:
>>>> On 30/12/2017 14:41, bartc wrote:
>>>>> it looks a bit naff
>>>>
>>>> Understatement of 2017.
s a hard line to draw) then we are not talking about the
same cases. Given the choice of "dragging in named functions" and
dragging in named blocks and gotos, I would choose the functions every
time.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
bartc writes:
> On 31/12/2017 15:02, Ben Bacarisse wrote:
>> bartc writes:
>
>> I think there's a problem with that. Standard C does not have them, you
>> said your language does not implement them properly
>
> (The real problem is I don't remember lo
bartc writes:
> On 31/12/2017 22:09, Ben Bacarisse wrote:
>
>> No, you missed the point and did not address the question. You said (now
>> cut)
>>
>> | If I thought introducing functions, whether local or not, as a way of
>> | avoiding goto was worth doing, I
mankind's entire history may be the |
`\ hijacking of morality by religion.” —Arthur C. Clarke, 1991 |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
computer. Art is everything else we do.” —Donald Knuth, 1996 |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Chris Angelico writes:
> On Mon, Jan 8, 2018 at 11:35 AM, Ben Finney via Python-list
> wrote:
> > I think “reject unless absolutely needed” is an unreasonably high
> > bar, which would disqualify most Python language features. So I
> > don't know why you expect this
ment for having
the Python documentation available.
--
\ “The history of Western science confirms the aphorism that the |
`\ great menace to progress is not ignorance but the illusion of |
_o__)knowledge.” —Daniel J. Boorstin, historian, 1914–2004 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
what you expected to happen?
--
\ “Pinky, are you pondering what I'm pondering?” “Um, I think so, |
`\Brainie, but why would anyone want to Pierce Brosnan?” —_Pinky |
_o__) and The Brain_ |
Ben Finney
--
https://mail.python.org/mai
attribute access behaviour is not enough?
--
\“Sane people have an appropriate perspective on the relative |
`\ importance of foodstuffs and human beings. Crazy people can't |
_o__) tell the difference.” —Paul Z. Myers, 2010-04-18 |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
least know the external interface of that function.
--
\ “If you do not trust the source do not use this program.” |
`\—Microsoft Vista security dialogue |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
ble to discuss the
equivalent (if any) in a Python environment.
--
\ “Shepherds … look after their sheep so they can, first, fleece |
`\ them and second, turn them into meat. That's much more like the |
_o__) priesthood as I know it.” —Christopher Hitchens, 2008-10-29 |
Be
ople take |
_o__)it seriously.” —Douglas Adams |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
at most of what is said is not even true; the
article should not be referenced at all, IMO.
--
\ “We jealously reserve the right to be mistaken in our view of |
`\ what exists, given that theories often change under pressure |
_o__) from further investigation.” —Thoma
#x27;, ifname.encode('ascii'))
That may be different from what you want the code to do, though. It's
not clear from the code what its intention is.
--
\ “What is needed is not the will to believe but the will to find |
`\ out, which is the exact opposite.” —Bertrand Russell,
d but the types are
almost always inferred. If you see an explicit type, it's usually
because the author thinks it helps explain something.
(I don't want to start a Haskell/Python thread -- the only point is that
static typing does not inevitably imply lots of 'boilerplate'.
program can have.
--
\ “The most dangerous man to any government is the man who is |
`\ able to think things out for himself, without regard to the |
_o__) prevailing superstitions and taboos.” —Henry L. Mencken |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
erwise.” —_Timequake_, Kurt Vonnegut |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
he idea for the program to play an optimal strategy for player 2, or
is the program simply doing the housekeeping -- verifying moves and
tracing the pile of stones?
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
ion is very difficult, especially of the future.” |
`\ —Niels Bohr |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Lawrence D’Oliveiro writes:
> On Wednesday, February 21, 2018 at 3:10:25 AM UTC+13, Ben Bacarisse wrote:
>> You almost never /have/ to use nested loops. Has the course got this
>> far without introducing the idea of a function?
>
> If you are using a function to avoid a
> algorithm:
It's odd indeed, but given that they did, what you take to be the point
of the article -- to write a good Python algorithm as fast as the
terrible Julia one -- seems a bit pointless.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
on, go back to the original C and work from there.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
g what ‘dwarves’ gets passed
around) and the function signatures don't change.
--
\“All opinions are not equal. Some are a very great deal more |
`\ robust, sophisticated, and well supported in logic and argument |
_o__) than others.
asked what he thought of Western civilization) |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
Christian Gollwitzer writes:
> George Marsaglia is a researcher who invented a couple of PRNGs which
> are both simple (one of the first was called KISS) yet surprisingly
> good.
s/is/was/
Sadly, he died a few years ago (2011).
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
destroyed the weak reference may return the object even if
there are no strong references to it.
--
\ “The cost of education is trivial compared to the cost of |
`\ ignorance.” —Thomas Jefferson |
_o__)
Hi, I noticed this when using the requests library in the response.elapsed
object (type timedelta). Tested using the standard datetime library alone
with the example displayed on
https://docs.python.org/3/library/datetime.html#examples-of-usage-timedelta
It appears as though the timedelta object
thwhile to add a new feature like this in Python? If so, how
> can I propose this to PEP?
To make any sort of case you'd need to give an example that does not
have a clearer way to write it already. Your working version is, to me,
clearer that the ones you want to be able to write.
--
!" or give false for x == 0. Of course these are not random choices,
but it shows that Python's design is very far from universal.
But then this is not a numbers game, anyway. A programmer need only to
have used one or two languages that are rather more strict about types
to find such a thing unsurprising in future.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
complex expressions?
It handles only expressions, and "for i in range(1,10): i" is not an
expression. You can use
>>> exec("for i in range(1,10): i")
or, to confirm that something is happening:
>>> exec("for i in range(1,10): print(i)")
1
2
3
4
5
6
7
8
9
See: https://docs.python.org/3/library/functions.html?highlight=eval#eval
and the immediately following entry.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
"Peter J. Holzer" writes:
> On 2023-01-27 21:04:58 +, Ben Bacarisse wrote:
>> mutt...@dastardlyhq.com writes:
>>
>> > Hi
>>
>> It looks like you posted this question via Usenet. comp.lang.python is
>> essentially dead as a Usenet group
Jon Ribbens writes:
> On 2023-01-29, Ben Bacarisse wrote:
>> "Peter J. Holzer" writes:
>>
>>> On 2023-01-27 21:04:58 +, Ben Bacarisse wrote:
>>>> mutt...@dastardlyhq.com writes:
>>>>
>>>> > Hi
>>&
Igor Berger writes:
> On Saturday, January 28, 2023 at 10:02:57 PM UTC-5, Ben Bacarisse wrote:
>> Jon Ribbens writes:
>>
>> > On 2023-01-29, Ben Bacarisse wrote:
>> >> "Peter J. Holzer" writes:
>> >>
>> >
.3.
>
> Is there any advice on this issue? thanks.
Sorry, no, but I can add a data point. It works for me on my Ubuntu
system with these versions:
$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits&qu
you used Usenet (and your reply here was via Usenet). Usenet
posts to comp.lang.python don't go to the mailing list (the "here" that
Ethan is talking about). Mails to the list /are/ sent here, but it's
one-way traffic.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
Ethan Furman writes:
> On 2/15/21 2:02 PM, Grant Edwards wrote:
>> On 2021-02-15, Ben Bacarisse wrote:
>>
>>> You said you used Usenet (and your reply here was via Usenet).
>>> Usenet posts to comp.lang.python don't go to the mailing list (the
>>>
n't think there is anything to see here. If the author had come up
with some new ways to tackle any of the problems, he would be telling
people about these, not saying "be patient" (and bad-mouthing CPython).
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
ems that stumped others, nothing but
what appears to be a false claim about neos can do. If you want this
project to be taken seriously, you are going about it the wrong way.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
ink to the code itself so people can look at it
without having to load up a project.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
Arak Rachael writes:
> On Wednesday, 7 July 2021 at 12:47:40 UTC+2, Arak Rachael wrote:
>> On Wednesday, 7 July 2021 at 12:41:44 UTC+2, Ben Bacarisse wrote:
>> > Arak Rachael writes:
>> >
>> > > this time I am stuck on gaussian_filter scipy returns none
asked for. Every 0.3 could come with a warning
that 0.3 can not be represented exactly as a floating point value. To
avoid the warning, the programmer would write ~0.3 meaning, exactly, the
binary (or whatever the base really is) floating point number closest to
0.3.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
Chris Angelico writes:
> On Sat, Nov 20, 2021 at 9:07 AM Ben Bacarisse wrote:
>>
>> Chris Angelico writes:
>>
>> > On Sat, Nov 20, 2021 at 5:08 AM ast wrote:
>>
>> >> >>> 0.3 + 0.3 + 0.3 == 0.9
>> >> False
>> >
>
Chris Angelico writes:
> On Sat, Nov 20, 2021 at 12:43 PM Ben Bacarisse wrote:
>>
>> Chris Angelico writes:
>>
>> > On Sat, Nov 20, 2021 at 9:07 AM Ben Bacarisse wrote:
>> >>
>> >> Chris Angelico writes:
>> >>
>> >&g
Chris Angelico writes:
> On Sat, Nov 20, 2021 at 3:41 PM Ben Bacarisse wrote:
>>
>> Chris Angelico writes:
>>
>> > On Sat, Nov 20, 2021 at 12:43 PM Ben Bacarisse
>> > wrote:
>> >>
>> >> Chris Angelico writes:
>> >
Grant Edwards writes:
> On 2021-11-20, Ben Bacarisse wrote:
>
>> You seem to be agreeing with me. It's the floating point part that is
>> the issue, not the base itself.
>
> No, it's the base. Floating point can't represent 3/10 _because_ it's
> b
Phil Boutros writes:
> Ben Finney wrote:
> > How can I specify which database (by its alias name) a Django
> > ModelForm should use
>
> > What is the equivalent for using='foo' when instantiating a ModelForm
> > for the model, or calling its methods (
Rustom Mody writes:
> On Wednesday, August 10, 2016 at 6:39:31 AM UTC+5:30, Ben Finney wrote:
> > --
> > \ “I love and treasure individuals as I meet them, I loathe and |
> > `\ despise the groups they identify with and belong to
g for a convention :-)
--
\ “Prediction is very difficult, especially of the future.” |
`\ —Niels Bohr |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
; If "p" points to a struct (record), then "*p" is that struct, and if
> that struct has a member (field) "m", then that member can be accessed
> by "(*p)->m" (the parens are necessary because of the operator
> precedence).
I think you meant (*p).m here because you go on to correct say that ->
offers a shorthand for this rather messy access:
> This can be abbreviated to "p->m".
>
> Pascal, on the other hand, dereferences with a postfixed "^", so that
> would be "p^.m".
>
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
he right-to-left binding. I think the change was unfortunate because
the arrow works well in various layouts and looks much better when
chained (though that might just be my bias from being a BCPL coder from
way back).
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
utomata. I say this because of
your reference to nesting. PDAs can be thought of as either DFAs or
NFAs with a stack so they can recognise languages with nested structure.
--
Ben.
--
https://mail.python.org/mailman/listinfo/python-list
|
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
`\ people must be really tired.” —Steven Wright |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
indistinguishable from a |
`\ feature.” —Rich Kulawiec |
_o__) |
Ben Finney
--
https://mail.python.org/mailman/listinfo/python-list
601 - 700 of 5100 matches
Mail list logo