Re: A question on modification of a list via a function invocation

2017-09-05 Thread Steven D'Aprano
On Wed, 06 Sep 2017 01:04:17 +0300, Marko Rauhamaa wrote: > Chris Angelico : > >> That shows that the Java '==' operator is like the Python 'is' >> operator, and checks for object identity. You haven't manipulated >> pointers at all. In contrast, here's a C program that actually >> MANIPULATES po

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Steven D'Aprano
On Tue, 05 Sep 2017 21:17:30 -0700, Rustom Mody wrote: > Sure you can say with Steven that this can be 'explained' by saying an > object can be in two places at one time. > Others would then say 'Humpty-dumpty!' since you have removed the most > basic intuition of objects and you are in effect say

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Steven D'Aprano
On Wed, 06 Sep 2017 03:42:31 +, Stefan Ram wrote: > Well, this /is/ from the PRL: > > »An object's identity never changes once it has been created; > you may think of it as the object's address in memory.«. > ¯¯ > - Th

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Marko Rauhamaa
Rustom Mody : > On Wednesday, September 6, 2017 at 3:34:41 AM UTC+5:30, Marko Rauhamaa wrote: >> Pointer arithmetics is not an essential part of C. One could argue that >> it was a mistake to include it in the language. > > This is subjective of course… but still I wonder where you are coming from

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-05 Thread Steven D'Aprano
On Tue, 05 Sep 2017 19:07:32 -0700, Rustom Mody wrote: > Also noteworthy here: You know more about list comprehensions than their > inventor — Greg Ewing And many people know more about General Relativity than Albert Einstein. What's your point? > [No I normally would not call Greg their inve

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-05 Thread Steven D'Aprano
On Wed, 06 Sep 2017 01:31:56 +, Stefan Ram wrote: > Steve D'Aprano writes: >>On Wed, 6 Sep 2017 12:19 am, Rustom Mody wrote: >>>And how do you write even the simplest assignment statement without a >>>(mathematical) expression on the rhs? >>name = other_name is not a mathematical expression.

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-05 Thread Steven D'Aprano
On Tue, 05 Sep 2017 18:28:02 -0700, Rustom Mody wrote: > On Wednesday, September 6, 2017 at 6:27:24 AM UTC+5:30, Steve D'Aprano > wrote: >> On Wed, 6 Sep 2017 12:19 am, Rustom Mody wrote: >> >> > And how do you write even the simplest assignment statement without a >> > (mathematical) expression

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Rustom Mody
On Wednesday, September 6, 2017 at 9:55:10 AM UTC+5:30, Chris Angelico wrote: > On Wed, Sep 6, 2017 at 2:17 PM, Rustom Mody wrote: > > Well ⅓ the point of pointers may be printing them out — which even in a > > language > > with 1st class pointers like C is rarely done/needed > > But still the us

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Chris Angelico
On Wed, Sep 6, 2017 at 2:17 PM, Rustom Mody wrote: > Well ⅓ the point of pointers may be printing them out — which even in a > language > with 1st class pointers like C is rarely done/needed But still the useless part. You don't actually *achieve* anything by printing out the pointer. > Another

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Rustom Mody
On Wednesday, September 6, 2017 at 9:22:15 AM UTC+5:30, Chris Angelico wrote: > On Wed, Sep 6, 2017 at 1:42 PM, Stefan Ram wrote: > > Steve D'Aprano writes: > >>So in what sense are references part of the Python language? > > > > It would be possible to describe Python using a concept > > calle

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Chris Angelico
On Wed, Sep 6, 2017 at 1:42 PM, Stefan Ram wrote: > Steve D'Aprano writes: >>So in what sense are references part of the Python language? > > It would be possible to describe Python using a concept > called "reference", it's just that the The Python Language > Reference, Release 3.6.0 (PRL)

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Steve D'Aprano
On Tue, 5 Sep 2017 11:11 pm, Gregory Ewing wrote: > Steve D'Aprano wrote: >> The third entity is the reference linking the name to the object (the arrow). >> This isn't a runtime value in Python, nor is it a compile time entity that >> exists in source code. It is pure implementation, and as such,

Re: Run Windows commands from Python console

