Re: lxml - SubElement dump root doesn't dump like Element dump does

2016-06-20 Thread Sayth Renshaw
Thanks your way makes more sense indeed. 

In the example they create and access I think I just got lost in their example. 

Sayth
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: value of pi and 22/7

2016-06-20 Thread Marko Rauhamaa
Lawrence D’Oliveiro :

> On Monday, June 20, 2016 at 10:26:03 AM UTC+12, Gregory Ewing wrote:
>
>> If you're building something the size of a pyramid, that could
>> add up to quite a lot of error.
>
> Particularly since so many of their neighbours had worked out how to
> do much better than that, thousands of years earlier...

Width/height ratio of the pyramid of Cheops was so close to π/2 that UFO
enthusiasts were convinced alien technology was used in the construction
of the pyramids.

The whole story involving cubits, drums and fingers is here: http://doernenburg.alien.de/alternativ/pyramide/pyr12_e.php>.

   This is the definite proof, that no god, astronaut or Atlantean
   wizard had any intention of coding Pi into one of the many pyramids
   erected in Egypt. Pi is simply a result of the measurement methods
   used in old Egypt!


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: best text editor for programming Python on a Mac

2016-06-20 Thread Christian Gollwitzer

Am 20.06.16 um 00:15 schrieb Michael Torrie:

On 06/19/2016 03:21 PM, Quivis wrote:

On Sat, 18 Jun 2016 20:26:36 -0400, Joel Goldstick wrote:


that it is on every linux system


No, it isn't! I can be *installed* on every Linux system, but that a
whole other can of worms.


True vim is not. But vi should be.  I'm not aware of any Linux distro
which does not install it.  Do you know of a distro that does not?


That would be very strange, since vi is mandated by POSIX

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html

Of course there are other options, like elvis or busybox, but unless you 
are building a minimalist POSIX system the most viable option would be 
to install vim. So practically every desktop Linux distro ships with vim.


Christian
--
https://mail.python.org/mailman/listinfo/python-list


Re: best text editor for programming Python on a Mac

2016-06-20 Thread Lawrence D’Oliveiro
On Monday, June 20, 2016 at 10:45:08 AM UTC+12, Gregory Ewing wrote:
>
> Lawrence D’Oliveiro wrote:
>
>> But not vi/vim. It only lets you place your cursor *on* a character, not
>> *in-between* characters.
> 
> That's because the terminals it was designed to work on
> didn't have any way of displaying a cursor between two
> characters.

That’s a dumb excuse. I’ve been using full-screen editors since 1979, on VT52 
and later VT100 and then VT220 terminals, until text-mode terminals became 
obsolete. They all worked the way Emacs does, and vi does not.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-20 Thread Lawrence D’Oliveiro
On Monday, June 20, 2016 at 4:31:00 PM UTC+12, Phil Boutros wrote:
>
> Steven D'Aprano wrote:
>>
>> This is how I write x≠y from scratch:
> 
> 
> To wrap this back full circle, here's how it's done on vim:  
> 
> Ctrl-K, =, ! (last two steps interchangeable).  Done.  Result:  ≠

Standard Linux sequence: compose-slash-equals (or compose-equals-slash). Works 
in every sensible editor, terminal emulator, text-input field in web browsers 
and other GUI apps. In short, everywhere.


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: value of pi and 22/7

2016-06-20 Thread Lawrence D’Oliveiro
On Monday, June 20, 2016 at 7:32:54 PM UTC+12, Marko Rauhamaa wrote:

> Width/height ratio of the pyramid of Cheops was so close to π/2 that UFO
> enthusiasts were convinced alien technology was used in the construction
> of the pyramids.

They were also able to get the bases of the pyramids horizontal to within about 
a centimetre. Amazing achievement, but entirely achievable with bronze-age 
technology.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: lxml - SubElement dump root doesn't dump like Element dump does

