Re: Enumerating all 3-tuples

2018-03-10 Thread Ben Bacarisse
bartc writes: > On 10/03/2018 20:06, Ben Bacarisse wrote: >>> On 10/03/2018 14:23, Ben Bacarisse wrote: >>>> Off topic: I knocked up this Haskell version as a proof-of-concept: >>>> >>>> import Data.List >>>> >>>> p

Re: Enumerating all 3-tuples (Posting On Python-List Prohibited)

2018-03-10 Thread Ben Bacarisse
Lawrence D’Oliveiro writes: > On Sunday, March 11, 2018 at 3:24:05 AM UTC+13, Ben Bacarisse wrote: >> Unfortunately my Python is not up to using iterators well enough to >> avoid a "maximum recursion depth exceeded" error. > > My solution only needed recursion up

Re: Enumerating all 3-tuples (Posting On Python-List Prohibited)

2018-03-12 Thread Ben Bacarisse
Lawrence D’Oliveiro writes: > On Sunday, March 11, 2018 at 2:40:16 PM UTC+13, Ben Bacarisse wrote: >> It would be nice to avoid relying on any value-based ordering. > > I don’t see why. The set of elements has to have the same cardinality > as the set of natural numbers, after

Re: Enumerating all 3-tuples (Posting On Python-List Prohibited)

2018-03-13 Thread Ben Bacarisse
Lawrence D’Oliveiro writes: > On Tuesday, March 13, 2018 at 1:58:48 PM UTC+13, Ben Bacarisse wrote: >> Of course you can always generate n-tuples of N and then map these to >> n-tuples of the intended sequence but that seems inelegant. > > This whole discussion seems to be

Re: Enumerating all 3-tuples (Posting On Python-List Prohibited)

2018-03-14 Thread Ben Bacarisse
Lawrence D’Oliveiro writes: > On Wednesday, March 14, 2018 at 2:18:24 PM UTC+13, Ben Bacarisse wrote: >> Lawrence D’Oliveiro writes: >> >> The original problem -- triples of natural numbers -- is >> not particularly hard, but the general problem -- enumerating n-tuple

Re: Python gotcha of the day

2018-03-14 Thread Ben Finney
! -- \ “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

Re: Enumerating all 3-tuples (Posting On Python-List Prohibited)

2018-03-15 Thread Ben Bacarisse
Lawrence D’Oliveiro writes: > On Thursday, March 15, 2018 at 2:56:24 PM UTC+13, Ben Bacarisse wrote: >> >> Lawrence D’Oliveiro writes: >> >>> On Wednesday, March 14, 2018 at 2:18:24 PM UTC+13, Ben Bacarisse wrote: >>> >>>> Lawrence D’Oliveiro

Re: Python gotcha of the day

2018-03-15 Thread Ben Finney
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. -- \

Re: Treatment of NANs in the statistics module

2018-03-16 Thread Ben Finney
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

Re: Treatment of NANs in the statistics module

2018-03-16 Thread Ben Finney
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

Re: Keys in dict and keys not in dict

2018-03-18 Thread Ben Finney
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__)

Re: Thank you Python community!

2018-03-19 Thread Ben Finney
iasm." -- Winston Churchill | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Style Q: Instance variables defined outside of __init__

2018-03-19 Thread Ben Finney
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

Re: Thank you Python community!

2018-03-19 Thread 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

Celestial Emporium of Benevolent Knowledge (was: Style Q: Instance variables defined outside of __init__)

2018-03-20 Thread Ben Finney
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__)

Re: Style Q: Instance variables defined outside of __init__

2018-03-20 Thread Ben Finney
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

Sig monster agency (was: Thank you Python community!)

2018-03-20 Thread Ben Finney
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

Re: Putting Unicode characters in JSON

2018-03-22 Thread Ben Finney
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

Re: Putting Unicode characters in JSON

2018-03-22 Thread Ben Finney
orian, 1914–2004 | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Accessing parent objects

2018-03-26 Thread Ben Finney
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

Re: Accessing parent objects

2018-03-26 Thread Ben Finney
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

Re: Curious case of UnboundLocalError

