Re: Something is rotten in Denmark...

2011-05-31 Thread Chris Rebert
ise! . . . ) >     lambda?  closure?  scope?   bug? > >     What is going on with the binding in the first construct... this seems > to reduce the usefulness of lambda to a considerable extent? http://stackoverflow.com/questions/233673/lexical-closures-in-python (See 1st and 2nd answ

Re: scope of function parameters (take two)

2011-05-31 Thread Chris Angelico
you can specifically and deliberately cause this effect for any function(s) you wish to "protect" in this way; there's no need to change the language's fundamentals to do it. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: BadValueError: Property title is required

2011-05-31 Thread Chris Rebert
ult=0) > The problem is that I'm getting an error BadValueError: Property title > is required. Can you help me with that ? Thanks Try asking on the Django mailing list: http://groups.google.com/group/django-users Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: sqlalchemy and Unicode strings: errormessage

2011-05-31 Thread Chris Withers
7;re using - what sqlalchemy version you're using cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk -- http://mail.python.org/mailman/listinfo/python-list

Re: Load averages and Python threads on different Linux cloud provider setup

2011-05-31 Thread Chris Angelico
_ running? Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: scope of function parameters (take two)

2011-05-31 Thread Chris Kaynor
On Tue, May 31, 2011 at 9:16 AM, Ian Kelly wrote: > On Tue, May 31, 2011 at 1:38 AM, Daniel Kluev wrote: > > @decorator.decorator > > def copy_args(f, *args, **kw): > >nargs = [] > >for arg in args: > >nargs.append(copy.deepcopy(arg)) > >nkw = {} > >for k,v in kw.iteritem

Re: sqlalchemy and Unicode strings: errormessage

2011-05-31 Thread Chris Angelico
is an efficient way to translate Unicode text consisting primarily of low codepoint characters into bytes. It's not so much an implementation of Unicode as a means of converting a mythical concept of "Unicode characters" into a concrete stream of bytes. Hope that clarifies things a little! Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: scope of function parameters (take two)

2011-05-31 Thread Chris Kaynor
basestring, str, unicode, or bytes might allow some oddness and possibly slightly worse performance. Chris On Tue, May 31, 2011 at 10:10 AM, Ian Kelly wrote: > On Tue, May 31, 2011 at 10:34 AM, Chris Kaynor > wrote: > > Is there any reason not to simplify this to: > &g

Re: Thanks for all responses

2011-05-31 Thread Chris Angelico
s around its argument) wants a Unicode string, so you don't need to encode it. When you encode a Unicode string as in the last example, it returns a bytes string (an array of bytes), which looks like this: b'My name is M\xc3\xbcller' The print function wants Unicode, though, so it takes this unexpected object and calls str() on it, hence the odd display. Hope that helps! Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: Something is rotten in Denmark...

2011-05-31 Thread Chris Angelico
y other. The 2.7.1 revision notes include: - Issue #1713: Fix os.path.ismount(), which returned true for symbolic links across devices. Suppose some program were depending on this bug. It works under 2.7.0, fails under 2.7.1. Does that mean that 2.7.1 is incompatible with 2.7.0? Chris Angel

Re: Something is rotten in Denmark...

2011-05-31 Thread Chris Angelico
On Wed, Jun 1, 2011 at 8:39 AM, Chris Angelico wrote: > - Issue #1713: Fix os.path.ismount(), which returned true for symbolic links >  across devices. PS. I know nothing about this particular issue, I just skimmed down the release notes and stopped when something caught my eye. Choose a

Re: float("nan") in set or as key

2011-05-31 Thread Chris Angelico
On Wed, Jun 1, 2011 at 12:59 PM, Carl Banks wrote: > On Sunday, May 29, 2011 7:53:59 PM UTC-7, Chris Angelico wrote: >> Okay, here's a question. The Python 'float' value - is it meant to be >> "a Python representation of an IEEE double-precision flo

Re: float("nan") in set or as key