2017-09-05 Thread Rick Johnson
Terry Reedy wrote: > Rick Johnson wrote: [...] > > When i'm away from an editor (like IDLE, for instance), > > one of the features i miss most is the ability to right > > click the line of the exception message (you know, the one > > that includes the offending line number and offending > > scri

Re: How do I find what kind of exception is thrown.

2017-09-05 Thread Paul Rubin
Antoon Pardon writes: > Now I found the following in the logs: [Errno 131] Connection reset by peer > This is a problem I would like to catch earlier I'd expect that's an IOError thrown by the socket library. You could just let it go uncaught and see what you get in the crash dump. -- https://

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-05 Thread Rustom Mody
On Wednesday, September 6, 2017 at 6:58:29 AM UTC+5:30, Rustom Mody wrote: > On Wednesday, September 6, 2017 at 6:27:24 AM UTC+5:30, Steve D'Aprano wrote: > > On Wed, 6 Sep 2017 12:19 am, Rustom Mody wrote: > > > What were Turing, Church, von Neumann, even Knuth by training? > > > Mathematicians >

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-05 Thread Ben Finney
r...@zedat.fu-berlin.de (Stefan Ram) writes: > In mathematics, every author is free to give his own > definitions to concepts and create his own notation. In one trivial sense that is true. Anyone can define any term to mean whatever they like. This is a perfectly sherbert thing to do. In a

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-05 Thread Rustom Mody
On Wednesday, September 6, 2017 at 6:27:24 AM UTC+5:30, Steve D'Aprano wrote: > On Wed, 6 Sep 2017 12:19 am, Rustom Mody wrote: > > > And how do you write even the simplest assignment statement without a > > (mathematical) expression on the rhs? > > name = other_name > > is not a mathematical ex

Re: Case-insensitive string equality

2017-09-05 Thread Steve D'Aprano
On Wed, 6 Sep 2017 12:27 am, Grant Edwards wrote: > On 2017-09-03, Gregory Ewing wrote: >> Stefan Ram wrote: >>> But of >>> course, actually the rules of orthography require "Maße" or >>> "Masse" and do not allow "MASSE" or "MASZE", just as in >>> English, "English" has to be written "Eng

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Rustom Mody
On Wednesday, September 6, 2017 at 3:34:41 AM UTC+5:30, Marko Rauhamaa wrote: > Chris Angelico : > > > That shows that the Java '==' operator is like the Python 'is' > > operator, and checks for object identity. You haven't manipulated > > pointers at all. In contrast, here's a C program that actu

Re: bussiness python

2017-09-05 Thread MRAB
On 2017-09-06 01:40, timetowalk wrote: On Tuesday, September 5, 2017 at 8:28:00 PM UTC-4, MRAB wrote: On 2017-09-05 22:21, jessicayate...@gmail.com wrote: > Here's a code that I have, i'm getting an error in line 5 and i'm not sure why, > > > # future value of annuity > p = 1000 > r = 2/100

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-05 Thread Steve D'Aprano
On Wed, 6 Sep 2017 12:19 am, Rustom Mody wrote: > And how do you write even the simplest assignment statement without a > (mathematical) expression on the rhs? name = other_name is not a mathematical expression. Its giving something a new name. name = obj.attribute is not a mathematical expres

Re: bussiness python

2017-09-05 Thread timetowalk
On Tuesday, September 5, 2017 at 8:28:00 PM UTC-4, MRAB wrote: > On 2017-09-05 22:21, jessicayate...@gmail.com wrote: > > Here's a code that I have, i'm getting an error in line 5 and i'm not sure > > why, > > > > > > # future value of annuity > > p = 1000 > > r = 2/100 > > n = 5 > > FV= p * ((1

Re: bussiness python

2017-09-05 Thread MRAB
On 2017-09-05 22:21, jessicayate...@gmail.com wrote: Here's a code that I have, i'm getting an error in line 5 and i'm not sure why, # future value of annuity p = 1000 r = 2/100 n = 5 FV= p * ((1+r) ** n - 1/r) print(FV) [snip] the output is supposed to be 5204.040160005 [snip] Your

Re: How do I find what kind of exception is thrown.