2018-03-30 Thread Ben Bacarisse
introduces "collections" as a global ... > z = { > "y": collections.defaultdict(list), > } > for (_, collections) in z.items(): ... and this uses that global ... > pass > > It works as expected (doesn't throw). ... except now collections is bound to a list (from the for) and no longer refers to the module. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Curious case of UnboundLocalError

2018-03-30 Thread Ben Bacarisse
Johannes Bauer writes: > On 30.03.2018 13:13, Ben Bacarisse wrote: > >>> import collections >>> >>> class Test(object): >>> def __init__(self): >>> z = { >>> "y": colle

Re: Why is the use of an undefined name not a syntax error?

2018-04-01 Thread Ben Bacarisse
return x+1 if f2(a) else y+1 ('a' is there only to prevent some obvious optimisations.) Are there any broken name references here? You might get an UnboundLocalError, though that depends on what f1 and f2 return. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: try-except syntax

2018-04-05 Thread Ben Bacarisse
t; Like a "fall-through" in a C-switch statement. The except parts don't fall through, and each one needs a "suite". Also, the "pass" before the return is mysterious which makes me think there's an indent error in what you posted. Anyway, to coalesce two or mor

Re: Thanks

2018-04-19 Thread Ben Finney
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

Re: Module, Package

2018-05-07 Thread Ben Finney
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

Re: Suggestion for a "data" object syntax

2018-05-08 Thread Ben Finney
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

Re: Leading 0's syntax error in datetime.date module (Python 3.6)

2018-05-11 Thread Ben Bacarisse
bably why it was kept. The PDP-11 has 8 registers and uses 3 bits to specify the addressing mode and many instructions use the top bit to indicate a variation such as word or byte operation. The result is that you'd never choose to use hex to look at PDP-11 code. That familiarity with octal mu

Re: object types, mutable or not?

2018-05-14 Thread Ben Finney
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

Re: object types, mutable or not?

2018-05-15 Thread Ben Finney
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

Re: What's the rationale for b"..." in this example?

2018-05-15 Thread Ben Finney
? 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

Re: object types, mutable or not?

2018-05-15 Thread Ben Finney
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

Re: object types, mutable or not?

2018-05-16 Thread Ben Finney
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

Re: object types, mutable or not?

2018-05-17 Thread Ben Bacarisse
he finger of accusation at either Brian or Dennis. The terms are much older than that. The first BCPL (1967) reference manual uses the terms, and I don't think Martin Richards invented them. (And C++ has added glvalue and prvalue to lvalue and rvalue.) -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: what does := means simply?

2018-05-17 Thread Ben Finney
unting fear that someone, somewhere, may be | `\ happy.” —Henry L. Mencken | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax oddities

2018-05-18 Thread Ben Bacarisse
he slightly sarcastic question was supposed remind people that lines left to right, lines are stacked, almost always from top to There are at least two directions for most text. After constructing -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: "Data blocks" syntax specification draft

2018-05-21 Thread Ben Finney
Vonnegut | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: how to handle captcha through machanize module or any module

2018-05-23 Thread Ben Finney
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-

Re: List replication operator

2018-05-24 Thread Ben Finney
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__)

Re: List replication operator

2018-05-25 Thread Ben Bacarisse
valuated the list expression n times to make the new list you would also get the behaviour you want. You would also be able to use it in situations like this: import random [random.randint(1,10)]**6 to get (for example) [2, 4, 7, 1, 1, 8]. Of course, this is just what the [L for _ in range(n)]

Re: Some Issues on Tagging Text

2018-05-25 Thread Ben Finney
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

Re: '_' and '__'

2018-05-26 Thread Ben Finney
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,

Re: Pink Floyd: is there anybody in here?

2018-05-30 Thread Ben Bacarisse
the mailing list, but this came out to Usenet just > fine. Snap. The original and the reply. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Pink Floyd: is there anybody in here?

2018-05-30 Thread Ben Bacarisse
Steven D'Aprano writes: > On Wed, 30 May 2018 21:53:05 +0100, Ben Bacarisse wrote: > >> Rob Gaddi writes: >> >>> On 05/30/2018 09:34 AM, Paul Rubin wrote: >>>> I think Usenet posts are no longer getting forwarded to the mailing >>>> list,

Re: Sorting NaNs

2018-06-02 Thread Ben Bacarisse
x,1/0] [1.0,2.0,4.0,Infinity,NaN,5.0,NaN] > Not sure what to make of this but at least sorting seems to give a > predictable result. I suspect it is predictable if you know the algorithm, but I doubt it's specified nor easily guessable from "outside". (GHCi, version 8.0.2 here) -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: How can an int be '+' with a tuple?

2018-06-02 Thread Ben Finney
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

Re: Attachments

2018-06-04 Thread Ben Finney
funny gag | _o__) would be to pretend you were swimming.” —Jack Handey | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Attachments

2018-06-05 Thread Ben Finney
d | `\place to begin or end, and it's hard to keep track of what | _o__) you've already covered.” —anonymous | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Why exception from os.path.exists()?

2018-06-07 Thread Ben Finney
religion, and he'll starve to death while praying for a fish.” | _o__) —Anonymous | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Stefan's headers [was:Names and identifiers]

2018-06-10 Thread Ben Bacarisse
he Copyright notice is probably intended for human eyes. IIRC his posts don't show up on Google groups, for example, so there *is* a mechanism by which *some* of the headers (it may be X-no-archive) do get acted on. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: mutable sequences

2018-06-13 Thread Ben Finney
ackages, is | `\ being able to choose your master. Freedom means not having a | _o__)master.” —Richard M. Stallman, 2007-05-16 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: How to apply filters to posts

2018-06-14 Thread Ben Finney
car Wilde, _De | _o__) Profundis_, 1897 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: mutable sequences

2018-06-14 Thread Ben Finney
these computers | `\and digital gadgets are no good. They just fill your head with | _o__) numbers and that can't be good for you.” —Prince, 2010-07-05 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: How to apply filters to posts

2018-06-14 Thread Ben Finney
Dennis Lee Bieber writes: > On Fri, 15 Jun 2018 05:39:08 +1000, Ben Finney > declaimed the following: > > >Don't choose the daily digest, because it makes a special “digest” > >message for you each day. That message is disconnected from any other > >message, and

Re: Server warning

2018-06-15 Thread Ben Finney
ure a properly secure WSGI server). -- \ “[F]reedom of speech does not entail freedom to have your ideas | `\accepted by governments and incorporated into law and policy.” | _o__) —Russell Blackford, 2010-03-06 | Ben Finney -- https://mail.python.o

Re: syntax difference

2018-06-16 Thread Ben Bacarisse
Cameron Simpson writes: > ... In Python 3 we have "format strings", which let you write: > > name = "Sharon" > age = 35 > print(f"The person named {name|r} is {age} years old.") You meant {name!r} I think there. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax difference

2018-06-16 Thread Ben Finney
sense in different use cases. -- \“A right is not what someone gives you; it's what no one can | `\ take from you.” —Ramsey Clark | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax difference