2011-05-31 Thread Chris Angelico
ndering why it's defined by what looks like an implementation detail. It's like defining that a 'character' is an 8-bit number using the ASCII system, which then becomes problematic with Unicode. (Ohai, C, didn't notice you standing there.) Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: float("nan") in set or as key

2011-06-01 Thread Chris Angelico
On Wed, Jun 1, 2011 at 11:44 PM, Jerry Hill wrote: >> On Wed, Jun 1, 2011 at 1:30 PM, Carl Banks wrote: >> True, but why should the "non-integer number" type be floating point >> rather than (say) rational? Careful with the attributions, Carl was quoting me when he posted that :) > You seem to

Re: Updated now can't scroll uparrow

2011-06-01 Thread Chris Rebert
ne support wasn't enabled in the build you installed. How did you install your Python? Cheers, Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: how to avoid leading white spaces

2011-06-01 Thread Chris Rebert
e extracted string. 4. Use slicing and concatenation to join together the rest of the line with the now-stripped inner string. Relevant docs: http://docs.python.org/library/stdtypes.html#string-methods Cheers, Chris -- http://rebertia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Updated blog post on how to use super()

2011-06-01 Thread Chris Torek
"NextClass.method", *your* class is definitely *not* ready for someone else to use in that MI situation. (I say "may" be ready for MI, because being "fully MI ready" requires several other code discipline steps. The point of super() -- at least when implemented nicely, as

Re: float("nan") in set or as key

2011-06-01 Thread Chris Torek
th 2**100 in each. (You will run out of memory first unless you have a machine with more than 64 bits of address space. :-) ) -- In-Real-Life: Chris Torek, Wind River Systems Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603 email: gmail (figure it out) http://web.torek.net/torek/index.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Thanks for all responses

2011-06-01 Thread Chris Angelico
in Python 2 (a module that isn't available in 3.x, for instance, or you're deploying to a site that doesn't have Python 3 installed), it's worth going with the newer one. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: Unshelving the data?

2011-06-01 Thread Chris Torek
key) ... Seems pretty straightforward. :-) Are you having some sort of problem with "del"? -- In-Real-Life: Chris Torek, Wind River Systems Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603 email: gmail (figure it out) http://web.torek.net/torek/index.html --

Re: Something is rotten in Denmark...

2011-06-02 Thread Chris Angelico
s" to my coworkers goes along the lines of "Well, go ahead, but you have to document it for the internal wiki". If you can't document something clearly, it's probably a bad idea. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: help me reviewing and organizing my code =)

2011-06-02 Thread Chris Angelico
vise, as you're using a framework I'm not overly familiar with - others will be better placed to give recommendations. Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: Have do_nothing as default action for dictionary?