2017-09-05 Thread Ben Finney
Antoon Pardon writes: > Python 2.6.4 on a solaris box. > > I have a program in which all kind of excptions can be thrown and caugth. > The main program is something like below: > > try: > do_stuff > except Exception: > log unexpected trouble You're throwing away the exception object, wit

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Grant Edwards
On 2017-09-05, Marko Rauhamaa wrote: > Pointer arithmetics is not an essential part of C. One could argue that > it was a mistake to include it in the language. One may argue that it was a mistake, but I remember at least one implementation where pointer arithmetic was hugely more efficient than

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Marko Rauhamaa
Chris Angelico : > That shows that the Java '==' operator is like the Python 'is' > operator, and checks for object identity. You haven't manipulated > pointers at all. In contrast, here's a C program that actually > MANIPULATES pointers: > > [...] > > You can't do this with Python, since pointer

bussiness python

2017-09-05 Thread jessicayates59
Here's a code that I have, i'm getting an error in line 5 and i'm not sure why, # future value of annuity p = 1000 r = 2/100 n = 5 FV= p * ((1+r) ** n - 1/r) print(FV) #FV of annuity- continuous compounding CF= 1000 r = 6/100/12 t = 12 import math FV= CF * ((1 + (r/n)) ** (n*t)) print (FV) #A

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Chris Angelico
On Wed, Sep 6, 2017 at 6:42 AM, Stefan Ram wrote: > Chris Angelico writes: >>here's a C program that actually MANIPULATES pointers: > ... >>x += 2; > ... >>You can in C. Can you in Java? > > »dog = null« in Java would correspond to »x = 0« in C. > > It seems, to you, an assignment of »x + 2«

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Chris Angelico
On Wed, Sep 6, 2017 at 5:48 AM, Stefan Ram wrote: > Depends on the meaning of "meaningful". In Java, one can > inspect and manipulate pointers like in this program for > example: > [chomp code] That shows that the Java '==' operator is like the Python 'is' operator, and checks for object id

Re: Hatch - A modern project, package, and virtual env manager

2017-09-05 Thread ofekmeister
0.4.0 is out now! -- https://mail.python.org/mailman/listinfo/python-list

Re: A question on modification of a list via a function invocation