2018-06-16 Thread Ben Finney
Chris Angelico writes: > On Sun, Jun 17, 2018 at 3:30 PM, Ben Finney > wrote: > > (or, if you want to continue with the older less-flexible style, (I gave an unhelpful URL for that documentation. Try this instead https://docs.python.org/3/library/stdtypes.html#printf-style-strin

Re: syntax difference

2018-06-17 Thread Ben Finney
correct, not tried it.” —Donald Knuth, 1977-03-29 | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Metasyntactic thingies

2018-06-17 Thread Ben Finney
ome recent ones include “spunge”, “nardle”, “crun”, etc. -- \ “Pinky, are you pondering what I'm pondering?” “I think so, | `\ Brain, but where are we going to find a duck and a hose at this | _o__) hour?” —_Pinky and The Brain_ | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to call a class but without a new instance created?

2018-06-18 Thread Ben Finney
our own. -- \ “Now Maggie, I’ll be watching you too, in case God is busy | `\ creating tornadoes or not existing.” —Homer, _The Simpsons_ | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax difference

2018-06-18 Thread Ben Bacarisse
int main(void) { yylex(); } and it's only this long because there are four kinds of string. Not being a Python expert, there may be some corner case errors. And really there are comments that should not be removed such as #! on line 1 and encoding declarations, but they would just need another line or two. -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Is it possible to call a class but without a new instance created?

2018-06-18 Thread Ben Finney
g that problem? -- \ “The Vatican is not a state.… a state must have territory. This | `\ is a palace with gardens, about as big as an average golf | _o__) course.” —Geoffrey Robertson, 2010-09-18 | Ben Finney -- https://mail.python.org/mailman/listinfo/

Re: translating foreign data

2018-06-21 Thread Ben Bacarisse
x27; a proceed as if you had only one representation? The code page remark is curious. Will some "code pages" have digits that are not ASCII digits? -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: translating foreign data

2018-06-22 Thread Ben Bacarisse
Ethan Furman writes: > On 06/21/2018 01:20 PM, Ben Bacarisse wrote: >> You say in a followup that you don't need to worry about digit grouping >> marks (like thousands separators) so I'm not sure what the problem is. >> Can't you just replace ',&#

Re: translating foreign data

2018-06-22 Thread Ben Bacarisse
Steven D'Aprano writes: > On Fri, 22 Jun 2018 11:14:59 +0100, Ben Bacarisse wrote: > >>>> The code page remark is curious. Will some "code pages" have digits >>>> that are not ASCII digits? >>> >>> Good question. I have no idea. &g

Re: translating foreign data

2018-06-23 Thread Ben Finney
ect. -- \ “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

Re: Static variables [was Re: syntax difference]

2018-06-23 Thread Ben Bacarisse
ple much further up. The effect can simulated like this: def make_counter(): def c(): c.x += 1 return c.x c.x = 0 return c i = make_counter() j = make_counter() print(i(), i(), j(), i()) -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: Static variables [was Re: syntax difference]

2018-06-23 Thread Ben Bacarisse
Bart writes: > On 23/06/2018 23:25, Ben Bacarisse wrote: >> Bart writes: >> >>> On 23/06/2018 21:13, Chris Angelico wrote: >>>> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: >>> >>>>> (At what point would that happen anyway; if you

Re: translating foreign data

2018-06-24 Thread Ben Bacarisse
To: Steven D'Aprano From: Ben Bacarisse Steven D'Aprano writes: > On Fri, 22 Jun 2018 11:14:59 +0100, Ben Bacarisse wrote: > >>>> The code page remark is curious. Will some "code pages" have digits >>>> that are not ASCII digits? >>&g

Re: Package directory question

2018-06-24 Thread Ben Finney
at all that does. -- \“Telling pious lies to trusting children is a form of abuse, | `\plain and simple.” —Daniel Dennett, 2010-01-12 | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Anyone here on Python-Dev mailing list?

2018-06-24 Thread Ben Finney
mane), and am not receiving anything like that. -- \ “Today, I was — no, that wasn't me.” —Steven Wright | `\ | _o__) | Ben Finney -- https://

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-24 Thread Ben Finney
“I wish there was a knob on the TV to turn up the intelligence. | `\ There's a knob called ‘brightness’ but it doesn't work.” | _o__) —Eugene P. Gallagher | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: translating foreign data

2018-06-25 Thread Ben Finney
From: Ben Finney Richard Damon writes: > On 6/23/18 11:27 AM, Steven D'Aprano wrote: > >> On 6/23/18 9:05 AM, Marko Rauhamaa wrote: > >>> Richard Damon wrote: > >>> > Data presented to the user should normally use his locale > >>> > (u

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Ben Bacarisse
To: Bart From: Ben Bacarisse Bart writes: > On 23/06/2018 21:13, Chris Angelico wrote: >> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: > >>> (At what point would that happen anyway; if you do this: > >> NONE of your examples are taking copies of the fu

Re: Static variables [was Re: syntax difference]

2018-06-25 Thread Ben Bacarisse
To: Bart From: Ben Bacarisse Bart writes: > On 23/06/2018 23:25, Ben Bacarisse wrote: >> Bart writes: >> >>> On 23/06/2018 21:13, Chris Angelico wrote: >>>> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: >>> >>>>> (At what poin

Re: translating foreign data

2018-06-26 Thread Ben Bacarisse
To: Steven D'Aprano From: "Ben Bacarisse" To: Steven D'Aprano From: Ben Bacarisse Steven D'Aprano writes: > On Fri, 22 Jun 2018 11:14:59 +0100, Ben Bacarisse wrote: > >>>> The code page remark is curious. Will some "code pages" hav

Re: Package directory question

2018-06-26 Thread Ben Finney
From: Ben Finney Robert Latest via Python-list writes: > Because the main.py script needs to import the tables.py module from > backend, I put this at the top if main.py: > >sys.path.append('../..') >import jobwatch.backend.tables as tables > > My questio

Re: Anyone here on Python-Dev mailing list?

2018-06-26 Thread Ben Finney
From: Ben Finney Steven D'Aprano writes: > Anyone on the Python-Dev mailing list, are you getting private emails > containing nothing but stream of consciousness word-salad from > somebody (some bot?) calling himself "Chanel Marvin" with a gmail > address? I am on

Re: Quick survey: locals in comprehensions (Python 3 only)

2018-06-26 Thread Ben Finney
From: Ben Finney Paul Moore writes: > On 24 June 2018 at 06:03, Steven D'Aprano > wrote: > > Given this function: > > > > def test(): > > a = 1 > > b = 2 > > result = [value for key, value in locals().items()] > > retu

Re: Static variables [was Re: syntax difference]

2018-06-26 Thread Ben Bacarisse
To: Bart From: "Ben Bacarisse" To: Bart From: Ben Bacarisse Bart writes: > On 23/06/2018 21:13, Chris Angelico wrote: >> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: > >>> (At what point would that happen anyway; if you do this: > >> NONE o

Re: Static variables [was Re: syntax difference]

2018-06-26 Thread Ben Bacarisse
To: Bart From: "Ben Bacarisse" To: Bart From: Ben Bacarisse Bart writes: > On 23/06/2018 23:25, Ben Bacarisse wrote: >> Bart writes: >> >>> On 23/06/2018 21:13, Chris Angelico wrote: >>>> On Sat, Jun 23, 2018 at 10:41 PM, Bart wrote: >

Re: Should nested classes in an Enum be Enum members?

2018-06-28 Thread Ben Finney
nses overpowers what our measuring | `\ devices tell us about the actual nature of reality.” —Ann | _o__) Druyan, _Cosmos_, 2014 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Should nested classes in an Enum be Enum members?