2017-09-03 Thread Chris Angelico
On Mon, Sep 4, 2017 at 5:31 AM, Christopher Reimer via Python-list wrote: > Greetings, > > I was playing around this piece of example code (written from memory). > > > def filter_text(key, value): > > def do_nothing(text): return text > > return {'this': call_this, > > 't

testfixtures 5.2.0 released!

2017-09-03 Thread Chris Withers
iling list... cheers, Chris References Visible links 1. (in Python v2.7) https://docs.python.org/2/library/datetime.html#datetime.datetime 2. (in Python v2.7) https://docs.python.org/2/library/datetime.html#datetime.date 3. (in Python v2.7) https://docs.py

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

2017-09-03 Thread Chris Angelico
On Mon, Sep 4, 2017 at 12:05 PM, Steve D'Aprano wrote: > On Mon, 4 Sep 2017 04:15 am, Stephan Houben wrote: > >> Needless to say, according to the definition in Plotkin's paper, Python >> is "call-by-value". > > According to Plotkin's definition, when you pass a value like a 100MB string: > > "Thi

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

2017-09-04 Thread Chris Angelico
On Mon, Sep 4, 2017 at 6:16 PM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> This is another proof that you can't divide everything into "pass by >> value" vs "pass by reference" > > > True, but that doesn't mean you should deny th

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

2017-09-04 Thread Chris Angelico
On Mon, Sep 4, 2017 at 8:12 PM, Rustom Mody wrote: > On Monday, September 4, 2017 at 1:46:55 PM UTC+5:30, Gregory Ewing wrote: >> Stefan Ram wrote: >> > JavaScript and Python do not have references as values >> >> Yes, they do. The difference is that they don't have any >> way of *not* having re

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

2017-09-04 Thread Chris Angelico
On Mon, Sep 4, 2017 at 8:27 PM, Rustom Mody wrote: > That's fine as far as it goes > But then you have people (Steven above) who feel that python passing has > no exceptions (in parameter passing) > Does a poor job AFAIAC of explaining the difference between foo and bar in > foll > def foo(x

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

2017-09-04 Thread Chris Angelico
On Tue, Sep 5, 2017 at 1:36 AM, Dennis Lee Bieber wrote: > On Tue, 05 Sep 2017 00:20:25 +1000, Steve D'Aprano > declaimed the following: > >>(Of course this is silly. As all physicists know, there are no people, animals >>or cars in the world, there are only quarks and electrons.) > > Qua

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: 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

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: 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: 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 — wh

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: 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

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 Chris Angelico
On Wed, Sep 6, 2017 at 5:28 AM, Dennis Lee Bieber wrote: > On 5 Sep 2017 17:57:18 GMT, [email protected] (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 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: 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. > >

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 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-06 Thread Chris Angelico
On Wed, Sep 6, 2017 at 7:01 PM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> You can't do this with Python, since pointer arithmetic fundamentally >> doesn't exist. > > > Pointer arithmetic doesn't exist in Pascal either, yet > Pascal most d

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

2017-09-06 Thread Chris Angelico
On Wed, Sep 6, 2017 at 7:13 PM, Rustom Mody wrote: > On Wednesday, September 6, 2017 at 12:51:25 PM UTC+5:30, Gregory Ewing wrote: >> Rustom Mody wrote: >> > 2. is — machine representation, too fine to be useful >> >> Disagree - "is" in Python has an abstract definition that >> doesn't depend on m

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

2017-09-06 Thread Chris Angelico
On Wed, Sep 6, 2017 at 10:11 PM, Rustom Mody wrote: > On Wednesday, September 6, 2017 at 5:08:20 PM UTC+5:30, Steve D'Aprano wrote: >> On Wed, 6 Sep 2017 07:13 pm, Rustom Mody wrote: >> >> >> > Can you explain what "id" and "is" without talking of memory? >> >> Yes. >> >> id() returns an abstract

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

2017-09-06 Thread Chris Angelico
On Wed, Sep 6, 2017 at 10:44 PM, Rustom Mody wrote: > On Wednesday, September 6, 2017 at 5:48:48 PM UTC+5:30, Chris Angelico wrote: >> On Wed, Sep 6, 2017 at 10:11 PM, Rustom Mody wrote: >> >>>> a = (1,2) >> >>>> b = (1,2) >> >>>&g

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

2017-09-06 Thread Chris Angelico
On Wed, Sep 6, 2017 at 11:02 PM, Stefan Ram wrote: > Chris Angelico writes: >>The 'is' operator tests if two things are the same thing. > > »Roughly speaking, to say of two things that they are > identical is nonsense, and to say of one thing that it >

Re: No importlib in Python 3 64 bit ?

2017-09-06 Thread Chris Angelico
On Wed, Sep 6, 2017 at 10:41 PM, Andrej Viktorovich wrote: > Hello, > > I have 32Bit and 64Bit installations on my Windows 10 machine. I do import > importlib in both of them. > > 32bit works fine while 64bit prints error: > import importlib > Traceback (most recent call last): > File "",

Re: No importlib in Python 3 64 bit ?

2017-09-06 Thread Chris Angelico
On Thu, Sep 7, 2017 at 2:17 AM, MRAB wrote: > On 2017-09-06 14:00, Chris Angelico wrote: >> >> On Wed, Sep 6, 2017 at 10:41 PM, Andrej Viktorovich >> wrote: >>> >>> Hello, >>> >>> I have 32Bit and 64Bit installations on my Wind

Re: tictactoe script - commented - may have pedagogical value

2017-09-06 Thread Chris Angelico
On Thu, Sep 7, 2017 at 3:53 AM, Rhodri James wrote: > On 06/09/17 18:16, Stefan Ram wrote: >> >> Dennis Lee Bieber writes: >>> >>> Not to mention there are four rotations of the board, along with >>> reflections... One could, internally, keep track of the rotation needed >>> to >>> normal

Re: tictactoe script - commented - may have pedagogical value

2017-09-06 Thread Chris Angelico
On Thu, Sep 7, 2017 at 11:32 AM, Steve D'Aprano wrote: > On Thu, 7 Sep 2017 03:56 am, Chris Angelico wrote: > >> On Thu, Sep 7, 2017 at 3:53 AM, Rhodri James wrote: >>> On 06/09/17 18:16, Stefan Ram wrote: > [...] >>>>Whenever someone yells a

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

2017-09-07 Thread Chris Angelico
On Thu, Sep 7, 2017 at 5:59 PM, Marko Rauhamaa wrote: > Dennis Lee Bieber : > >> On Wed, 06 Sep 2017 10:37:42 +0300, Marko Rauhamaa >> declaimed the following: >> >>> >>>Which reminds me of this puzzle I saw a couple of days ago: >>> >>> 1 + 4 = 5 >>> 2 + 5 = 12 >>> 3 + 6 = 21 >>> 8 + 11

Re: tictactoe script - commented - may have pedagogical value

2017-09-07 Thread Chris Angelico
On Thu, Sep 7, 2017 at 5:11 PM, Steven D'Aprano wrote: > Thank you for the explanation Stefan, but I do know how to use a browser. > > What I didn't know is how the HTML works. I thought it was actually doing > some computation, but it seems like its just jumping to pre-rendered tic- > tac-toe gri

Re: tictactoe script - commented - may have pedagogical value

2017-09-07 Thread Chris Angelico
On Thu, Sep 7, 2017 at 10:07 PM, Steve D'Aprano wrote: > On Thu, 7 Sep 2017 06:05 pm, Chris Angelico wrote: > >> On Thu, Sep 7, 2017 at 5:11 PM, Steven D'Aprano >> wrote: >>> Thank you for the explanation Stefan, but I do know how to use a browser. >&

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

2017-09-07 Thread Chris Angelico
On Thu, Sep 7, 2017 at 11:21 PM, Gregory Ewing wrote: > Rustom Mody wrote: > >> I said: In that case please restate the definition of 'is' from the manual >> which invokes the notion of 'memory' without bringing in memory. > > > I don't know whether it's in the manual, but at least for > mutable o

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

2017-09-07 Thread Chris Angelico
On Fri, Sep 8, 2017 at 1:30 AM, Steve D'Aprano wrote: > On Fri, 8 Sep 2017 12:28 am, Chris Angelico wrote: > >> languages without mutable objects don't >> really care whether they're pass-by-X or pass-by-Y. > > Only if you don't care about efficienc

Re: In ports of a log file, how to detect if the ports are dangerous using python?

2017-09-07 Thread Chris Angelico
On Thu, Sep 7, 2017 at 11:28 PM, Rockzers wrote: > I know basic python and I have a log file, also I have print the output of > ports from the log file which there are so many ports in the output. > I want to know how to take only the dangerous ports from the printed ports - > Also I need to tak

mush 2.7 released! - Type-based dependency injection for scripts

2017-09-07 Thread Chris Withers
ypi/mush Compatible with Python 2.7, 3.4+ on Linux, Mac OS X and Windows. Any problems, please give me a shout on the [email protected] list! cheers, Chris -- https://mail.python.org/mailman/listinfo/python-list

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

2017-09-07 Thread Chris Angelico
On Fri, Sep 8, 2017 at 1:01 PM, Rustom Mody wrote: > >> Can you show an actual false positive (two distinct objects for which `is` >> returns True) or false negative (the same object given as both operands for >> `is` nevertheless returns False)? In the absence of any actual bugs in the >> definit

Re: Design: method in class or general function?

2017-09-08 Thread Chris Angelico
On Thu, Sep 7, 2017 at 11:31 PM, Ben Finney wrote: > leam hall writes: > >> I've wrestled with that discussion for a while and Python 3 loses every >> time. > > > The context of the thread you started was that you are a *newcomer* to > Python. Now you say you've considered Python 2 versus Python

Re: Using Python 2 (was: Design: method in class or general function?)

2017-09-08 Thread Chris Angelico
On Fri, Sep 8, 2017 at 8:12 PM, Leam Hall wrote: > However, those millions of servers are running Python 2.6 and a smaller > number running 2.7. At least in the US market since Red Hat Enterprise Linux > and its derivatives run 2.6.6 (RHEL 6) or 2.7.5 (RHEL 7). Not sure what > Python SuSE uses but

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

2017-09-08 Thread Chris Angelico
On Fri, Sep 8, 2017 at 10:05 PM, Steve D'Aprano wrote: > On Fri, 8 Sep 2017 05:48 pm, Gregory Ewing wrote: > >> Steve D'Aprano wrote: >>> A harder question is, what if you take a random number from the Integers? >>> How >>> many digits will it have in (say) base 10? I don't have a good answer to

Re: Using Python 2

2017-09-08 Thread Chris Angelico
On Fri, Sep 8, 2017 at 10:42 PM, Marko Rauhamaa wrote: > Chris Angelico : >> But as others have said, upgrading to 3.4+ is not as hard as many >> people fear, and your code generally improves as a result > > That's somewhat irrelevant. Point is, Python 2 will quickly

Re: Using Python 2

2017-09-08 Thread Chris Angelico
them fit with what Computer > Science teaches." Please give examples. Otherwise it is FUD. > On 09/08/2017 08:51 AM, Chris Angelico wrote: >> Let's see. You can port your code from Python 2.7 to Python 3.6 by >> running a script and then checking the results for bytes/tex

Re: Using Python 2

2017-09-08 Thread Chris Angelico
On Sat, Sep 9, 2017 at 1:42 AM, Steve D'Aprano wrote: > ... because this is > really just an excuse to do what they've wanted to do all along: use a > different language. > > Or because somebody in management heard from somebody on LinkedIn that they > heard on Facebook about something they read i

Re: Using Python 2

2017-09-08 Thread Chris Angelico
On Sat, Sep 9, 2017 at 2:19 AM, Steve D'Aprano wrote: > On Sat, 9 Sep 2017 12:41 am, Chris Angelico wrote: > >>> I ran 2to3 on some code that worked under 2.6.6. and 3.6.2. 2to3 broke it >>> for both versions and it was a fairly trivial script. >> >> Sho

Re: Design: method in class or general function?

2017-09-09 Thread Chris Angelico
On Sun, Sep 10, 2017 at 11:37 AM, Rick Johnson wrote: > On Thursday, September 7, 2017 at 7:16:25 AM UTC-5, Steve D'Aprano wrote: >> Python 2.6 is ancient, > > Enough with your hyperbole! Python 2.6 is no where near > being ancient. Python 2.6 is a stable version that gets the > job done for many

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-09 Thread Chris Angelico
On Sun, Sep 10, 2017 at 11:41 AM, Gregory Ewing wrote: > Pavol Lisy wrote: >> >> Interesting reading: >> https://stackoverflow.blog/2017/09/06/incredible-growth-python/?cb=1 > > > So, Python's rate of expansion is accelerating, like > the universe. Does that mean there's some kind of dark > energy

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Chris Angelico
On Sun, Sep 10, 2017 at 5:27 PM, Marko Rauhamaa wrote: > Terry Reedy : > >> On 9/9/2017 6:31 AM, Pavol Lisy wrote: >>> Interesting reading: >>> https://stackoverflow.blog/2017/09/06/incredible-growth-python/?cb=1 >> >> So much for Python 3 having killed python ;-) > > Hasn't yet, but it would have

Re: People choosing Python 3

2017-09-10 Thread Chris Warrick
Python 3.4 is available in EPEL. RHEL 8 will switch to Python 3 as the main Python interpreter (assuming dnf replaces yum, as it did in Fedora a while back). -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 -- https://mail.python.org/mailman/listinfo/python-list

Re: People choosing Python 3

2017-09-10 Thread Chris Warrick
On 10 September 2017 at 11:24, Leam Hall wrote: > On 09/10/2017 04:19 AM, Chris Warrick wrote: >> >> On 10 September 2017 at 09:30, Marko Rauhamaa wrote: >>> >>> INADA Naoki : >>> >>>> I can't wait Python 3 is the default Python of Red

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Chris Angelico
On Sun, Sep 10, 2017 at 7:45 PM, Skip Montanaro wrote: >> * asyncio with its a-dialect > > What is a/the "a-dialect"? Want to make something iterable? Define __iter__. Want to make it async-iterable (with "async for")? Define __aiter__. It's a bit clunky if you want the same object to be iterabl

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Chris Angelico
On Sun, Sep 10, 2017 at 8:08 PM, Marko Rauhamaa wrote: > Skip Montanaro : > >>> * asyncio with its a-dialect >> >> What is a/the "a-dialect"? > > What's more, when you turn a function into an async, you need to > refactor a large part of your program. That's not Python-specific. If you're going

Re: [Tutor] beginning to code

2017-09-10 Thread Chris Angelico
On Mon, Sep 11, 2017 at 11:29 AM, Rick Johnson wrote: > Ruby: > farray = [1.5, 1.9, 2.0, 1.0] > uniqueIntegers = farray.map{|f| f.to_i()}.uniq.length > > Python: > flist = [1.5, 1.9, 2.0, 1.0] > uniqueIntegers = len(set(map(lambda f:int(f), flist))) Python: floats = [1.5, 1.9, 2.

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-10 Thread Chris Angelico
On Mon, Sep 11, 2017 at 1:12 PM, Steve D'Aprano wrote: > On Mon, 11 Sep 2017 03:14 am, Marko Rauhamaa wrote: > >> Dennis Lee Bieber : >> >>> In contrast, every sample I've seen of the async library comes >>> across as "magic happens here -- at some point in time". >> >> That magic can be learned,

Re: Using Python 2

2017-09-11 Thread Chris Angelico
On Mon, Sep 11, 2017 at 5:34 PM, Steven D'Aprano wrote: >> By the way, "onerous" is an adjective, not a noun. > > "Onerosity" or "onertude" would be the correct grammatical forms for the > noun. More likely, "onus" was intended. ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-11 Thread Chris Angelico
On Mon, Sep 11, 2017 at 5:21 PM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> Async functions in >> JS are an alternative to callback hell; most people consider async >> functions in Python to be an alternative to synchronous functions. > > > What do yo

Re: People choosing Python 3

2017-09-11 Thread Chris Angelico
On Mon, Sep 11, 2017 at 10:00 PM, Pavol Lisy wrote: > On 9/11/17, Thomas Jollans wrote: >> On 2017-09-10 09:05, INADA Naoki wrote: >>> I saw encouraging tweet from Kenneth Reitz. >>> >>> https://twitter.com/kennethreitz/status/902028601893294081/photo/1 >>> >>> On Heroku, most people choose Pytho

Re: People choosing Python 3

2017-09-11 Thread Chris Angelico
On Mon, Sep 11, 2017 at 10:40 PM, Paul Moore wrote: > On 11 September 2017 at 13:07, Chris Angelico wrote: >> Fortunately, it's not that hard to type "python3" all the time. OS >> distributions can progressively shift to using that name, and then >> ev

Re: Simple game board GUI framework

2017-09-11 Thread Chris Angelico
On Tue, Sep 12, 2017 at 7:03 AM, Ian Kelly wrote: > On Mon, Sep 11, 2017 at 10:36 AM, ROGER GRAYDON CHRISTMAN > wrote: >> I would echo the recommendation of teaching something you are already >> familiar with doing. Perhaps you can find a different class hierarchy to >> work >> with. >> >> I

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-11 Thread Chris Angelico
On Tue, Sep 12, 2017 at 1:42 PM, Paul Rubin wrote: > Chris Angelico writes: >> students learning Python *today* ... they're learning Python 3. > > I'm not so sure of that. I do know a few people currently learning > Python, and they're using Python 2.

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Chris Angelico
On Tue, Sep 12, 2017 at 9:20 PM, Leam Hall wrote: > Hey Chris, > > This is an area the Python community can improve on. Even I would encourage > someone new to Python and wanting to do webdev to use Python 3. > > But if someone comes onto the list, or IRC, and says they need to

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Chris Angelico
On Tue, Sep 12, 2017 at 9:34 PM, Leam Hall wrote: > On 09/12/2017 07:27 AM, Chris Angelico wrote: >> >> On Tue, Sep 12, 2017 at 9:20 PM, Leam Hall wrote: >>> >>> Hey Chris, >>> >>> This is an area the Python community can improve on. Even

Re: The Incredible Growth of Python (stackoverflow.blog)

2017-09-12 Thread Chris Angelico
On Tue, Sep 12, 2017 at 10:21 PM, Ned Batchelder wrote: > On 9/12/17 7:40 AM, Chris Angelico wrote: >> On Tue, Sep 12, 2017 at 9:34 PM, Leam Hall wrote: >>> On 09/12/2017 07:27 AM, Chris Angelico wrote: >>>> On Tue, Sep 12, 2017 at 9:20 PM, Leam Hall wrote: >&g

Re: [Tutor] beginning to code

2017-09-12 Thread Chris Angelico
On Wed, Sep 13, 2017 at 1:03 AM, Rick Johnson wrote: > Chris Angelico wrote: >> Rick Johnson wrote: >> > Ruby: >> > farray = [1.5, 1.9, 2.0, 1.0] >> > uniqueIntegers = farray.map{|f| f.to_i()}.uniq.length >> > >> > Python: >>

Re: [Tutor] beginning to code

2017-09-12 Thread Chris Angelico
On Wed, Sep 13, 2017 at 3:22 AM, Rick Johnson wrote: > Oops! Yes, i did put a superfluous anonymous function in > there, my bad O:-) Although, to my defense, (and although i > never use this style in real code, but i'm trying to save > face here #_o, so bear with me...) the lambda does make the >

Re: [Tutor] beginning to code

2017-09-12 Thread Chris Angelico
On Wed, Sep 13, 2017 at 3:22 AM, Rick Johnson wrote: > So, what are your answers to my four questions: > > (1) Is it a speed issue? Then prove it. > > (2) Is it a readability issue? If so, then that's an > opinion _you_ get to have. > > (3) Is it a matter of "python purity"? If so

Re: Python dress

2017-09-12 Thread Chris Warrick
nfo/python-list Meh. That should be a return statement, the thing is not PEP 8-compliant, and Courier is an ugly font. -- Chris Warrick <https://chriswarrick.com/> PGP: 5EAAEA16 -- https://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] beginning to code

2017-09-12 Thread Chris Angelico
On Wed, Sep 13, 2017 at 1:01 PM, Rick Johnson wrote: > Chris Angelico wrote: >> Rick Johnson wrote: >> > So, what are your answers to my four questions: >> > > > I told you to forget about the superfluous lambda, but > alas, you cannot :-( You told me to for

Re: Change project licence?

2017-09-14 Thread Chris Angelico
On Fri, Sep 15, 2017 at 3:22 AM, Kryptxy via Python-list wrote: > Hi, > I have an opensource (python) project under GPL3 licence. I wish switch to > MIT licence so as to make it more permissive. > I know how to change the licence, but I want to know is it fine and wise to > change the licence at

Re: Change project licence?

2017-09-14 Thread Chris Angelico
On Fri, Sep 15, 2017 at 6:04 AM, Michael Torrie wrote: > Finally, even if you are the sole copyright holder, while you can change > the license on your code at any time to any terms, you cannot change the > license on code that has already been forked under your original GPLv3 > license. In other

Re: Change project licence?

2017-09-14 Thread Chris Angelico
On Fri, Sep 15, 2017 at 10:17 AM, Ben Finney wrote: >> I know how to change the licence, but I want to know is it fine and >> wise to change the licence at this point? (The project already has 19 >> clones, 250+ GitHub stars. Here: https://github.com/kryptxy/torrench) > > Those represent a whole l

Re: Question about modules documentation

2017-09-15 Thread Chris Angelico
On Sat, Sep 16, 2017 at 2:03 AM, Tobiah wrote: > It seems that if the statement read: > > the imported module's name (singular) is placed in the > importing module's global symbol table. > > That it would be more accurate. That implies that you only import one module. Consider: i

Re: Which database system?

2017-09-15 Thread Chris Angelico
On Sat, Sep 16, 2017 at 4:04 AM, Stefan Ram wrote: > When one is building an in-memory database that has a single > table that is built at the start of the program and then one > writes some complex queries to the table, what can be expected > to be faster: > > - implementing the table

Re: Which database system?

2017-09-15 Thread Chris Angelico
On Sat, Sep 16, 2017 at 11:37 AM, Steve D'Aprano wrote: > On Sat, 16 Sep 2017 04:24 am, Chris Angelico wrote: > >> but switching your dict/list system to be >> disk-backed is a lot harder. > > import shelve > > :-) > > > > Now you have two pr

Re: Old Man Yells At Cloud

2017-09-16 Thread Chris Angelico
On Sun, Sep 17, 2017 at 11:28 AM, MRAB wrote: > On 2017-09-17 02:00, Steve D'Aprano wrote: >> >> On Sun, 17 Sep 2017 02:52 am, Dennis Lee Bieber wrote: >> >> >>> Yes -- that would give me fits if I were using Python3 currently... >>> Since so many of the languages I've learned over the past years

Re: Old Man Yells At Cloud

2017-09-16 Thread Chris Angelico
On Sun, Sep 17, 2017 at 11:42 AM, Chris Angelico wrote: > On Sun, Sep 17, 2017 at 11:28 AM, MRAB wrote: >> On 2017-09-17 02:00, Steve D'Aprano wrote: >>> >>> On Sun, 17 Sep 2017 02:52 am, Dennis Lee Bieber wrote: >>> >>> >>>> Ye

Re: Research paper "Energy Efficiency across Programming Languages: How does energy, time, and memory relate?"

2017-09-16 Thread Chris Angelico
On Sun, Sep 17, 2017 at 4:00 PM, Terry Reedy wrote: > The numerical extensions have been quasi-official in the sense that at least > 3 language enhancements have been make for their use. I know about the matrix multiplication operator. What are the other two (or more)? ChrisA -- https://mail.py

Re: Old Man Yells At Cloud

2017-09-17 Thread Chris Angelico
On Sun, Sep 17, 2017 at 5:54 PM, Steve D'Aprano wrote: > To even *know* that there are branches of maths where int/int isn't defined, > you > need to have learned aspects of mathematics that aren't even taught in most > undergrad maths degrees. (I have a degree in maths, and if we ever covered >

Re: Unicode (was: Old Man Yells At Cloud)

2017-09-17 Thread Chris Angelico
On Sun, Sep 17, 2017 at 9:38 PM, Leam Hall wrote: > Still trying to keep this Py2 and Py3 compatible. > > The Py2 error is: > UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' > in position 8: ordinal not in range(128) > > even when the string is manually converted:

<    34   35   36   37   38   39   40   41   42   43   >