On Sun, 3 Sep 2017 05:17 pm, Stephan Houben wrote:
> Generally speaking, the more you learn about case normalization,
> the more attractive case sensitivity looks
Just because something is hard doesn't mean its not worth doing.
And just because you can't please all the people all the time doesn'
On Mon, 4 Sep 2017 09:10 am, 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".
>
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:
"This is a long string of text..." # continues on for millions more ch
On Sat, 2 Sep 2017 01:48 pm, Stefan Ram wrote:
> Steve D'Aprano writes:
>>[1] I believe that the German government has now officially recognised the
>>uppercase form of ß.
>
> [skip to the last paragraph for some "ß" content,
> unless you want to r
On Mon, 4 Sep 2017 12:20 pm, Chris Angelico wrote:
> This is another proof that you can't divide everything into "pass by
> value" vs "pass by reference", unless you mess around with "passing a
> reference by value" or other shenanigans. In C, a string is not an
> entity; it's simply an array of c
On Mon, 4 Sep 2017 06:16 pm, Gregory Ewing wrote:
> Stefan Ram wrote:
>> JavaScript and Python do not have references as values
>
> Yes, they do.
No they don't. Python has ints, floats, strings, lists, tuples, dicts, etc as
values. It has no "reference" type, nor can you define your own. (You
On Mon, 4 Sep 2017 01:36 pm, Rustom Mody wrote:
> Tsk tsk the confusioning continues
Rustom, it is generally considered that we should do our best to *reduce*
confusion, not increase it. *wink*
> Rewrite
> [p for p in sys.path]
> as
> [p | p ∈ sys.path]
>
> Is that clearer?
No. What is "|" in
On Mon, 4 Sep 2017 08:12 pm, Rustom Mody wrote:
> Its because reference (or pointer or …) is central to python's semantics
> that we need to use them to talk/explain/understand.
References are central to understanding the implementation of Python
interpreters. (Perhaps not *all* interpreters, but
On Mon, 4 Sep 2017 08:52 pm, Antoon Pardon wrote:
> Op 04-09-17 om 12:22 schreef Stefan Ram:
>> Rustom Mody writes:
Stefan Ram wrote:
> JavaScript and Python do not have references as values
Yes, they do. The difference is that they don't have any
>> ...
>>> Its because reference (o
On Mon, 4 Sep 2017 01:31 pm, Stefan Ram wrote:
> Steve D'Aprano writes:
>>That makes arrays (and strings) in C a bit of an odd corner case, and an
>>exception to the usual rules, like unboxed machine types in Java. We should
>>acknowledge them, but as exceptional case
On Mon, 4 Sep 2017 01:11 pm, Rustom Mody wrote:
> Earlier
> Ben Bacarisse wrote:
>> The core of the idea is actually what the value-set of Python programs is --
>
> Yes! That!!
Indeed.
Given the assignment:
x = 1
then I think we all agree that the value of x is 1. So far so good.
But then,
On Tue, 5 Sep 2017 12:09 am, Antoon Pardon wrote:
> Op 04-09-17 om 15:26 schreef Steve D'Aprano:
>> On Mon, 4 Sep 2017 08:52 pm, Antoon Pardon wrote:
>>
>>> Op 04-09-17 om 12:22 schreef Stefan Ram:
>>>> Rustom Mody writes:
>>>>>>
On Mon, 4 Sep 2017 11:30 pm, Antoon Pardon wrote:
> Op 04-09-17 om 15:24 schreef Steve D'Aprano:
>> I accept that many people dislike, or do not understand, conceptual models
>> where objects can be in more than one location at once. For many people,
>> dropping i
On Tue, 5 Sep 2017 12:34 am, Rustom Mody wrote:
> On Monday, September 4, 2017 at 5:58:18 PM UTC+5:30, ROGER GRAYDON CHRISTMAN
> wrote:
>> Or with just one function: >>> def baz(x,y):
>> x += y
>> >>> a = 10
>> >>> b = [10]
>> >>> baz(a,a)
>> >>> a
>> 10
>> >>> baz(b,b)
>> >>> b[10, 10]
>
> Ha H
On Tue, 5 Sep 2017 12:59 am, Rustom Mody wrote:
> On Monday, September 4, 2017 at 7:50:39 PM UTC+5:30, Steve D'Aprano wrote:
>> On Mon, 4 Sep 2017 01:11 pm, Rustom Mody wrote:
>> > Simply put: pythonistas have no coherent/consistent sense of what python
>> > value
On Tue, 5 Sep 2017 01:17 am, Rustom Mody wrote:
> Anton gave a picture explaining why/how references are needed and to be
> understood
Antoon gave a picture demonstrating one model of Python's semantics.
It's a nice model that has a lot going for it, in particular that it matches the
most obviou
On Tue, 5 Sep 2017 02:51 am, Stefan Ram wrote:
> Steve D'Aprano writes:
>>Sorry Stefan, that is the same trap that many others fall into. You are
>>assuming that there are exactly two evaluation conventions:
>>- pass by reference
>>- pass by value
>>and so
On Tue, 5 Sep 2017 03:37 am, Rustom Mody wrote:
> My understanding is that the OP saw a 'for' inside a '[]' and wondered
> "WTF is this?"
Rustom, did you not notice that the OP seemed to understood the 'for' perfectly
well, but asked what the meaning of the [ ] delimiters is? He explicitly says:
Dennis,
That's an excellent summary of a number of programming languages' calling
conventions, thank you.
Unfortunately you have the X-No-Archive header set, so it will be lost to
prosperity. To prevent that, I'm taking the liberty of quoting you in full
below (and top posting).
A couple of comm
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
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
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
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
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
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
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 p
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 ID number which is guaranteed to be an integer, and
guaranteed to be distinct for all objects which exist at the same time. When an
object ceases to exis
On Wed, 6 Sep 2017 07:30 pm, Kryptxy wrote:
> I am working on a (cross-platform) project. On linux system, the imprts work
> fine, but in windows I get imort error (I have no idea why. I tried searching
> everywhere, but couldn't get it to work). Anyways, the issue seem to be
> resolved by adding
On Wed, 6 Sep 2017 05:12 pm, Antoon Pardon wrote:
[...]
>> I'm not saying that we should never use this model. Its a good model. But we
>> should be clear that it is a model of the implementation, and it describes
>> entities which are not part of the Python language. We cannot do this:
>>
>>
>>
On Wed, 6 Sep 2017 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
On Wed, 6 Sep 2017 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
> is identical with itself is t
On Wed, 6 Sep 2017 11:08 pm, Rustom Mody wrote:
> On Wednesday, September 6, 2017 at 5:59:17 PM UTC+5:30, nopsidy wrote:
>> https://www.youtube.com/watch?v= [...]
>> Thank you,
>> -Alex Goretoy
>> [...]
Please don't quote nopsidy's spam.
He is spamming the list with multiple links to the same v
On Thu, 7 Sep 2017 12:11 am, Antoon Pardon wrote:
[...]
> No it would not translate to the above diagram. It would translate to my
> diagram. All variables in pascal refer to some object (in memory), they don't
> refer to other variables. If you have a pointer variable, you have a variable
> that
On Thu, 7 Sep 2017 01:31 am, Ian Kelly wrote:
> On Wed, Sep 6, 2017 at 1:37 AM, Marko Rauhamaa wrote:
>>
>> Which reminds me of this puzzle I saw a couple of days ago:
>>
>>1 + 4 = 5
>>2 + 5 = 12
>>3 + 6 = 21
>>8 + 11 = ?
>>
>> A mathematician immediately comes up with a "wrong" a
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 at me, »HTML is not a programming language!«,
>>>I show them the interactive tic-tac-toe by Flo Kreidler, writte
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.
>>
>> What I didn't know is how the HTML works. I thought it was actually doing
>> some computation, but it se
On Thu, 7 Sep 2017 07:20 pm, Leam Hall wrote:
> OOP newbie on Python 2.6.
Python 2.6 is ancient, and is missing many nice features. You should consider
using the latest version, 3.6.
> I create instances of Character class with an attribute dict of
> 'skills'. The 'skills' dict has the name of
On Thu, 7 Sep 2017 08:57 pm, Andrej Viktorovich wrote:
> Hello
>
> For my understanding both - __init__() and __new__() works like constructors.
> And __new__() looks is closer to constructor. __init__() is more for variable
> initialization. Why I can't just initialize in __init__() ?
Because i
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 efficiency.
Believe me, the first time you pass a five gigabyte array to a function using
pass-by-value, on a machine wi
On Fri, 8 Sep 2017 02:24 am, Chris Angelico wrote:
> 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 p
On Fri, 8 Sep 2017 05:15 am, Stefan Ram wrote:
> It computing newsgroups, for example, people
> ask about how to compute the number of digits
> of a number, when, actually, only numerals
> (representations of numbers in a particular
> numeral system) have digits.
Um, yes? That's implici
On Fri, 8 Sep 2017 04:24 am, Rustom Mody wrote:
> On Thursday, September 7, 2017 at 6:52:04 PM UTC+5:30, 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 memo
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
>> that. I think it may be ill-defi
On Fri, 8 Sep 2017 05:54 pm, Gregory Ewing wrote:
> Steve D'Aprano wrote:
>> py> class K: # defines an object
>> ... def __init__(self, x):
>> ... self.x = x
>> ... def append(self, value):
>> ... self.x.append(value)
>
On Fri, 8 Sep 2017 08:20 pm, Ben Bacarisse wrote:
> Steve D'Aprano writes:
>
>> 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.
>>
On Fri, 8 Sep 2017 08:40 pm, Marko Rauhamaa wrote:
> Leam Hall :
>> 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
On Sun, 3 Sep 2017 03:03 am, MRAB wrote:
> On 2017-09-02 11:59, Steve D'Aprano wrote:
>> On Sat, 2 Sep 2017 08:53 pm, Steve D'Aprano wrote:
>>
>>> I want to delay a computation and then print it, in the REPL (interactive
>>> interpreter). I have
On Fri, 8 Sep 2017 01:01 pm, Rustom Mody wrote:
> On Friday, September 8, 2017 at 7:39:38 AM UTC+5:30, Steve D'Aprano wrote:
>> Rustom, I've already given you the definitive answer to your question about
>> how to define `is` without talking about memory. You haven
On Fri, 8 Sep 2017 07:03 pm, Ben Finney wrote:
>> Who is the father of ExampleClass1 ?
>
> No-one, since classes do not have gender. (The convention is to use the
> gender-neutral “parent” to refer to that relationship.)
Possibly not the case in Russia. Besides, words have gender in many langua
On Fri, 8 Sep 2017 10:50 pm, Larry Martell wrote:
> If python 2 ever
> is not available I guess then they will have to find the time and
> money.
Python 2 is open source, it will always be available so long as we still have
computers capable of running present day software.
(Presumably by the y
On Fri, 8 Sep 2017 10:51 pm, Chris Angelico wrote:
> 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. Poi
On Fri, 8 Sep 2017 11:01 pm, Rhodri James wrote:
> On 08/09/17 13:45, Stefan Ram wrote:
>> Gregory Ewing writes:
>> [a random integer will on average have ]
>>> infinitely many
>>> digits -- despite every actual integer only having finitely
>>> many di
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.
>
> Show the code that it broke? I've never seen this, unless it's
> something like "now you need to install thi
On Sat, 9 Sep 2017 12:23 am, Leam Hall wrote:
> Various responses in no particular order:
>
> On 09/08/2017 09:57 AM, Ned Batchelder wrote:
>> I've heard a lot of FUD about the Python 3 transition, but this one is
>> new to me. What is it that CompSci folks want that developers don't
>> want, th
On Sat, 9 Sep 2017 04:39 am, logonve...@gmail.com wrote:
> On Saturday, June 18, 2011 at 2:23:10 AM UTC+5:30, SherjilOzair wrote:
...^^
You're replying to something six years old. Its doubtful the original poster is
still reading.
>> What has the community to say about t
On Sat, 9 Sep 2017 10:34 am, Gregory Ewing wrote:
> Steve D'Aprano wrote:
>> The paradox of the axe is one illustration of the difficulty in defining "the
>> same" in full generality.
>
> The axe situation doesn't arise in Python, because "same
>
On Sun, 10 Sep 2017 05:47 am, Stefan Ram wrote:
> Andrej Viktorovich writes:
>>What is difference between string definitions:
>>s="aaa"
>>and
>>s='bbb'
>
> These two assignment statements differ in their
> last five characters.
>
> Their difference can be calculated thus:
>
> |>>> int.fr
On Sun, 10 Sep 2017 01:08 pm, Rick Johnson wrote:
> Marko Rauhamaa wrote:
>> The risk to Python will be whether the occasion is
>> exploited by fanboys of competing programming languages.
>> The migration from Python 2 might be to something else than
>> Python 3 in some circles.
>
> That has been
On Sun, 10 Sep 2017 02:04 pm, Rick Johnson wrote:
> Can you imagine the rage that someone will feel after
> climbing up the migration hill from Python2 to Python3, and
> then suddenly, hearing the announcement that it's now time
> to migrate to Python4?
Guido has ruled that Python 4 will not be a
On Mon, 11 Sep 2017 12:46 am, Rick Johnson wrote:
> if we consider the damage that small changes
> (like the print statement versus print function and
> raw_input versus input) have caused
The word for negative damage is "improvement".
--
Steve
“Cheer up,” they said, “things could be worse.”
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, in principle. I'm afraid few programmers will
> be willing/able
On Mon, 11 Sep 2017 04:14 am, leam hall wrote:
> I will add my +1 to the careful editing of code. Python's use of white
> space is pretty good once you get used to it. My Ruby code looks a lot like
> my Python code. :)
I believe you've replied to the wrong list. I think you meant to reply to the
On Tue, 12 Sep 2017 09:40 pm, Chris Angelico wrote:
[...]
>> Yet look at your answer; "upgrade". For a person working on a server there's
>> usually no economic choice to do. The OS python must stay in place and the
>> newly installed upgrade must be personally maintained, updated, and tested
>> w
On Tue, 12 Sep 2017 09:20 pm, Leam Hall wrote:
> But if someone comes onto the list, or IRC, and says they need to stay
> on Python 2 then please drop the dozens of e-mails and comments about
> upgrading.
[...]
> My recent experience with some people's inability to take "Sorry, I
> can't" for an a
On Wed, 13 Sep 2017 02:16 am, Larry Martell wrote:
> Not too many females here, but anyway:
>
>
https://svahausa.com/collections/shop-by-interest-1/products/python-code-fit-flare-dress
Was expecting a dress in a snake-skin pattern.
Was pleasantly surprised to see Insertion Sort in Python on a d
On Wed, 13 Sep 2017 01:18 am, Paul Moore wrote:
> Using map vs comprehensions is mostly a stylistic choice. Python
> programmers will typically choose a comprehension, so that style looks
> more idiomatic, but the map is not wrong. I haven't tested which is
> faster - I can't imagine it would make
Hi Roger,
My responses below yours, interleaved with your comments.
On Thu, 14 Sep 2017 02:18 am, ROGER GRAYDON CHRISTMAN wrote:
> I have not yet mastered how to respond to a particular note in a threadwith
> the mailer that I use,
Without knowing your mailer "Penn State WebMail", I would exp
On Sat, 16 Sep 2017 01:43 am, Ganesh Pal wrote:
> I have a function that return's x variables How do I check if all the the
> values returned are not None/False/0/''
[...]
> value1, value2 , value3 = return_x_values()
>
>
> # check if its not none
>
> # I think this can be better
> if value1
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 problems :-)
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
--
/rant on
So apparently everyone who disagrees that Python should be more like Javascript
is an old greybeard fuddy-duddy yelling "Get off my lawn!" to the cool kids --
and is also too stupid to know how dumb they are.
"Hi, I've been programming in Python for what seems like days now, and here's
a
On Sat, 16 Sep 2017 11:29 am, Rustom Mody wrote:
>> > py> import ast
>> > py> string = " 'msisdn': '7382432382', 'action': 'select',
>> > 'sessionId': '123', 'recipient': '7382432382', 'language': 'english'"
>> > py> ast.literal_eval('{%s}' % string)
>> > {'sessionId': '123', 'recipient': '7382432
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 use the
> concept integer / integer => integer_result
That would be C, and C derived langua
On Sun, 17 Sep 2017 04:00 am, Stefan Ram wrote:
> Steve D'Aprano writes:
>>"Hi, I've been programming in Python for what seems like days now, and here's
>>all the things that you guys are doing wrong.
>
> I never ever have written a line of Python
On Sun, 17 Sep 2017 09:04 am, breamore...@gmail.com wrote:
> I thought some might find this
> https://sites.google.com/view/energy-efficiency-languages/ interesting.
"Made with the new Google Sites, an effortless way to create beautiful sites."
More like an effortless way to create a complete do
On Sun, 17 Sep 2017 02:07 pm, Paul Rubin wrote:
> Steve D'Aprano writes:
>>> concept integer / integer => integer_result
>> That would be C, and C derived languages, perhaps?
>
> Certainly not. Fortran, machine languages, etc. all do that too.
&
On Sun, 17 Sep 2017 04:16 pm, Terry Reedy wrote:
> On 9/17/2017 2:04 AM, Chris Angelico wrote:
>> 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
On Sun, 17 Sep 2017 08:02 pm, Abdur-Rahmaan Janhangeer wrote:
> as someone who really dislike js, i have to admit : python's globals are
> really really bad !
>
> js is a charm at that a real charm !
Can you explain what you think is so bad about them, and why Javascript's are
better?
--
Ste
On Sun, 17 Sep 2017 08:03 pm, Leam Hall wrote:
> I'm still trying to figure out how to convert a string to unicode in
> Python 2.
A Python 2 string is a string of bytes, so you need to know what encoding they
are in. Let's assume you got them from a source using UTF-8. Then you would do:
mystri
On Sun, 17 Sep 2017 08:43 pm, Chris Angelico wrote:
> 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
On Sun, 17 Sep 2017 11:51 pm, Tim Golden wrote:
> Print-as-a-function removed one small simplicity
Presumably you've never wanted to print to something other than std.out. The
syntax in Python 2 is horrid:
print >>sys.stderr, args
Presumably you've never wanted to print using a separator other
On Mon, 18 Sep 2017 03:00 am, Chris Angelico wrote:
>> The distinction between Python floats and real numbers ℝ is a red-herring. It
>> isn't relevant.
>
> You said:
>
(I have a degree in maths, and if we ever
covered areas where int/int was undefined, it was only briefly, and I've
>>>
On Mon, 18 Sep 2017 04:09 am, Tim Chase wrote:
> On 2017-09-18 00:42, Steve D'Aprano wrote:
>> On Sun, 17 Sep 2017 11:51 pm, Tim Golden wrote:
>> Presumably you've never wanted to print to something other than
>> std.out. The syntax in Python 2 is horrid:
>>
On Mon, 18 Sep 2017 09:15 am, Rick Johnson wrote:
> On Sunday, September 17, 2017 at 9:42:34 AM UTC-5, Steve D'Aprano wrote:
>> On Sun, 17 Sep 2017 11:51 pm, Tim Golden wrote:
>>
>> [Snip: Reasons why print function is better than print statement]
>>
>> I
On Mon, 18 Sep 2017 07:37 am, Rick Johnson wrote:
> Consider the collowing code:
>
> if bool(someObject) == True:
> # Do something
>
> Yes, from a "byte-code perspective", this source code is
> superfluous,
This is bad code because it is bad SOURCE CODE. The byte code is ir
On Mon, 18 Sep 2017 11:11 am, Rick Johnson wrote:
> Speaking in _keystrokes_, and that's what really matters
> here, a print function is always three more keystrokes than
> a print statement.
Keystrokes only matter if you are hunt'n'peck typing and need to pause between
holding down the shift key
On Mon, 18 Sep 2017 09:53 pm, Rick Johnson wrote:
> Tell you what: test your hypothesis on non-programmers and
> report back here.
Why would someone do that?
The purpose of source code is not to communicate with non-programmers. It is to
communicate with other programmers. (If the code is execut
On Mon, 18 Sep 2017 10:42 pm, Rick Johnson wrote:
> Steve D'Aprano wrote:
>
>> [snip: offensive statements]
>>
>> Your insistence on adding the entirely superfluous, unnecessary
>
> Please acquaint yourself with the definition of superfluous,
> a
On Mon, 18 Sep 2017 10:54 pm, Rustom Mody wrote:
> The operation
> x == True
> for true(!)/proper booleans x is a no-op
> because True == True is True
> and False == True is False
> And there are no other (proper) booleans
Yes, this exactly!
> However because anything else can be bool-ish even
On Mon, 18 Sep 2017 11:00 pm, Rustom Mody wrote:
>> {None, 0, "" {}, []} → False
>> Everything_else → True
>>
>> This mapping is neither obvious nor trivial
>
> Sufficiently non-obvious that I missed the key element:
> {None, 0, "" {}, [], False} → False
I thought it was intentional, because th
On Tue, 19 Sep 2017 12:31 am, Ben Bacarisse wrote:
> Was the result of 1/2 determined
> by a poll to find out what most people expected?
No. It was determined by the fact that a decade or more of experience with the
language demonstrated that the Python 2 behaviour was a terrible mistake and a
co
On Tue, 19 Sep 2017 09:53 pm, Rustom Mody wrote:
> How exceptional is python's choice to NOT raise exceptions can be seen by
> examples:
You demonstrated that python raises exceptions for operations that aren't
defined or meaningful. I don't know what point you think that made, apart from
demonst
On Tue, 19 Sep 2017 05:56 am, Roel Schroeven wrote:
> I do prefer Python 3's print-as-a-function because "special cases aren't
> special enough to break the rules", but I feel there's a case to be made
> for Python 2's print-as-a-statement because "(although) practicality
> beats purity" sometim
On Wed, 20 Sep 2017 03:44 am, Stefan Ram wrote:
> Steve D'Aprano did *not* write
> [it was edited/abbreviated by me - S. R.]:
> |disadvantages:
> |0 - it makes print a special thing
> |1 - beginners have to unlearn
> |2 - `print(x, y)` is *not* the same as `print x, y`
On Wed, 20 Sep 2017 04:31 am, bartc wrote:
> On 19/09/2017 17:30, Steve D'Aprano wrote:
[snip list of problems with print]
> Can't you get around all those with things like sys.stdout.write?
If you had kept reading, you would have seen that I wrote:
Of course an experien
On Wed, 20 Sep 2017 04:48 am, Larry Martell wrote:
>>> It was my birthday the other day. People at worked asked how old I
>>> was. I replied:
>>>
>>> ((3**2)+math.sqrt(400))*2
>>>
>>> Quite a few people somehow came up with 47. And these are technical people.
>>
>> *headscratch* Multiple people go
On Wed, 20 Sep 2017 03:22 am, Chris Angelico wrote:
> On Wed, Sep 20, 2017 at 2:20 AM, Steve D'Aprano
> wrote:
>> I can only think of four operations which are plausibly universal:
>>
>> Identity: compare two operands for identity. In this case, the type o
On Wed, 20 Sep 2017 07:12 pm, Gregory Ewing wrote:
> Grant Edwards wrote:
>> Alternatively, you should design an instruction set and implement it
>> using microcode and AM2900 bit-slice processors.
>
> AMD2900? That's cheating! You should design and build your
> own logic gates. After refining th
On Wed, 20 Sep 2017 09:50 pm, Steve D'Aprano wrote:
> On Wed, 20 Sep 2017 07:12 pm, Gregory Ewing wrote:
>
>> Grant Edwards wrote:
>>> Alternatively, you should design an instruction set and implement it
>>> using microcode and AM2900 bit-slice processors.
&
On Wed, 20 Sep 2017 06:04 pm, Bill wrote:
> Robin Becker wrote:
>> On 16/09/2017 01:58, Steve D'Aprano wrote:
>>
>>>
>>> If you want to test for None specifically:
>>>
>>> if any(v is None for v in values):
>>> print &
On Wed, 20 Sep 2017 02:55 pm, Pavol Lisy wrote:
> On 9/19/17, Steve D'Aprano wrote:
>
> [...]
>
>> The point is, we all make the occasional silly error. Doesn't mean we should
>> cripple our functions and fill the language with special cases like the
>&g
1 - 100 of 1134 matches
Mail list logo