2017-09-05 Thread MRAB
On 2017-09-05 20:08, Steve D'Aprano wrote: On Tue, 5 Sep 2017 11:47 pm, Gregory Ewing wrote: Steve D'Aprano wrote: [quoting Scott Stanchfield] Figure 7: (Java) Defining a Dog pointer Dog d; When you write that definition, you are defining a pointer to a Dog object, not a D

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Chris Angelico
On Wed, Sep 6, 2017 at 5:28 AM, Dennis Lee Bieber wrote: > On 5 Sep 2017 17:57:18 GMT, r...@zedat.fu-berlin.de (Stefan Ram) declaimed > the following: > >> But what does "a C++ reference" refer to? >> > > Per Stroustrup (The C++ Programming Language 4th Ed, page 189) > > """ > * .

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Steve D'Aprano
On Tue, 5 Sep 2017 11:47 pm, Gregory Ewing wrote: > Steve D'Aprano wrote: >> [quoting Scott Stanchfield] >> Figure 7: (Java) Defining a Dog pointer >> Dog d; >> >> When you write that definition, you are defining a pointer to a Dog >> object, not a Dog object itself. >> [e

Re: How do I find what kind of exception is thrown.

2017-09-05 Thread William Ray Wing
> On Sep 5, 2017, at 4:50 AM, Antoon Pardon wrote: > > Python 2.6.4 on a solaris box. > > I have a program in which all kind of excptions can be thrown and caugth. > The main program is something like below: > > try: >do_stuff > except Exception: >log unexpected trouble > > Now I foun

Re: tictactoe script - commented - may have pedagogical value

2017-09-05 Thread namenobodywants
good point. this algorithm doesn't take account of the fact that one can make a threat (x's 147) by parrying a threat (o's 357). nevertheless i'm still certain that the components the algorithm is built from are the same components i use myself to play tictactoe, and i'm still certain that my ow

Re: Python console's workspace path

2017-09-05 Thread Terry Reedy
On 9/5/2017 10:26 AM, Andrej Viktorovich wrote: Hello, I run Python 3.6 console under windows 10. Where is default console directory? It depends on how and where you start it. I run script: tf = open ("aaa.txt", "w") tf.write(" %s" % 123) tf.close() Where file aaa.txt will be created?

Re: How do I find what kind of exception is thrown.

2017-09-05 Thread Antoon Pardon
On 05-09-17 13:39, Steve D'Aprano wrote: > On Tue, 5 Sep 2017 06:50 pm, Antoon Pardon wrote: > >> Python 2.6.4 on a solaris box. >> >> I have a program in which all kind of excptions can be thrown and caugth. >> The main program is something like below: >> >> try: >> do_stuff >> except Excepti

Re: Python console's workspace path

2017-09-05 Thread eryk sun
On Tue, Sep 5, 2017 at 9:26 AM, Andrej Viktorovich wrote: > > I run Python 3.6 console under windows 10. Where is default console directory? The working directory for the console (i.e. conhost.exe) is irrelevant to Python. So I assume you mean the default working directory of the Python shell (i.

seeking advice about strategic-game ai

2017-09-05 Thread namenobodywants
i plan to try writing an ai for a strategic game, and i've pretty much narrowed the candidates down to either checkers or reversi. i would prefer to tackle the easier game, so can anybody tell me which one is easier to program decently? (or maybe i'm missing a good candidate - basically all i

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Ned Batchelder
On 9/5/17 1:28 PM, Chris Angelico wrote: > On Wed, Sep 6, 2017 at 3:15 AM, Ned Batchelder wrote: >> On 9/5/17 1:02 PM, Steve D'Aprano wrote: >>> On Tue, 5 Sep 2017 11:37 pm, Gregory Ewing wrote: >>> Dennis Lee Bieber wrote: > Pascal, probably Modula-2, Visual BASIC are closer to the C++

Re: Run python module from console

2017-09-05 Thread Grant Edwards
On 2017-09-05, Andrej Viktorovich wrote: > Hello, > > I suppose I can run python module by passing module as param for executable: > > python.exe myscr.py > > But how to run script when I'm inside of console and have python prompt: > os.system("python.exe myscr.py") -- Grant Edwards

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Rustom Mody
On Tuesday, September 5, 2017 at 10:45:45 PM UTC+5:30, Ned Batchelder wrote: > On 9/5/17 1:02 PM, Steve D'Aprano wrote: > > On Tue, 5 Sep 2017 11:37 pm, Gregory Ewing wrote: > > > >> Dennis Lee Bieber wrote: > >>> Pascal, probably Modula-2, Visual BASIC are closer to the C++ reference > >>> semanti

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Chris Angelico
On Wed, Sep 6, 2017 at 3:15 AM, Ned Batchelder wrote: > On 9/5/17 1:02 PM, Steve D'Aprano wrote: >> On Tue, 5 Sep 2017 11:37 pm, Gregory Ewing wrote: >> >>> Dennis Lee Bieber wrote: Pascal, probably Modula-2, Visual BASIC are closer to the C++ reference semantics, in that the definition

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Steve D'Aprano
On Tue, 5 Sep 2017 11:08 pm, Stefan Ram wrote: > Steve D'Aprano writes: >>[quote] >>The mistake they make is in the definition of >>Figure 7: (Java) Defining a Dog pointer >>Dog d; >>itself. When you write that definition, you are defining a pointer to a Dog >>object, not a Dog object itself. >>[

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Ned Batchelder
On 9/5/17 1:02 PM, Steve D'Aprano wrote: > On Tue, 5 Sep 2017 11:37 pm, Gregory Ewing wrote: > >> Dennis Lee Bieber wrote: >>> Pascal, probably Modula-2, Visual BASIC are closer to the C++ reference >>> semantics, in that the definition of a function declares how the >>> argument(s) are passed. >>

Re: Run python module from console

2017-09-05 Thread Rhodri James
On 05/09/17 17:11, Stefan Ram wrote: Ned Batchelder writes: exec( compile( open( 'myscr.py', 'rb' ).read(), 'myscr.py', 'exec' )) . This looks quite complicated, but there are rumors that Python 4 might have a »execfile« function, and one then will be able to write: execfile( 'myscr.py' ) It'

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Steve D'Aprano
On Tue, 5 Sep 2017 11:37 pm, Gregory Ewing wrote: > Dennis Lee Bieber wrote: >> Pascal, probably Modula-2, Visual BASIC are closer to the C++ reference >> semantics, in that the definition of a function declares how the >> argument(s) are passed. > > Well, sort of. In Pascal and Modula, and also

Re: Run python module from console

2017-09-05 Thread Rustom Mody
On Tuesday, September 5, 2017 at 8:45:00 PM UTC+5:30, Andrej Viktorovich wrote: > Hello, > > I suppose I can run python module by passing module as param for executable: > > python.exe myscr.py > > But how to run script when I'm inside of console and have python prompt: > > >>> By and large no

Re: tictactoe script - commented - may have pedagogical value

2017-09-05 Thread Ian Kelly
On Mon, Sep 4, 2017 at 9:26 PM, wrote: > > """ > this program makes an optimal tictactoe move by answering the following > questions > in their given order until it is told where to put its mark: > > 1) can you win the game? > if so then do it > 2) could your opponent win the game if it was