2018-06-28 Thread Ben Finney
Ian Kelly writes: > On Thu, Jun 28, 2018 at 4:38 AM Ben Finney wrote: > > > > Ethan Furman writes: > > > > Specifically, I can't make sense of why someone would want to have a > > class that is simultaneously behaving as an enumerated type, *and* > &

Re: Should nested classes in an Enum be Enum members?

2018-06-28 Thread Ben Finney
Ethan Furman writes: > On 06/28/2018 05:58 PM, Ben Finney wrote: > > > So I remain dumbfounded as to why anyone would want a class to *both* be > > an enumerated type, *and* have callable attributes in its API. > > Perhaps I am using Enum incorrectly, but here is

Re: Getting posts to sort chronologically in tree view

2018-07-02 Thread Ben Finney
ary. -- \ “The entertainment industry calls DRM "security" 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: Getting posts to sort chronologically in tree view

2018-07-02 Thread Ben Finney
st place to get that help. -- \ “I tell you the truth: this generation will certainly not pass | `\ away until all these things [the end of the world] have | _o__) happened.” —Jesus, c. 30 CE, as quoted in Matthew 24:34 | Ben Finney -- https://mail.python.org/mailm

Re: Getting posts to sort chronologically in tree view

2018-07-03 Thread Ben Finney
Lowell | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Ben Finney
Jim Lee writes: > On 07/03/18 19:58, Ben Finney via Python-list wrote: > > Jim Lee writes: > > > >> If you were to say John had 2 apples, Jane had 4 apples, and Joe had > >> an indefinite number of apples, how many numbers are we talking about? > > Three

Re: Getting posts to sort chronologically in tree view

2018-07-03 Thread Ben Finney
T Berger writes: > On Tuesday, July 3, 2018 at 4:00:03 PM UTC-4, Ben Finney wrote: > > Given that history [of ignoring user requests for improvement], you > > might want to avoid Google Groups for interacting with forums, and > > choose software that works better with di

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Ben Finney
t rare story of which you happen to have first-hand | _o__) knowledge.” —Erwin Knoll | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Ben Finney
erested any more. -- \“This sentence contradicts itself — no actually it doesn't.” | `\ —Douglas Hofstadter | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Using Python with a website