2016-06-20 Thread Sayth Renshaw
On Monday, 20 June 2016 16:19:31 UTC+10, Peter Otten  wrote:
> Sayth Renshaw wrote:
> 
> > Afternoon
> > 
> > Wondering has anyone much experience with lxml specifically objectify?
> > 
> > When I pick up a file with lxml and use objectify dumping root works as
> > expected actually better its quite nice. This is how i do it, file
> > handling part left out for brevity.
> > 
> > def getsMeet(file_list):
> > for filename in sorted(file_list):
> > filename=my_dir + filename
> > yield filename
> > 
> > def parseXML():
> > """
> > """
> > for file in getsMeet(file_list):
> > with open(file) as f:
> > xml = f.read()
> > 
> > root = objectify.fromstring(xml)
> > print(root.tag)
> > print(objectify.dump(root))
> > race = objectify.SubElement(root,"race")
> > print(objectify.dump(race))
> > 
> > 
> > parseXML()
> > 
> > So the first call to print(objectify.dump(root)) gives as a sample.
> > 
> > meeting = None [ObjectifiedElement]
> >   * id = '42977'
> >   * barriertrial = '0'
> >   * venue = 'Rosehill Gardens'
> >   * date = '2016-05-21T00:00:00'
> >   * gearchanges = '-1'
> >   * stewardsreport = '-1'
> >   * gearlist = '-1'
> >   * racebook = '0'
> >   * postracestewards = '0'
> >   * meetingtype = 'TAB'
> >   * rail = 'Timing - Electronic : Rail - +6m'
> >   * weather = 'Fine  '
> >   * trackcondition = 'Good 3'
> >   * nomsdeadline = '2016-05-16T11:00:00'
> >   * weightsdeadline = '2016-05-17T16:00:00'
> >   * acceptdeadline = '2016-05-18T09:00:00'
> >   * jockeydeadline = '2016-05-18T12:00:00'
> > club = '' [StringElement]
> >   * abbrevname = 'Australian Turf Club'
> >   * code = '56398'
> >   * associationclass = '1'
> >   * website = 'http://'
> > race = None [ObjectifiedElement]
> >   * id = '215411'
> >   * number = '1'
> >   * nomnumber = '9'
> > 
> > Then I am confused when I want to repeat this but only for the subelement
> > race I get a return but not as expected.
> > 
> > This is my return
> > race = '' [StringElement]
> > 
> > so why do i not get all the elements of race as I do when i dump the root?
> 
> Because race is a new SubElement that you just created:
> 
> >>> help(lxml.objectify.SubElement)
> Help on built-in function SubElement in module lxml.etree:
> 
> SubElement(...)
> SubElement(_parent, _tag, attrib=None, nsmap=None, **_extra)
> 
> Subelement factory.  This function creates an element instance, and
> appends it to an existing element.
> 
> >>>
> 
> Existing subelements can be accessed as attributes. I'd say that's the very 
> point of the lxml.objectify library ;)
> 
> For example:
> 
> >>> root = 
> lxml.objectify.fromstring("onetwosecond 
> b")
> >>> print(lxml.objectify.dump(root.b))
> b = None [ObjectifiedElement]
> c = 'one' [StringElement]
> d = 'two' [StringElement]
> >>> print(lxml.objectify.dump(root.b[0]))
> b = None [ObjectifiedElement]
> c = 'one' [StringElement]
> d = 'two' [StringElement]
> >>> print(lxml.objectify.dump(root.b[1]))
> b = 'second b' [StringElement]
> 

this actually seems quite powerful, I don't fully understand it yet though it 
seems I have just got an XML doc as a list of dicts so I can just slice and 
select as normal python.

thanks for helping

Sayth
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: best text editor for programming Python on a Mac

2016-06-20 Thread alister
On Sun, 19 Jun 2016 07:23:15 -0600, Michael Torrie wrote:

> On 06/19/2016 01:34 AM, Lawrence D’Oliveiro wrote:
>> On Sunday, June 19, 2016 at 7:13:26 PM UTC+12, Christian Gollwitzer
>> wrote:
>> 
>>> Am 19.06.16 um 02:12 schrieb Lawrence D’Oliveiro:
>>>
 But not vi/vim. It only lets you place your cursor *on* a character,
 not *in-between* characters.
>>>
>>> This is true if you use the text-mode version. I prefer gvim (actually
>>> macvim on the mac) which feels much more like a modern editor.
>> 
>> Why not just use a modern editor, and be done with it?
> 
> Why would you even suggest this to a vim user?  What's your point?  If
> you're not a vim user then you have no idea how vim benefits the person
> who is proficient in it and enjoys using it. There are many reasons to
> use vim.  Since you're not really interested in these reasons I won't
> bother re-stating them here.  I'm sure there are reasons you prefer a
> "modern editor" also.
> 
> I can argue all day long about how arcane emacs is, and argue how
> wodnerful vim is, but I could never in seriousness suggest to an emacs
> user that he'd be better off using vim or a "modern editor."  Nor should
> you.

indeed

The only thing EMACS lacks is a good text editor.

Vi has two modes "beep repeatedly" and "break Everything"

Although both the editors are extremely powerful they both suffer from 
over design.
 




-- 
If at first you don't succeed, you are running about average.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-20 Thread Steven D'Aprano
On Monday 20 June 2016 17:57, Lawrence D’Oliveiro wrote:

> On Monday, June 20, 2016 at 4:31:00 PM UTC+12, Phil Boutros wrote:
>>
>> Steven D'Aprano wrote:
>>>
>>> This is how I write x≠y from scratch:
>> 
>> 
>> To wrap this back full circle, here's how it's done on vim:
>> 
>> Ctrl-K, =, ! (last two steps interchangeable).  Done.  Result:  ≠
> 
> Standard Linux sequence: compose-slash-equals (or compose-equals-slash).
> Works in every sensible editor, terminal emulator, text-input field in web
> browsers and other GUI apps. In short, everywhere.

Everywhere compose is configured the way you expect.


> 

Nice link, thank you, although missing a few things. Like how to query which 
key is the compose key, and how to specify a key other than CapsLock. But 
there's always Google, I suppose.

According to that link: "By default this function is not assigned to any key."

So... not so much "everywhere" as "by default, nowhere".


-- 
Steve

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the global keyword:

2016-06-20 Thread BartC

On 19/06/2016 18:16, Joel Goldstick wrote:


People who understand global variables generally avoid using them at
all costs.


Then perhaps they don't understand that in Python, top-level functions, 
classes and imports are also globals.


--
Bartc
--
https://mail.python.org/mailman/listinfo/python-list


Re: the global keyword:

2016-06-20 Thread Antoon Pardon
Op 19-06-16 om 23:20 schreef BartC:
> On 19/06/2016 15:35, Antoon Pardon wrote:
>> Op 12-06-16 om 23:10 schreef BartC:
>>> On 12/06/2016 20:25, Ned Batchelder wrote:
   Just as here there is no link between x
 and y:

 x = 12
 y = x
>>>
>>> (And that's a good illustration of why 'y' isn't a name reference to
>>> 'x', referring to the "...ducks limp" thread. But best not to rake
>>> it up again...)
>>>
>> I find this rather inaccurate reference to what your opposition is
>> supposed to have states together with the remark best not to rake
>> this up again, rather disingenuous
>>
>
>
> Sorry, haven't been able to parse that.
>
> What is inaccurate? What am I supposed to be opposed to? And why is it
> disingenuous? The original thread is still open to posts AFAIK if
> someone wants to discuss it further.

You are denying a position above. So you oppose the position being denied.
However noone defended the position you denied. So denying a position here
and thus suggesting there are people who defend that position is inaccurate.

And it is disingenuous to inaccurately mention others people's position and
then to try to screen yourself off from reactions by ending with: "Best not
to rake it up again."

-- 
Antoon Pardon 


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the global keyword:

2016-06-20 Thread Steven D'Aprano
On Mon, 20 Jun 2016 08:21 pm, BartC wrote:

> On 19/06/2016 18:16, Joel Goldstick wrote:
> 
>> People who understand global variables generally avoid using them at
>> all costs.
> 
> Then perhaps they don't understand that in Python, top-level functions,
> classes and imports are also globals.

But not global *variables*. They are generally used as per-module global
*constants*, or at least near-constants.



-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the global keyword:

2016-06-20 Thread Steven D'Aprano
On Mon, 20 Jun 2016 09:14 pm, Antoon Pardon wrote:

> Op 19-06-16 om 23:20 schreef BartC:
>> On 19/06/2016 15:35, Antoon Pardon wrote:
>>> Op 12-06-16 om 23:10 schreef BartC:
 On 12/06/2016 20:25, Ned Batchelder wrote:
>   Just as here there is no link between x
> and y:
>
> x = 12
> y = x

 (And that's a good illustration of why 'y' isn't a name reference to
 'x', referring to the "...ducks limp" thread. But best not to rake
 it up again...)

>>> I find this rather inaccurate reference to what your opposition is
>>> supposed to have states together with the remark best not to rake
>>> this up again, rather disingenuous
>>>
>>
>>
>> Sorry, haven't been able to parse that.
>>
>> What is inaccurate? What am I supposed to be opposed to? And why is it
>> disingenuous? The original thread is still open to posts AFAIK if
>> someone wants to discuss it further.
> 
> You are denying a position above. So you oppose the position being denied.
> However noone defended the position you denied. 

I'm sorry Antoon, Bart only paid for the ten minute argument.

Bart didn't say anyone had defended it. He made an observation:

"that's a good illustration of why 'y' isn't a name reference to 'x'"

which is factually correct. And this does refer to the "ducks limp" thread.
Nothing he said was wrong or objectionable, and he didn't imply that anyone
was taking the opposite position.


> So denying a position here 
> and thus suggesting there are people who defend that position is
> inaccurate.

There's no "and thus" here. Sometimes people make observations and share
them with the group. You'll notice that I'm taking a position here, but I'm
not accusing you or anyone else of taking the contrary position
(namely "nobody ever makes observations and shares them with the group").


> And it is disingenuous to inaccurately mention others people's position

Bart did not mention anyone's position, accurately or inaccurately.


> and then to try to screen yourself off from reactions by ending with:
> "Best not to rake it up again."


-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the global keyword:

2016-06-20 Thread Antoon Pardon
Op 20-06-16 om 14:15 schreef Steven D'Aprano:
> On Mon, 20 Jun 2016 09:14 pm, Antoon Pardon wrote:
>
>> Op 19-06-16 om 23:20 schreef BartC:
>>> On 19/06/2016 15:35, Antoon Pardon wrote:
 Op 12-06-16 om 23:10 schreef BartC:
> On 12/06/2016 20:25, Ned Batchelder wrote:
>>   Just as here there is no link between x
>> and y:
>>
>> x = 12
>> y = x
> (And that's a good illustration of why 'y' isn't a name reference to
> 'x', referring to the "...ducks limp" thread. But best not to rake
> it up again...)
>
 I find this rather inaccurate reference to what your opposition is
 supposed to have states together with the remark best not to rake
 this up again, rather disingenuous

>>>
>>> Sorry, haven't been able to parse that.
>>>
>>> What is inaccurate? What am I supposed to be opposed to? And why is it
>>> disingenuous? The original thread is still open to posts AFAIK if
>>> someone wants to discuss it further.
>> You are denying a position above. So you oppose the position being denied.
>> However noone defended the position you denied. 
> I'm sorry Antoon, Bart only paid for the ten minute argument.
>
> Bart didn't say anyone had defended it. He made an observation:
>
> "that's a good illustration of why 'y' isn't a name reference to 'x'"
>
> which is factually correct. And this does refer to the "ducks limp" thread.
> Nothing he said was wrong or objectionable, and he didn't imply that anyone
> was taking the opposite position.

If you mean the literal logical implication you are correct. But there is
of course also the implicature. And his ending with "Best not to rake this
up again" is a strong indication he was aware of the implicature.

Because why is there a need to mention that one thing is a good illustration
of something not being the case, unless people have been stating the opposite?
Why should he be raking things up, if he is not stating something that is
opposed by others?

-- 
Antoon.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: best text editor for programming Python on a Mac

2016-06-20 Thread Random832
On Sun, Jun 19, 2016, at 18:44, Gregory Ewing wrote:
> Lawrence D’Oliveiro wrote:
> > But not vi/vim. It only lets you place your cursor *on* a character, not
> > *in-between* characters.
> 
> That's because the terminals it was designed to work on
> didn't have any way of displaying a cursor between two
> characters. Emacs is the same (except it doesn't go as
> far as having two different insertion modes -- you just
> think of the insertion point as being to the left of
> the character that the cursor is on).

So, basically, Emacs is *not* the same. The point is that in vim you
can't position the normal-mode cursor in such a way that inserted
characters are inserted at the end of the line. How the cursor is
displayed has nothing to do with it.

And, insertion is to the left of the character that the cursor is on in
vim, too. That's why the "a" command moves the cursor.

> I would say that's about the *least* weird thing about
> vi[m] though... :-(
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the global keyword:

2016-06-20 Thread Random832
On Mon, Jun 20, 2016, at 08:15, Steven D'Aprano wrote:
> Bart didn't say anyone had defended it. He made an observation:
> 
> "that's a good illustration of why 'y' isn't a name reference to 'x'"
> 
> which is factually correct. And this does refer to the "ducks limp"
> thread.

Except it doesn't. Because no-one on that thread made the claim that it
is. There's absolutely nothing in the thread (except maybe earlier
instances of him and you misrepresenting others' claims) about 'y' being
a name reference to 'x', so there's nothing in that thread for it to
reasonably refer to.

> Nothing he said was wrong or objectionable, and he didn't imply that
> anyone was taking the opposite position.

Nonsense.
-- 
https://mail.python.org/mailman/listinfo/python-list


EuroPython 2016: Conference Dinner and Party - Tickets available

2016-06-20 Thread M.-A. Lemburg
We all know that good food, drinks and music are essential for a
perfect EuroPython conference and so we’ve arranged a nice dinner with
local food and a party for Tuesday evening (July 19th).


*** EuroPython Conference Dinner and Party ***

 https://ep2016.europython.eu/en/events/social-event/


If you want to join the fun, please go to the social event page, and
then proceed to the registration form (the same you use to buy
conference tickets).

There’s a new entry available now called “Pyntxos Social Event” which
you can order using the form. Leave the conference tickets fields
blank if you only want to purchase social event tickets.


   *** Buy Social Event Tickets ***

https://ep2016.europython.eu/p3/cart/


We have 550 tickets available for the conference dinner and party, so
please book early. The tickets are valid for one person. Please see
the social events page for details of what is included in the ticket
price.


With gravitational regards,
--
EuroPython 2016 Team
http://ep2016.europython.eu/
http://www.europython-society.org/


PS: Please forward or retweet to help us reach all interested parties:
https://twitter.com/europython/status/744884976940945408
Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: best text editor for programming Python on a Mac

2016-06-20 Thread Christian Gollwitzer

Am 20.06.16 um 15:26 schrieb Random832:

The point is that in vim you
can't position the normal-mode cursor in such a way that inserted
characters are inserted at the end of the line.


But you can press i at the end of the line, then arrow-right, which 
positions the cursor over the empty space after the line, and type. Try 
it. In vim this works, because vim understands cursor keys. In original 
vi not (there were no cursor keys on the old terminals). Usually, when 
editing in vim, you don't leave the insert mode because you can use the 
"special" keys as well as mouse actions to perform usual editing tasks. 
Leaving insert mode is only necessary to run a command.


Christian


--
https://mail.python.org/mailman/listinfo/python-list


Re: best text editor for programming Python on a Mac

2016-06-20 Thread Rustom Mody
On Monday, June 20, 2016 at 7:06:57 PM UTC+5:30, Christian Gollwitzer wrote:
> Am 20.06.16 um 15:26 schrieb Random832:
> > The point is that in vim you
> > can't position the normal-mode cursor in such a way that inserted
> > characters are inserted at the end of the line.
> 
> But you can press i at the end of the line, then arrow-right, which 
> positions the cursor over the empty space after the line, and type. Try 
> it. In vim this works, because vim understands cursor keys. In original 
> vi not (there were no cursor keys on the old terminals). Usually, when 
> editing in vim, you don't leave the insert mode because you can use the 
> "special" keys as well as mouse actions to perform usual editing tasks. 
> Leaving insert mode is only necessary to run a command.

True and false (if one allows for vi = vim)

In the default vi that comes with ubuntu (vi-tiny??)
giving a arrow in insert mode enters all kinds of (control?) garbage.

In (full) vim I guess its true 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-20 Thread Rustom Mody
On Monday, June 20, 2016 at 11:34:36 AM UTC+5:30, Random832 wrote:
> On Mon, Jun 20, 2016, at 01:03, Rustom Mody wrote:
> > > Ctrl-K, =, ! (last two steps interchangeable).  Done.  Result:  ≠
> > 
> > Are these 'shortcuts' parameterizable?
> 
> They originate from RFC 1345, with the extension that they can be
> reversed if the reverse doesn't itself exist as a RFC 1345 combination.

Thanks!
Useful reference even though old
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: best text editor for programming Python on a Mac

2016-06-20 Thread Christian Gollwitzer

Am 20.06.16 um 15:48 schrieb Rustom Mody:

On Monday, June 20, 2016 at 7:06:57 PM UTC+5:30, Christian Gollwitzer wrote:

Am 20.06.16 um 15:26 schrieb Random832:

The point is that in vim you
can't position the normal-mode cursor in such a way that inserted
characters are inserted at the end of the line.


But you can press i at the end of the line, then arrow-right, which
positions the cursor over the empty space after the line, and type. Try
it. In vim this works, because vim understands cursor keys. In original
vi not (there were no cursor keys on the old terminals). Usually, when
editing in vim, you don't leave the insert mode because you can use the
"special" keys as well as mouse actions to perform usual editing tasks.
Leaving insert mode is only necessary to run a command.


True and false (if one allows for vi = vim)


He wrote "in vim", which I assumed was on purpose.


In the default vi that comes with ubuntu (vi-tiny??)
giving a arrow in insert mode enters all kinds of (control?) garbage.


Yes I know this crappy behaviour which has no place on a current 
desktop. Maybe it is just a setting? Try ":set nocompatible" which 
should turn on standard edit keys, if this is really a vim variant and 
not something else like elvis.



In (full) vim I guess its true


Definitely. I wouldn't use an editor which requires me to learn special 
commands that are available as standard keys on a modern keyboard.


Christian

--
https://mail.python.org/mailman/listinfo/python-list


Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-20 Thread Grant Edwards
On 2016-06-20, Phil Boutros  wrote:
> Steven D'Aprano  wrote:
>>
>> Quote:
>>
>> "Why do we have to write x!=y then argue about the status of x<>y when we
>> can simply write x≠y?"
>>
>> "Simply"?
>>
>> This is how I write x≠y from scratch:
>
>
> To wrap this back full circle, here's how it's done on vim:  
>
> Ctrl-K, =, ! (last two steps interchangeable).  Done.  Result:  ≠

On any non-broken X11 system it's:  = /

I generally configure my system so that the right-hand "windows" key
is .  If I used it a lot, I'd probably configure the left
hand one to be the same.

> It's still probably a horrible idea to have it in a programming
> language, though, unless the original behaviour still also works.

Definitely.  And we should allow overbar for logical inversion.  I
never did figure out the X11 compose sequence for the XOR symbol...

-- 
Grant Edwards   grant.b.edwardsYow! Somewhere in DOWNTOWN
  at   BURBANK a prostitute is
  gmail.comOVERCOOKING a LAMB CHOP!!

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: the global keyword:

2016-06-20 Thread Steven D'Aprano
On Mon, 20 Jun 2016 11:29 pm, Random832 wrote:

> On Mon, Jun 20, 2016, at 08:15, Steven D'Aprano wrote:
>> Bart didn't say anyone had defended it. He made an observation:
>> 
>> "that's a good illustration of why 'y' isn't a name reference to 'x'"
>> 
>> which is factually correct. And this does refer to the "ducks limp"
>> thread.
> 
> Except it doesn't. Because no-one on that thread made the claim that it
> is. There's absolutely nothing in the thread (except maybe earlier
> instances of him and you misrepresenting others' claims) about 'y' being
> a name reference to 'x', so there's nothing in that thread for it to
> reasonably refer to.

The thread is a discussion about name binding and references. And what do
you know, the hypothetical "name y is a reference to name x" is, amazingly,
about name binding and references! Hence the connection between the two.

You know, there's not actually a rule or law that says you have to
automatically take the contrary position to everything I say.




-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-20 Thread Steven D'Aprano
On Tue, 21 Jun 2016 12:23 am, Grant Edwards wrote:

> On 2016-06-20, Phil Boutros  wrote:
[...]
>> Ctrl-K, =, ! (last two steps interchangeable).  Done.  Result:  ≠
> 
> On any non-broken X11 system it's:  = /

Nope, doesn't work for me. I guess I've got a "broken" X11 system.

Oh, I did learn one thing, thanks to Lawrence's earlier link: the compose
key behaves as a dead-key, not a modifier.



-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-20 Thread Rustom Mody
On Monday, June 20, 2016 at 8:30:25 PM UTC+5:30, Steven D'Aprano wrote:
> On Tue, 21 Jun 2016 12:23 am, Grant Edwards wrote:
> 
> > On 2016-06-20, Phil Boutros  wrote:
> [...]
> >> Ctrl-K, =, ! (last two steps interchangeable).  Done.  Result:  ≠
> > 
> > On any non-broken X11 system it's:  = /
> 
> Nope, doesn't work for me. I guess I've got a "broken" X11 system.
> 
> Oh, I did learn one thing, thanks to Lawrence's earlier link: the compose
> key behaves as a dead-key, not a modifier.
> 

You need to say something like
$ setxkbmap  -option compose:menu

then the windows menu key becomes the compose key
Or
$ setxkbmap  -option compose:ralt

then its the right-alt

You can check whats currently the state of xkb with
$ setxkbmap -print

And you can clean up with a bare
$ setkkb -option

else these options 'pile-up' as a  -print would show
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: value of pi and 22/7

2016-06-20 Thread Ian Kelly
On Mon, Jun 20, 2016 at 12:22 AM, Steven D'Aprano
 wrote:
> There's a difference though. Nobody has tried to legislate the value of pi to
> match your casual reference to "about 1900 square feet", but there's been at
> least one serious attempt to legislate the value of pi to match the implied
> value given by the Bible.

If you're referring the Indiana Pi Bill of 1897, it was actually a
poorly conceived attempt to publish an amateur mathematician's claim
of a way to square the circle. It had nothing to do with biblical
interpretation and would have implied a value for pi of 3.2, not 3.

https://en.wikipedia.org/wiki/Indiana_Pi_Bill

I'm not aware of any other such legislative attempts. Snopes records
one that allegedly occurred in Indiana but dismisses the claim as
false.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: value of pi and 22/7

2016-06-20 Thread Ian Kelly
On Mon, Jun 20, 2016 at 10:01 AM, Ian Kelly  wrote:
> I'm not aware of any other such legislative attempts. Snopes records
> one that allegedly occurred in Indiana but dismisses the claim as
> false.

s/Indiana/Alabama
-- 
https://mail.python.org/mailman/listinfo/python-list


sublime text interpreter not showing output

2016-06-20 Thread Marie Nganele
hi. I'm new to python and trying to work with simple letter strings and the 
print command in my first python lessons. However, in my sublime text editor 
nothing but the time it takes to complete the build shows up, and sometimes not 
even that updates. 
How can I configure sublime text so that it shows me the output and execution 
time in my interpreter? 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: value of pi and 22/7

2016-06-20 Thread Grant Edwards
On 2016-06-19, Gregory Ewing  wrote:
> Lawrence D’Oliveiro wrote:
>
>> I feel a new phrase coming on: “good enough for Bible work”!
>
> I understand there's a passage in the Bible somewhere that
> uses a 1 significant digit approximation to pi...

A lot of the time, 3 is a good-enough approximation of π (it's less
than 5% off). Yesterday I needed to know if the globe on a light
fixture was 5", 6", or 7" diameter.  Measure the circumference with a
tape, divide by 3, and Bob's your uncle.  Of course if you have to do
that very often, you just by a diameter tape. :)

-- 
Grant Edwards   grant.b.edwardsYow! I think I am an
  at   overnight sensation right
  gmail.comnow!!

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: value of pi and 22/7

2016-06-20 Thread Grant Edwards
On 2016-06-20, Steven D'Aprano  wrote:

> One of the most underrated yet critical functions of government is
> to standardise weights and measures, and that function evolved very
> slowly over time. I doubt that the Egyptian Pharoahs cared about it,

Oh, I bet they did.  How you measure things affects how much tax you
collect -- and the people at the top of every government pay a lot of
attention to that.  The state doesn't check all those gas pumps
against a volumetric flask every year to protect Joe Carowner.  I've
designed various sorts of measurement and instrumentation, and when a
device is used for doing a measurement that affects how much tax gets
paid, things get deadly serious.

> although their scribes probably did, a bit.

-- 
Grant Edwards   grant.b.edwardsYow! Vote for ME -- I'm
  at   well-tapered, half-cocked,
  gmail.comill-conceived and
   TAX-DEFERRED!

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: value of pi and 22/7

2016-06-20 Thread Marko Rauhamaa
Gregory Ewing :

> Lawrence D’Oliveiro wrote:
>
>> I feel a new phrase coming on: “good enough for Bible work”!
>
> I understand there's a passage in the Bible somewhere that
> uses a 1 significant digit approximation to pi...

Yes:

   And he made a molten sea, ten cubits from the one brim to the other:
   it was round all about, and his height was five cubits: and a line of
   thirty cubits did compass it round about. [1 Kings 7:23]

This and other entertaining stories in:

   https://www.amazon.com/History-PI-Beckmann/dp/B004XYXQ96>


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: value of pi and 22/7

2016-06-20 Thread Wildman via Python-list
On Mon, 20 Jun 2016 01:01:21 -0700, Lawrence D’Oliveiro wrote:

> On Monday, June 20, 2016 at 7:32:54 PM UTC+12, Marko Rauhamaa wrote:
> 
>> Width/height ratio of the pyramid of Cheops was so close to π/2 that UFO
>> enthusiasts were convinced alien technology was used in the construction
>> of the pyramids.
> 
> They were also able to get the bases of the pyramids horizontal
> to within about a centimetre. Amazing achievement, but entirely
> achievable with bronze-age technology.

I am not convinced on any of the theories on how the pyramids
were built, or any other of the monolithic sites.  But, I am
in awe as to the fact that it was actually done.  Just look
at the numbers for the Great Pyramid.  It is believed that it
took 23 years for construction.  It is estimated that there
are somewhere between 2.0 to 2.4 million stones.  I will use
2.0 million for the math...

23 * 365.25 * 24 * 60 / 200 = 6.04854

As you can see, a stone had to be cut, transported and put in
place every 6 minutes 24 hours a day for 23 years.  And if
the stone count was actually 2.4 million, the time would be
reduced to 5 minutes per stone.  All I can say is wow!

Another example is the fact that some ancient Central American
cultures were able to lift and transport stones weighing up
to 300 tons.  We would have a very hard time doing that today
with our modern machinery.

I'm not trying to say that ET or $DIETY did it.  I'm just
point out the fact that something amazing was done.  I
keep an open mind to any possibility.  Right now there
is no actual proof to support any theory.

-- 
 GNU/Linux user #557453
"Be at war with your vices, at peace with your neighbors,
and let every new year find you a better man."
  -Benjamin Franklin
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: value of pi and 22/7

2016-06-20 Thread Marko Rauhamaa
Wildman :

> As you can see, a stone had to be cut, transported and put in place
> every 6 minutes 24 hours a day for 23 years. And if the stone count
> was actually 2.4 million, the time would be reduced to 5 minutes per
> stone. All I can say is wow!

It probably means mostly that the Nile produced enough grain to feed a
lot more people than were needed to till the land. Feudal ownership
produced public works and a working economy. Nowadays, very few people
are needed to till the land, but so far the farmers have been content
with the amenities and gadgets provided by the industry.

It has somewhat similarly been shown how the slave trade of the 17th
century was generated by maize, which was introduced to West Africa. The
soil produced vastly more people, which the local warlords sold to
European slave traders.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


Re - bug in tokenize module

2016-06-20 Thread Harrison Chudleigh
Sorry. Only works with text files. But my point is still valid.
***
This message is intended for the addressee named and may contain privileged 
information or confidential information or both. If you are not the intended 
recipient please delete it and notify the sender.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Re - bug in tokenize module

2016-06-20 Thread Steven D'Aprano
On Tue, 21 Jun 2016 09:01 am, Harrison Chudleigh wrote:

> Sorry. Only works with text files. But my point is still valid.

What point?

Without context, how are we supposed to know what you're talking about?
We're not mind-readers you know.



-- 
Steven

-- 
https://mail.python.org/mailman/listinfo/python-list