Re: Run python module from console

2017-09-05 Thread Ned Batchelder
On 9/5/17 11:16 AM, Stefan Ram wrote: > Andrej Viktorovich writes: >> I suppose I can run python module by passing module as param for executable: >> python.exe myscr.py >> But how to run script when I'm inside of console and have python prompt: The Python console isn't meant for ad-hoc execution

Re: Python console's workspace path

2017-09-05 Thread MRAB
On 2017-09-05 15:31, Stefan Ram wrote: Andrej Viktorovich writes: Hello, I run Python 3.6 console under windows 10. Where is default console directory? I run script: tf = open ("aaa.txt", "w") tf.write(" %s" % 123) tf.close() |>>> import os |>>> os.getcwd() Also, os.chdir(path) to chang

Re: Run python module from console

2017-09-05 Thread Rustom Mody
On Tuesday, September 5, 2017 at 8:45:00 PM UTC+5:30, Andrej Viktorovich wrote: > Hello, > > I suppose I can run python module by passing module as param for executable: > > python.exe myscr.py > > But how to run script when I'm inside of console and have python prompt: > > >>> >> import myscr

Run python module from console

2017-09-05 Thread Andrej Viktorovich
Hello, I suppose I can run python module by passing module as param for executable: python.exe myscr.py But how to run script when I'm inside of console and have python prompt: >>> -- https://mail.python.org/mailman/listinfo/python-list

Re: Python console's workspace path

2017-09-05 Thread Rustom Mody
On Tuesday, September 5, 2017 at 7:58:23 PM UTC+5:30, Andrej Viktorovich wrote: > Hello, > > I run Python 3.6 console under windows 10. Where is default console directory? > > I run script: > >>> tf = open ("aaa.txt", "w") > >>> tf.write(" %s" % 123) > >>> tf.close() > > Where file aaa.txt w

Re: Python console's workspace path

2017-09-05 Thread Chris Angelico
On Wed, Sep 6, 2017 at 12:26 AM, Andrej Viktorovich wrote: > Hello, > > I run Python 3.6 console under windows 10. Where is default console directory? > > I run script: tf = open ("aaa.txt", "w") tf.write(" %s" % 123) tf.close() > > Where file aaa.txt will be created? Can I chan

Python console's workspace path

2017-09-05 Thread Andrej Viktorovich
Hello, I run Python 3.6 console under windows 10. Where is default console directory? I run script: >>> tf = open ("aaa.txt", "w") >>> tf.write(" %s" % 123) >>> tf.close() Where file aaa.txt will be created? Can I change default work space location? How? -- https://mail.python.org/mailman/

Re: Case-insensitive string equality

2017-09-05 Thread Chris Angelico
On Wed, Sep 6, 2017 at 12:27 AM, Grant Edwards wrote: > On 2017-09-03, Gregory Ewing wrote: >> Stefan Ram wrote: >>> But of >>> course, actually the rules of orthography require "Maße" or >>> "Masse" and do not allow "MASSE" or "MASZE", just as in >>> English, "English" has to be written

Re: Case-insensitive string equality