2018-07-04 Thread Ben Finney
“If sharing a thing in no way diminishes it, it is not rightly | `\ owned if it is not shared.” —Augustine of Hippo (354–430 CE) | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: Looking for a recent quote about dynamic typing, possibly on this list

2018-07-06 Thread Ben Finney
1988 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: variable scope in try ... EXCEPT block.

2018-07-12 Thread Ben Bacarisse
able to refer to it after the except clause. Exceptions are cleared because with the traceback attached to them, they form a reference cycle with the stack frame, keeping all locals in that frame alive until the next garbage collection occurs. This appears to be a change from Python 2. That wording is not present in https://docs.python.org/2/reference/compound_stmts.html#try -- Ben. -- https://mail.python.org/mailman/listinfo/python-list

Re: variable scope in try ... EXCEPT block.

2018-07-12 Thread Ben Bacarisse
Just word on quoting... codewiz...@gmail.com writes: > On Thursday, July 12, 2018 at 5:45:52 AM UTC-4, Ben Bacarisse wrote: >> >> [snip] You cut everything I wrote. What you left is what I quoted from the Python documentation. In fairness to the authors you should probab

Re: [OT] Bit twiddling homework

2018-07-20 Thread Ben Bacarisse
ork on ints: >> >> bitwise AND: & >> bitwise OR: | >> bitwise XOR: ^ >> > That's right I had forgotten about that. There's also ~ for bitwise negation. Rather than explain what this means in a language with an unbounded integer type, you might like

Re: functions vs methods

2018-07-22 Thread Ben Finney
gress has resulted from people who took unpopular | `\ positions.” —Adlai Stevenson | _o__) | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list

Re: functions vs methods

2018-07-22 Thread Ben Finney
erived from it) to improve the documentation as you suggest. -- \ “Come on, if your religion is so vulnerable that a little bit | `\ of disrespect is going to bring it down, it's not worth | _o__) believing in, frankly.” —Terry Gilliam, 2005-01-18 | Be

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