Re: Is this a bug or a feature in TkInter?

2018-05-11 Thread Cuthbert Milligen
Found it! Thanks again :-) -- https://mail.python.org/mailman/listinfo/python-list

Re: Is this a bug or a feature in TkInter?

2018-05-11 Thread Cuthbert Milligen
Hi Terry, many thanks for your detailed explanation! (I can't see how to 'reply' under your post...) -- https://mail.python.org/mailman/listinfo/python-list

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-11 Thread Chris Angelico
On Fri, May 11, 2018 at 12:38 PM, Ian Kelly wrote: > Would you also contend that generator functions are wrong because they > pretend to be normal functions? > > def totally_not_a_generator(n): > while True: > if n % 2 == 0: > n //= 2 > else: > n = n * 3

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-11 Thread Chris Angelico
On Fri, May 11, 2018 at 4:54 PM, Ian Kelly wrote: > On Thu, May 10, 2018 at 11:45 PM, Steven D'Aprano > wrote: >> To be honest, I'm having trouble thinking of a good use-case for "while >> True", now that we have infinite iterators. Most cases of >> >> while True: >> x = get_item() >>

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-11 Thread Ian Kelly
On Fri, May 11, 2018 at 12:03 AM, Steven D'Aprano wrote: > On Thu, 10 May 2018 20:38:39 -0600, Ian Kelly wrote: > >> Would you also contend that generator functions are wrong because they >> pretend to be normal functions? > > You're going to need to be more specific. In what way are they not norm

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

2018-05-11 Thread Chris Angelico
On Fri, May 11, 2018 at 12:04 PM, Bob van der Poel wrote: > I agree with my freind Gene! And, if it is really necessary to retain > octal, why not preface it with anything BUT a "0". I've been hit by this a > few times in the past. I used lots of hex over the years, but don't recall > ever using o

Re: Suggestion for a "data" object syntax

2018-05-11 Thread Chris Angelico
On Fri, May 11, 2018 at 4:39 PM, Ian Kelly wrote: > On Mon, May 7, 2018 at 9:45 PM, Mikhail V wrote: >> Benefits are easy to see: say I want a tuple of strings: >> >> data === T : >> "foo bar" >> "hello world" >> "to be continued..." >> >> VS current: >> >> data = ( >> "foo bar" ,

Re: Is this a bug or a feature in TkInter?

2018-05-11 Thread Terry Reedy
On 5/11/2018 2:57 AM, Cuthbert Milligen wrote: Hi Terry, many thanks for your detailed explanation! (I can't see how to 'reply' under your post...) Followup to the list rather than reply to me, as you did, is the right thing to do. -- Terry Jan Reedy -- https://mail.python.org/mailman/li

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-11 Thread Gregory Ewing
Marko Rauhamaa wrote: I was mildly amused when Python happily executed such code. "..." is a valid expression and thus, a valid statement. Fortunately, "?" still works for this! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-11 Thread Gregory Ewing
I suggest adding a new builtin constant: YouFeelLikeIt = True Then all pseudo-infinite loops can be written while YouFeelLikeIt: ... -- Greg -- https://mail.python.org/mailman/listinfo/python-list

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

2018-05-11 Thread Gregory Ewing
On 10/05/2018 19:51, Chris Angelico wrote: YAGNI much? How often do you need a base-9 literal in your code?? You've obviously never programmed a Setun ternary computer: https://en.wikipedia.org/wiki/Setun -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-11 Thread Chris Angelico
On Fri, May 11, 2018 at 7:10 PM, Gregory Ewing wrote: > I suggest adding a new builtin constant: > >YouFeelLikeIt = True > > Then all pseudo-infinite loops can be written > >while YouFeelLikeIt: > ... > Personally, I prefer to use string literals. while "you feel like it": ...

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

2018-05-11 Thread Gregory Ewing
Chris Angelico wrote: Octal makes a lot of sense in the right contexts. Allowing octal literals is a Good Thing. And sticking letters into the middle of a number doesn't make that much sense, so the leading-zero notation is a decent choice. Also it's easy to forget that octal was a big part of

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

2018-05-11 Thread Gregory Ewing
Marko Rauhamaa wrote: I think octal is a historical relic from a time when people weren't yet comfortable with hexadecimal. Octal made perfect sense for all PDP models up to the PDP-10, which had word sizes that were a multiple of 3 bits. It still partly made sense for the PDP-11, because its

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

2018-05-11 Thread Gregory Ewing
Chris Angelico wrote: What do you mean, "another bit"? Currently, the chmod command on my system can manage nine primary bits (rwx for each of ugo), plus setuid, setgid, and sticky. I think the idea is that you could regroup those 4 groups of 3 into 3 groups of 4, and get a nice mapping to hex.

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

2018-05-11 Thread Gregory Ewing
Steven D'Aprano wrote: n for binary t for octal i for trinary o for duodecimal and of course, x for hexadecimal. And in format strings: "c" for decimal "a" for char "r" for string "w" for raw string Looks fine to me. Who wants to write the PEP? -- Greg -- https://mail.python.org/mai

Re: Meaning of abbreviated terms

2018-05-11 Thread Gregory Ewing
Steven D'Aprano wrote: But that's not where plists came from, was it? As I understand it, the plist data format was invented by Apple, and they called it a property list. The term "property list" can also refer to a data structure in Lisp: https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node10

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

2018-05-11 Thread Jon Ribbens
On 2018-05-10, Chris Angelico wrote: > On Fri, May 11, 2018 at 5:04 AM, Jon Ribbens > wrote: >> This whole thread is reminding me PHP 2, which would magically treat >> the second parameter of ChMod() as octal, because clearly if weak >> typing is good then *no* typing must be best of all! >> >>

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

2018-05-11 Thread Steven D'Aprano
On Fri, 11 May 2018 21:55:17 +1200, Gregory Ewing wrote: > Hex came into vogue in the DEC world with the VAX, which was both > byte-addressed and had a hex-oriented instruction encoding. Indeed. In 2018 when nearly all computers (aside from some DSPs) have standardised on the same number of bit

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

2018-05-11 Thread bartc
On 11/05/2018 01:11, Chris Angelico wrote: On Fri, May 11, 2018 at 8:43 AM, bartc wrote: This is Wrong, and would have been just as obviously wrong in 1989. Having spent many years programming in C and working on Unix, I strongly disagree. Using C is apt to give you a rather warped view of

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

2018-05-11 Thread bartc
On 10/05/2018 21:18, bartc wrote: On 10/05/2018 19:51, Chris Angelico wrote: On Fri, May 11, 2018 at 4:31 AM, bartc wrote:    2x100  (4)   Binary    3x100  (9)   Ternary    4x100  (16)  Quaternary    5x100  (25)  etc    6x100  (36)    7x100  (49)    8x100  (64)  Octal    9x100  (81)    ...

EuroPython 2018: Please reset your password

2018-05-11 Thread M.-A. Lemburg
Regular password resets are always a good thing to do, but this time we have a specific reason to ask you to consider taking the extra time. In December 2017, our ISP detected port scans originating from our server and informed us about these. During the analysis, we found that someone (or better:

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

2018-05-11 Thread Ben Bacarisse
bartc writes: > On 11/05/2018 01:25, Marko Rauhamaa wrote: >> Chris Angelico : >> >>> Octal makes a lot of sense in the right contexts. >> >> I think octal is a historical relic from a time when people weren't yet >> comfortable with hexadecimal. > > It's a relic from when machines had word sizes

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-11 Thread Marko Rauhamaa
Chris Angelico : > On Fri, May 11, 2018 at 7:10 PM, Gregory Ewing > wrote: >> I suggest adding a new builtin constant: >> >>YouFeelLikeIt = True >> >> Then all pseudo-infinite loops can be written >> >>while YouFeelLikeIt: >> ... >> > > Personally, I prefer to use string literals. >

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

2018-05-11 Thread Marko Rauhamaa
Ben Bacarisse : > bartc writes: >> On 11/05/2018 01:25, Marko Rauhamaa wrote: >>> I think octal is a historical relic from a time when people weren't >>> yet comfortable with hexadecimal. >> >> It's a relic from when machines had word sizes that were multiples of >> three bits, or were divided up

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

2018-05-11 Thread Chris Angelico
On Fri, May 11, 2018 at 8:08 PM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> What do you mean, "another bit"? Currently, the chmod command on my >> system can manage nine primary bits (rwx for each of ugo), plus >> setuid, setgid, and sticky. > > > I think the idea is that you could regroup

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

2018-05-11 Thread Chris Angelico
On Fri, May 11, 2018 at 9:09 PM, bartc wrote: > On 11/05/2018 01:11, Chris Angelico wrote: >> >> On Fri, May 11, 2018 at 8:43 AM, bartc wrote: >>> >>> This is Wrong, and would have been just as obviously wrong in 1989. >> >> >> Having spent many years programming in C and working on Unix, I >> st

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-11 Thread Ian Kelly
On Fri, May 11, 2018 at 1:06 AM, Chris Angelico wrote: > On Fri, May 11, 2018 at 4:54 PM, Ian Kelly wrote: >> On Thu, May 10, 2018 at 11:45 PM, Steven D'Aprano >> wrote: >>> To be honest, I'm having trouble thinking of a good use-case for "while >>> True", now that we have infinite iterators. Mo

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-11 Thread Ian Kelly
On Fri, May 11, 2018 at 1:01 AM, Chris Angelico wrote: > On Fri, May 11, 2018 at 12:38 PM, Ian Kelly wrote: >> Would you also contend that generator functions are wrong because they >> pretend to be normal functions? >> >> def totally_not_a_generator(n): >> while True: >> if n % 2 ==

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-11 Thread Chris Angelico
On Fri, May 11, 2018 at 11:28 PM, Ian Kelly wrote: > You can get rid of the while loop: > > for x in iter(get_item, None): > process(x) > > The reason I suggested the function I did is because the x in that > case can't reasonably be turned into an iterator because the logic > depends on the l

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

2018-05-11 Thread Marko Rauhamaa
Chris Angelico : > On Fri, May 11, 2018 at 8:08 PM, Gregory Ewing > wrote: >> I think the idea is that you could regroup those 4 groups of 3 into 3 >> groups of 4, and get a nice mapping to hex. If hex had been the >> conventional way of writing binary numbers back then, Ken and Dennis >> would p

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-11 Thread Chris Angelico
On Fri, May 11, 2018 at 11:31 PM, Ian Kelly wrote: > On Fri, May 11, 2018 at 1:01 AM, Chris Angelico wrote: >> On Fri, May 11, 2018 at 12:38 PM, Ian Kelly wrote: >>> Would you also contend that generator functions are wrong because they >>> pretend to be normal functions? >>> >>> def totally_not

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

2018-05-11 Thread Grant Edwards
On 2018-05-11, Gene Heskett wrote: > Computers haven't read a single 8 bit byte in years, some reading > 128 or 256 bits in a single read cycle today. Nonsense. All modern CPUs that I'm aware of still still support single byte reads, and compilers still use those instructions when the size of t

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

2018-05-11 Thread Grant Edwards
On 2018-05-11, Dennis Lee Bieber wrote: > On Fri, 11 May 2018 01:55:58 +0100, bartc declaimed the > following: > >>On 11/05/2018 01:25, Marko Rauhamaa wrote: >>> Chris Angelico : >>> Octal makes a lot of sense in the right contexts. >>> >>> I think octal is a historical relic from a time w

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

2018-05-11 Thread Grant Edwards
On 2018-05-11, Steven D'Aprano wrote: > On Fri, 11 May 2018 21:55:17 +1200, Gregory Ewing wrote: > >> Hex came into vogue in the DEC world with the VAX, which was both >> byte-addressed and had a hex-oriented instruction encoding. > > > [...] You had computers with 6, 9, or even 60 bits per byte

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-11 Thread Ian Kelly
On Fri, May 11, 2018 at 7:40 AM, Chris Angelico wrote: > So, yes, your function's name is outright lying. But there's nothing > about it that is *pretending* to be a normal function. It IS a normal > function. The detail of whether it's a generator function affects the function's execution and ma

Re: Passing File Descriptors To Subprocesses

2018-05-11 Thread pevogam
I encountered the same issue with Python 3.4 on CentOS 7 when using only the close_fds argument. Since I am passing a lot of dynamically obtained file descriptors, using the pass_fds argument is impossible for my case. Setting close_fds to False *but* also explicitly making the fds inheritable u

Re: seeking deeper (language theory) reason behind Python design choice

2018-05-11 Thread Chris Angelico
On Sat, May 12, 2018 at 1:03 AM, Ian Kelly wrote: > On Fri, May 11, 2018 at 7:40 AM, Chris Angelico wrote: >> So, yes, your function's name is outright lying. But there's nothing >> about it that is *pretending* to be a normal function. It IS a normal >> function. > > The detail of whether it's a

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

2018-05-11 Thread Jon Ribbens
On 2018-05-11, Grant Edwards wrote: > On 2018-05-11, Gene Heskett wrote: >> Computers haven't read a single 8 bit byte in years, some reading >> 128 or 256 bits in a single read cycle today. > > Nonsense. All modern CPUs that I'm aware of still still support > single byte reads, and compilers st

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

2018-05-11 Thread bartc
On 11/05/2018 14:24, Chris Angelico wrote: On Fri, May 11, 2018 at 9:09 PM, bartc wrote: when 101'11010'000'B then ... Try /that/ in hex /or/ octal.) I've no idea what this is supposed to mean, or why you have groups of three, five, and three. Looks like a possible bug to me. I'm sure

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

2018-05-11 Thread Ian Kelly
On Fri, May 11, 2018 at 12:19 AM, Steven D'Aprano wrote: > On Thu, 10 May 2018 23:23:33 -0600, Ian Kelly wrote: > >> On Thu, May 10, 2018 at 9:21 PM, Steven D'Aprano >> wrote: >>> On Thu, 10 May 2018 11:03:54 -0600, Ian Kelly wrote about proposed >>> prefixes for octal: >>> Personally I woul

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

2018-05-11 Thread Ian Kelly
On Fri, May 11, 2018 at 10:35 AM, Ian Kelly wrote: > On Fri, May 11, 2018 at 12:19 AM, Steven D'Aprano > wrote: >> On Thu, 10 May 2018 23:23:33 -0600, Ian Kelly wrote: >> >>> On Thu, May 10, 2018 at 9:21 PM, Steven D'Aprano >>> wrote: On Thu, 10 May 2018 11:03:54 -0600, Ian Kelly wrote abou

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

2018-05-11 Thread Skip Montanaro
> > And, if it is really necessary to retain > octal, why not preface it with anything BUT a "0". > I believe "0o" offers some symmetry with the "0x" prefix used for hex literals. (And "0b" for binary.) It's a bit unfortunate that zero and capital "oh" are visually so similar. Not much to be done

Re: Passing File Descriptors To Subprocesses

2018-05-11 Thread Terry Reedy
On 5/11/2018 11:23 AM, pevo...@gmail.com wrote: I encountered the same issue with Python 3.4 on CentOS 7 when using only the close_fds argument. Since I am passing a lot of dynamically obtained file descriptors, using the pass_fds argument is impossible for my case. Setting close_fds to False

Re: Suggestion for a "data" object syntax

2018-05-11 Thread Mikhail V
On Fri, May 11, 2018 at 9:12 AM, Ian Kelly wrote: > On Thu, May 10, 2018 at 6:34 PM, Mikhail V wrote: >> On Wed, May 9, 2018 at 6:25 AM, Steven D'Aprano >> wrote: >>> On Tue, 08 May 2018 23:16:23 +0300, Mikhail V wrote: >>> >> but I propose Tab-separated elements. > > Then these are not ord

PIP install

2018-05-11 Thread Sharan Basappa
I have installed Python recently. Do I need to install PIP separately or this would be part of default installation. When I run pip install <>, windows complains that no such command exists -- https://mail.python.org/mailman/listinfo/python-list

Re: Suggestion for a "data" object syntax

2018-05-11 Thread Mikhail V
On Fri, May 11, 2018 at 9:39 AM, Ian Kelly wrote: > On Mon, May 7, 2018 at 9:45 PM, Mikhail V wrote: >> *Example 1. Multi-line strings* >> >> data === S : >> this is multi-line string >> escape chars: same as in strings (\\, \\n, \\t ...) , >> but "no need to 'escape' quotes" > > My

Re: PIP install

2018-05-11 Thread MRAB
On 2018-05-12 03:47, Sharan Basappa wrote: I have installed Python recently. Do I need to install PIP separately or this would be part of default installation. When I run pip install <>, windows complains that no such command exists That means that pip isn't on the Windows search path. It mi

issue runing ipython

2018-05-11 Thread Sharan Basappa
I see an issue while running ipython. Can anyone help please. D:\Users\sharanb>ipython notebook [TerminalIPythonApp] WARNING | Subcommand `ipython notebook` is deprecated and will be removed in future versions. [TerminalIPythonApp] WARNING | You likely want to use `jupyter notebook` in the futur

Re: PIP install

2018-05-11 Thread Sharan Basappa
On Saturday, 12 May 2018 08:32:04 UTC+5:30, MRAB wrote: > On 2018-05-12 03:47, Sharan Basappa wrote: > > I have installed Python recently. Do I need to install PIP separately or > > this would be part of default installation. When I run pip install <>, > > windows complains that no such command

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

2018-05-11 Thread Steven D'Aprano
On Fri, 11 May 2018 16:56:09 +0100, bartc wrote: > 0100, if not intended as octal, is > an undetectable error in C and Python 2. How fortunate then that Python 2 is history (soon to be ancient history) and people can use Python 3 where that error of judgement has been rectified. -- Steve -

Re: issue runing ipython

2018-05-11 Thread Steven D'Aprano
On Fri, 11 May 2018 20:13:08 -0700, Sharan Basappa wrote: > I see an issue while running ipython. Can anyone help please. Is the error message not clear enough? It tells you what the problem is ("ipython notebook" is deprecated) and tells you how to fix it (use "jupyter notebook" instead). >

Re: Suggestion for a "data" object syntax

2018-05-11 Thread Steven D'Aprano
On Sat, 12 May 2018 02:26:05 +0300, Mikhail V wrote: > it is just not a trivial task to find an optimal solution to this We already have an optimal solution to this. * It works with any editor, including simple ones. * It is safe for transmit over email, or on web forums, so long as you av

Re: Meaning of abbreviated terms

2018-05-11 Thread Bob Martin
in 793617 20180511 072806 Steven D'Aprano wrote: >On Fri, 11 May 2018 07:20:36 +, Bob Martin wrote: > >> in 793605 20180511 044309 T Berger wrote: >>>On Saturday, May 5, 2018 at 6:45:46 PM UTC-4, MRAB wrote: >>>> On 2018-05-05 17:57, T Berger wrote: >