2017-09-05 Thread Grant Edwards
On 2017-09-03, Gregory Ewing wrote: > Stefan Ram wrote: >> But of >> course, actually the rules of orthography require "Maße" or >> "Masse" and do not allow "MASSE" or "MASZE", just as in >> English, "English" has to be written "English" and not >> "english" or "ENGLISH". > > While "engl

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-05 Thread Chris Angelico
On Wed, Sep 6, 2017 at 12:19 AM, Rustom Mody wrote: > On Tuesday, September 5, 2017 at 7:32:52 PM UTC+5:30, Chris Angelico wrote: >> On Tue, Sep 5, 2017 at 11:49 PM, Rustom Mody wrote: >> > Pop et al wont work with frozen sets >> > Containment wont work with sets — what mathematicians call 'not cl

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-05 Thread Rustom Mody
On Tuesday, September 5, 2017 at 7:32:52 PM UTC+5:30, Chris Angelico wrote: > On Tue, Sep 5, 2017 at 11:49 PM, Rustom Mody wrote: > > Pop et al wont work with frozen sets > > Containment wont work with sets — what mathematicians call 'not closed' > > All of which amounts to this that python sets ar

Re: Installation issue with Python 3.6.2.

2017-09-05 Thread Thomas Jollans
On 2017-09-05 15:24, V Vishwanathan wrote: > For the past 8/10 hours I have been trying to install the above version > without any success. > > My O/S is windows 10 free upgrade from win 8.1 > > Every time I try to install, I simply get a message as per screen grab > attached. This list is te

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Rustom Mody
On Tuesday, September 5, 2017 at 7:12:48 PM UTC+5:30, Rustom Mody wrote: > On Tuesday, September 5, 2017 at 6:42:07 PM UTC+5:30, Gregory Ewing wrote: > > Steve D'Aprano wrote: > > > The third entity is the reference linking the name to the object (the > > > arrow). > > > This isn't a runtime value

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Chris Angelico
On Tue, Sep 5, 2017 at 11:11 PM, Gregory Ewing wrote: > Steve D'Aprano wrote: >> >> The third entity is the reference linking the name to the object (the >> arrow). >> This isn't a runtime value in Python, nor is it a compile time entity that >> exists in source code. It is pure implementation, an

Re: How to get values for skos/note, skos/notation and label in N-Triples

2017-09-05 Thread Chris Angelico
On Tue, Sep 5, 2017 at 11:40 PM, Dennis Lee Bieber wrote: > > {Post #6 in 6 days} > > On Tue, 5 Sep 2017 09:31:47 + (UTC), David Shi via Python-list > declaimed the following: > >> "Baginton E04009817"@en >>.

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-05 Thread Chris Angelico
On Tue, Sep 5, 2017 at 11:49 PM, Rustom Mody wrote: > Pop et al wont work with frozen sets > Containment wont work with sets — what mathematicians call 'not closed' > All of which amounts to this that python sets are not really pleasant for > math-work Funnily enough, Python has never boasted tha

Installation issue with Python 3.6.2.

2017-09-05 Thread V Vishwanathan
For the past 8/10 hours I have been trying to install the above version without any success. My O/S is windows 10 free upgrade from win 8.1 Every time I try to install, I simply get a message as per screen grab attached. I did have a version of 3.61 installed prior to upgrade to win 10, but so

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Gregory Ewing
Steve D'Aprano wrote: [quoting Scott Stanchfield] Figure 7: (Java) Defining a Dog pointer Dog d; When you write that definition, you are defining a pointer to a Dog object, not a Dog object itself. [end quote] Here Scott mixes up what the compiler does (creates a pointer

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-05 Thread Rustom Mody
On Tuesday, September 5, 2017 at 6:59:11 PM UTC+5:30, Ben Bacarisse wrote: > Rustom Mody writes: > > > On Tuesday, September 5, 2017 at 1:44:24 AM UTC+5:30, Ben Bacarisse wrote: > >> Rustom Mody writes: > >> > >> > Here is some code I (tried) to write in class the other day > >> > > >> > The ba

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Rustom Mody
On Tuesday, September 5, 2017 at 6:42:07 PM UTC+5:30, Gregory Ewing wrote: > Steve D'Aprano wrote: > > The third entity is the reference linking the name to the object (the > > arrow). > > This isn't a runtime value in Python, nor is it a compile time entity that > > exists in source code. It is p

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Gregory Ewing
Dennis Lee Bieber wrote: Pascal, probably Modula-2, Visual BASIC are closer to the C++ reference semantics, in that the definition of a function declares how the argument(s) are passed. Well, sort of. In Pascal and Modula, and also VB I think, parameters are the only things that can be

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Gregory Ewing
Steve D'Aprano wrote: On Tue, 5 Sep 2017 02:51 am, Stefan Ram wrote: > I am assuming that there are two argument passing mechanismss in the languages mentioned by me (C, C++, VBA, C#, Java, JavaScript, and Python): - pass by aliassing (reference) - pass "as if by assignment" That assumpti

Re: How to get values for skos/note, skos/notation and label in N-Triples

2017-09-05 Thread Rhodri James
On 05/09/17 10:31, David Shi via Python-list wrote: "Baginton E04009817"@en . "Live" .

Re: Please improve these comprehensions (was meaning of [ ])

2017-09-05 Thread Ben Bacarisse
Rustom Mody writes: > On Tuesday, September 5, 2017 at 1:44:24 AM UTC+5:30, Ben Bacarisse wrote: >> Rustom Mody writes: >> >> > Here is some code I (tried) to write in class the other day >> > >> > The basic problem is of generating combinations >> >> > Now thats neat as far as it goes but com

Re: A question on modification of a list via a function invocation

2017-09-05 Thread Gregory Ewing
Steve D'Aprano wrote: The third entity is the reference linking the name to the object (the arrow). This isn't a runtime value in Python, nor is it a compile time entity that exists in source code. It is pure implementation, and as such, exists outside of the Python domain. The fact that there

How to get values for skos/note, skos/notation and label in N-Triples

2017-09-05 Thread David Shi via Python-list
"Baginton E04009817"@en . "Live" .

Re: How do I find what kind of exception is thrown.

2017-09-05 Thread Steve D'Aprano
On Tue, 5 Sep 2017 06:50 pm, Antoon Pardon wrote: > Python 2.6.4 on a solaris box. > > I have a program in which all kind of excptions can be thrown and caugth. > The main program is something like below: > > try: > do_stuff > except Exception: > log unexpected trouble > > Now I found t

Re: How do I find what kind of exception is thrown.

2017-09-05 Thread Cameron Simpson
On 05Sep2017 10:50, Antoon Pardon wrote: Python 2.6.4 on a solaris box. I have a program in which all kind of excptions can be thrown and caugth. The main program is something like below: try: do_stuff except Exception: log unexpected trouble Now I found the following in the logs: [Errn

Re: How do I find what kind of exception is thrown.

2017-09-05 Thread Cameron Simpson
On 05Sep2017 19:44, Cameron Simpson wrote: Almost anything which says "Errno ..." is almost always an OSError (or an IOError as I found the other day). I try to be quite picky about these. So for example: Oh yes, and on a UNIX host such as Solaris the command "man 2 intro" will normally show

Re: How do I find what kind of exception is thrown.

2017-09-05 Thread Peter Otten
Antoon Pardon wrote: > Python 2.6.4 on a solaris box. > > I have a program in which all kind of excptions can be thrown and caugth. > The main program is something like below: > > try: > do_stuff > except Exception: > log unexpected trouble > > Now I found the following in the logs: [Er

Re: How do I find what kind of exception is thrown.

2017-09-05 Thread David Palao
Hi, It looks to me like an OSError, can it be? Best 2017-09-05 10:50 GMT+02:00 Antoon Pardon : > Python 2.6.4 on a solaris box. > > I have a program in which all kind of excptions can be thrown and caugth. > The main program is something like below: > > try: > do_stuff > except Exception: >

How do I find what kind of exception is thrown.

2017-09-05 Thread Antoon Pardon
Python 2.6.4 on a solaris box. I have a program in which all kind of excptions can be thrown and caugth. The main program is something like below: try: do_stuff except Exception: log unexpected trouble Now I found the following in the logs: [Errno 131] Connection reset by peer This is a

Re: Case-insensitive string equality

2017-09-05 Thread Chris Angelico
On Tue, Sep 5, 2017 at 6:05 PM, Stefan Behnel wrote: > Steve D'Aprano schrieb am 02.09.2017 um 02:31: >> - the German eszett, ß, which has two official[1] uppercase forms: 'SS' >> and an uppercase eszett > > I wonder if there is an equivalent to Godwin's Law with respect to > character case relate

Re: Case-insensitive string equality

2017-09-05 Thread Stefan Behnel
Steve D'Aprano schrieb am 02.09.2017 um 02:31: > - the German eszett, ß, which has two official[1] uppercase forms: 'SS' > and an uppercase eszett I wonder if there is an equivalent to Godwin's Law with respect to character case related discussions and the German ß. Stefan -- https://mail.pytho