Re: How to install Python package from source on Windows

2017-05-21 Thread bartc
On 21/05/2017 21:46, Chris Angelico wrote: On Mon, May 22, 2017 at 5:32 AM, bartc <b...@freeuk.com> wrote: Why are you so afraid of multiple source files? [When other people build your app from sources] Because then they are likely to need automation to deal with it. And that intr

Re: How to install Python package from source on Windows

2017-05-21 Thread bartc
that only had a C compiler as a requirement, and nothing else. Unless I'm missing something. -- Bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: How to install Python package from source on Windows

2017-05-21 Thread bartc
On 21/05/2017 17:51, breamore...@gmail.com wrote: On Saturday, May 20, 2017 at 10:56:17 PM UTC+1, bartc wrote: I am still also sticking with the belief that you know about as much about programming as the RUE knows about unicode. What major projects have you worked on? Actually what have

Re: How to install Python package from source on Windows

2017-05-19 Thread bartc
s, fast memory, fast storage, fast connections, nor super-optimising compilers. And we wouldn't have people spending considerable efforts on tracing JITs as used for Javascript or the PyPy project for Python. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Old Man Yells At Cloud

2017-09-18 Thread bartc
keyboard). /And/ you have to select a suitable format code. Suddenly, having to type: print (a) doesn't seem so bad. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Old Man Yells At Cloud

2017-09-18 Thread bartc
for print to be a little special. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Old Man Yells At Cloud

2017-09-19 Thread bartc
prices. The increase would actually be just over 2.1% (a £100 ex-VAT price increases from £117.50 to £120.00). Etc. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Old Man Yells At Cloud

2017-09-19 Thread bartc
looked at me and said proudly "$10.03 is your change." My bill in a store came to £3.20 (GBP3.20), so I handed over £10.20. I was given back £16.90 in change! It turned out the cashier had entered £20.10 as the amount tendered. It was sorted out in the end. Sometimes its easier not

Re: [Tutor] beginning to code

2017-09-22 Thread bartc
et(,value): a = value set(x,100) Here the type of x is irrelevant anyway. It doesn't even need to be initialised to anything first (that might violate something in Python, I don't know what). -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] beginning to code

2017-09-21 Thread bartc
ew of "intuitiveness".   It's much easier to tell what's going on, at a glance, in a C++ program. You're being serious, aren't you? -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] beginning to code

2017-09-22 Thread bartc
ven: A = [10,20,30] B = ["X","Y","Z"] and wanting to swap A[0] and B[2]. Although these being list elements, they /could/ be exchanged via a function: def swapelems(a,i,b,j): a[i],b[j]=b[j],a[i] swapelems(A,0,B,2) Just not using a general-purpose swap function. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] beginning to code

2017-09-22 Thread bartc
utable. (To make it work would require a new reference type. And extra versions of the byte-codes or whatever is used to evaluate terms such as: a, a[i], x.y that evaluate a reference rather than the value. So LOADFASTREF as well as LOADFAST) -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 18:42, Chris Angelico wrote: On Sat, Oct 7, 2017 at 4:13 AM, bartc <b...@freeuk.com> wrote: So what's the excuse for an unresponsive text display in 2017? Got it. You assume that a system is a coherent computer with its peripherals, rather than being a networked coll

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 15:55, Chris Angelico wrote: On Fri, Oct 6, 2017 at 11:38 PM, bartc <b...@freeuk.com> wrote: Have you ever worked on a slow remote session where a GUI is completely impracticable (or maybe even unavailable), and redrawing the screen is too expensive to do all the tim

Re: newb question about @property

2017-10-06 Thread bartc
On 05/10/2017 14:13, Steve D'Aprano wrote: On Thu, 5 Oct 2017 10:51 pm, bartc wrote: Am I allowed to say that it all seems a bit of a mess? You may or may not be pleased to learn that there's a push to create a "record like" or "struct like" datatype for Python 3.7

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 14:11, Peter J. Holzer wrote: On 2017-10-06 12:38, bartc <b...@freeuk.com> wrote: On 06/10/2017 12:51, Chris Angelico wrote: What you REALLY mean is that you can't see the point of an interactive sort command. It doesn't fit into your workflow. And that's fine. It's not som

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 14:35, Paul Moore wrote: On 6 October 2017 at 13:56, bartc <b...@freeuk.com> wrote: If you don't like the word 'crude', try 'lazy'. Take this example of the gcc C compiler: > gcc -E program.c This preprocesses the code and shows the result. Typical programs will

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 18:55, Marko Rauhamaa wrote: bartc <b...@freeuk.com>: The internal utilities used within an operating system, primarily intended for file or redirected i/o with no live interaction, should be distinct from those designed to be used directly with a live user. Or is it a

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 20:38, Grant Edwards wrote: On 2017-10-06, bartc <b...@freeuk.com> wrote: For sort, there is no real need. You use a text editor to create your data. Then use existing file-based sort. I sort streams on stdin far more often than I sort named files. So what's been estab

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 20:21, Chris Angelico wrote: On Sat, Oct 7, 2017 at 5:51 AM, bartc <b...@freeuk.com> wrote: If you're stuck, whip out a tablet computer or smartphone (they should still function without connectivity) and use a preloaded text editor. Or just compose and then save an email

Re: The "loop and a half"

2017-10-08 Thread bartc
On 07/10/2017 15:40, Steve D'Aprano wrote: On Sat, 7 Oct 2017 11:54 pm, bartc wrote: So my programs that use Escape on Windows needed to use Escape Escape on Linux to get around that. Or you could just follow the expected Unix interface instead of inventing your own. Your job is to port

Re: The "loop and a half"

2017-10-08 Thread bartc
On 08/10/2017 10:12, Steve D'Aprano wrote: On Sun, 8 Oct 2017 02:06 am, bartc wrote: Thousands of Python programmers on Windows successfully learned to use Ctrl-Z ENTER back in the days of Python 1.5, before quit/exit were added as a convenience for beginners, and many of them probably still

Re: The "loop and a half"

2017-10-08 Thread bartc
OS. And I believe each file works with any C compiler. (Actually, I just found it had a dependency on a Windows time function; I've removed that temporarily for this upload.) See the pattern here? Simplicity not complexity. Consideration for others by making life easier.) -- bart

Re: The "loop and a half"

2017-10-08 Thread bartc
On 08/10/2017 13:05, Chris Angelico wrote: On Sun, Oct 8, 2017 at 10:46 PM, bartc <b...@freeuk.com> wrote: Just look at any interactive page on the web, they all work differently. People are used to it. And it allows innovation. Maybe it's just that you're not old enough to have

Re: The "loop and a half"

2017-10-08 Thread bartc
On 08/10/2017 17:13, Chris Angelico wrote: On Mon, Oct 9, 2017 at 2:01 AM, bartc <b...@freeuk.com> wrote: However as graphics became more mainstream then yes I did adopt some commonly expected styles (menubars for example). As for Alt-F4, if that generates a WM_CLOSE message for example,

Re: The "loop and a half"

2017-10-06 Thread bartc
On 07/10/2017 00:43, Steve D'Aprano wrote: On Sat, 7 Oct 2017 12:24 am, bartc wrote: print ("Enter blank expression to quit.") I *despise* programs that do that, and would cheerfully and unapologetically take their designers, disguise them as a lettuce, and stake them out to

Re: The "loop and a half"

2017-10-08 Thread bartc
On 08/10/2017 19:10, Chris Angelico wrote: On Mon, Oct 9, 2017 at 3:50 AM, bartc <b...@freeuk.com> wrote: You assume that since *you* have never needed to produce one lower-case letter in a block of upper-case, that "probably no one else has", and then you make it

Re: The "loop and a half"

2017-10-04 Thread bartc
eans." Exactly the same could be said of pretty much any of the advanced features that /have/ been added. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-04 Thread bartc
ss loop from a loop-and-a-half. My proposed while-do has a less chaotic structure. It wouldn't preclude 'break' from still being used, but there would be less need. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-04 Thread bartc
least half a dozen different ideas for implementing what the OP really wanted to do, which was expressed using C-like syntax. None of which were as obvious. And that C-like one worked because it could use an assignment within a while-condition. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: newb question about @property

2017-10-04 Thread bartc
On 04/10/2017 06:32, Steve D'Aprano wrote: On Wed, 4 Oct 2017 02:00 am, bartc wrote: Does all this advanced stuff (which I don't understand and which doesn't look very appealing either; hopefully I will never come across such code) still count as programming? I could not have hoped to see

Re: newb question about @property

2017-10-04 Thread bartc
On 04/10/2017 14:41, Ian Kelly wrote: On Wed, Oct 4, 2017 at 5:07 AM, bartc <b...@freeuk.com> wrote: For that matter, I don't think Python has such a feature either. So that you write for example: const C = 123345 and then whenever C appears within the code, it's imple

Re: The "loop and a half"

2017-10-09 Thread bartc
. And in your example, which I don't really understand, it seems more like the headache of the application. (Where a language allows elements of a program to be disseminated across a network, that's rather different, and an advanced feature that only some languages might have. Not all.) -- bartc

Re: The "loop and a half"

2017-10-10 Thread bartc
On 09/10/2017 01:37, boB Stepp wrote: On Sun, Oct 8, 2017 at 5:36 AM, bartc <b...@freeuk.com> wrote: And Bart, when large numbers of technical experts in their fields have spent many hours/months/years, yea, even several decades, developing these software systems, why do you think th

Re: on = style

2017-10-09 Thread bartc
yellow= 201 but it's not hard. Although it might not be worth doing until a program is finished. Compare to: red = 1 green = 2 blue = 3 turquoise = 4 yellow = 201 -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: An endless loop

2017-10-15 Thread bartc
oop. There isn't a dedicated statement for that, the closest Python feature would be 'for i in range(n)' with i a dummy loop variable. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
write to it will cause a crash. On my home-made system, they just did nothing. Much more graceful. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: An endless loop

2017-10-15 Thread bartc
On 15/10/2017 12:20, Chris Angelico wrote: On Sun, Oct 15, 2017 at 9:15 PM, bartc <b...@freeuk.com> wrote: I assume you're talking about the while-loop (because on my machine, it hangs just using 'from turtle...' or 'import turtle'). (Machine was screwed up I think, as I had to r

Re: newb question about @property

2017-10-05 Thread bartc
On 05/10/2017 12:29, Gregory Ewing wrote: bartc wrote: Result? You can't just look at my 'any' class and see what fields it uses. You can't even just look at the static source code. You have to run the program to find out. And it might be different each time. You can usually get a pretty

Re: The "loop and a half"

2017-10-05 Thread bartc
On 05/10/2017 12:09, Chris Angelico wrote: On Thu, Oct 5, 2017 at 9:56 PM, bartc <b...@freeuk.com> wrote: This doesn't make sense. For interactive use, you wouldn't bother testing for eof, as you'd be testing the eof status of the keyboard. You mean the way heaps and heaps of Unix pr

Re: The "loop and a half"

2017-10-05 Thread bartc
ot;Bye") This is a loop-and-a-half. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-05 Thread bartc
On 05/10/2017 18:01, Chris Angelico wrote: On Thu, Oct 5, 2017 at 10:26 PM, bartc <b...@freeuk.com> wrote: On 05/10/2017 12:09, Chris Angelico wrote: On Thu, Oct 5, 2017 at 9:56 PM, bartc <b...@freeuk.com> wrote: This doesn't make sense. For interactive use, you wouldn't bo

Re: why does memory consumption keep growing?

2017-10-05 Thread bartc
g such a program will only run on the programmer's machine and not a million consumer machines who would also need to fork out for extra memory. Their salaries may not stretch as far.) -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 12:04, Rhodri James wrote: On 05/10/17 19:45, bartc wrote: Yes, I tried typing 'sort' in Linux, where it apparently hangs (same on Windows actually). The reason: because it might have killed someone to have added a message saying what you are expected to type and how to end

Re: The "loop and a half"

2017-10-06 Thread bartc
rolling up the screen while it's doing so. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: why del is not a function or method?

2017-10-16 Thread bartc
d here, and even a reference to team[2] won't help. Presumably there is no other way to do an in-place deletion of an element of a list. (Inserting an element is different.) -- Bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: why del is not a function or method?

2017-10-16 Thread bartc
= anything# any other undefined name which is currently not allowed. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
e like that work now? BTW, when you're developing a new bit of hardware or software, and you're not part of team, then the user-base is normally just yourself. Nothing wrong with that, but you seem to like belittling people with such comments. What was the userbase when GvR started Python?

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
that same algorithm? We mustn't forget the person writing the code, who may have a certain type in mind for X, but their (I nearly said 'his') analysis may not match the compiler's. Annotations can be useful. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 15:59, Julien Salort wrote: Le 12/10/2017 à 17:57, bartc a écrit : With a const struct, you are stopped from directly modifying elements, but if an element is a pointer, nothing stops you writing to what the pointer points to, unless that has a const target too. And then you've

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
On 13/10/2017 14:16, Chris Angelico wrote: On Sat, Oct 14, 2017 at 12:00 AM, bartc <b...@freeuk.com> wrote: Even if data is actually in write-protected memory, attempts to write to it will cause a crash. On my home-made system, they just did nothing. Much more graceful. The novice thin

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
be accessed as: i.spam So this would be a const attribute. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread bartc
me actually; there is zero cost to devising, implementing and using the most helpful syntax, and actually there are real benefits. So why use something so bizarre? (**This is my actual language but as someone guessed, this part is derived from Algol68.) -- bartc -- https://mail.python.org/mail

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread bartc
ightly complex type, it won't work (the head of a linked list for example, where the node elements need to be writeable). It gives a false sense of security. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread bartc
On 12/10/2017 11:39, Stefan Ram wrote: bartc <b...@freeuk.com> writes: (1) Define named constants; except (in C) they can't be used like constant expressions, you can take their addresses, and accidentally or maliciously change their values. When I think of »const«, I do not think

Re: An endless loop

2017-10-16 Thread bartc
nd endless loops are probably used more with short test programs than in final applications, so having a very quick way to express them is convenient.) -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: why del is not a function or method?

2017-10-16 Thread bartc
On 16/10/2017 18:46, Michael Torrie wrote: On 10/16/2017 11:21 AM, bartc wrote: del x effectively removes it from the namespace so trying to use it on line 4 generates the same 'undefined' error. However, the byte-code still needs to be aware of x: at the time when line 1 is executed, the byte

Re: why del is not a function or method?

2017-10-16 Thread bartc
On 17/10/2017 01:53, Steve D'Aprano wrote: On Tue, 17 Oct 2017 03:16 am, Oren Ben-Kiki wrote: That doesn't explain why `del` isn't a method though. `del` cannot be a method or a function, because the argument to `del` is the name of the variable, not the contents of the variable. If we

Re: Lies in education [was Re: The "loop and a half"]

2017-10-13 Thread bartc
read-only memory like a ROM. And it might have trouble going into a memory page with read-only attributes. 'const' tries to do too many things, most of them poorly, although it does a very good job at adding clutter. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Call by binding [was Re: [Tutor] beginning to code]

2017-09-24 Thread bartc
the caller as there is no way to get from X's box to A's box. And the strings to the object are one-way. In the case of fn(A+2), a new object is created (with value '3', or an existing '3' might be used), a new string is attached to it, and the other is attached to X. -- bartc -- https://ma

Re: I'd like to use "semantic indentation"

2017-09-30 Thread bartc
wn( 'Abbeville' ), town( 'Addison' ), state( 'Arizona' ), town( 'Apache Junction' ), town( 'Avondale' ), town( 'Benson' ) ) This pretends they are arguments to a dummy function. But it probably won't work with anything that isn't also an expression. -- bartc --

Re: on a very slow function

2017-10-02 Thread bartc
takes time. If it recalculates 'last' once for each of those couple of dozen printed lines, that I doubt accessing a few MB of memory is the issue. More doing such a big calculation. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: on a very slow function

2017-10-02 Thread bartc
On 02/10/2017 14:54, Peter Otten wrote: bartc wrote: On 02/10/2017 08:41, Peter Otten wrote: Daniel Bastos wrote: def make_sequence_non_recursive(N, x0 = 2, c = -1): "What's wrong with this function? It's very slow." last = x0 def sequence(): nonlocal last

Re: Beginners and experts (Batchelder blog post)

2017-09-28 Thread bartc
(and fun, a lot of it), and the second is the usual lot of tools and technologies that programmers seems to have to know about these days (and not so much fun). -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Beginners and experts (Batchelder blog post)

2017-09-28 Thread bartc
On 28/09/2017 12:31, Steve D'Aprano wrote: On Thu, 28 Sep 2017 09:12 pm, bartc wrote: And I have little interest in most of this lot (my eyes glaze over just reading some of these): > - how to use operating systems You've never used a system call? Written to a file? Moved the mo

Re: newb question about @property

2017-10-03 Thread bartc
code) still count as programming? It seems to me the equivalent of an advanced driving course teaching you how to customise your car rather than involving any actual driving. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: newb question about @property

2017-10-04 Thread bartc
000) println p.bytes# 16 It's not Pythonic, but it is pretty handy (I know Python can also do structs like this but it appeared to be quite a slog last time I looked.) I guess my kind of coding is somewhat less esoteric than the kind of thing I typically see in Python here. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-04 Thread bartc
e by line or by byte won't work. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: why does memory consumption keep growing?

2017-10-05 Thread bartc
). Other replies suggest that deleting the import [name] doesn't affect any data it contains. So might as well move it to the top where it belongs. del mystuff import mystuff mystuff.some_more_expensive_stuff( x ) You'll have to comment these lines out first I think. -- bartc

Re: The "loop and a half"

2017-10-06 Thread bartc
On 07/10/2017 01:14, Ben Bacarisse wrote: bartc <b...@freeuk.com> writes: On 06/10/2017 14:35, Paul Moore wrote: On 6 October 2017 at 13:56, bartc <b...@freeuk.com> wrote: If you don't like the word 'crude', try 'lazy'. Take this example of the gcc C compiler: > g

Re: The "loop and a half"

2017-10-07 Thread bartc
On 07/10/2017 02:46, Steve D'Aprano wrote: On Sat, 7 Oct 2017 06:18 am, bartc wrote: For sort, there is no real need. You use a text editor to create your data. Then use existing file-based sort. What you mean is, *you* see no need for sorting interactively, or sorting as part of a pipeline

Re: The "loop and a half"

2017-10-07 Thread bartc
On 07/10/2017 14:19, Steve D'Aprano wrote: On Sat, 7 Oct 2017 11:06 pm, bartc wrote: Ctrl-K to enter "operate on selected text" mode; Y to Delete Ctrl-K to enter "operate on selected text" mode; R to Read from a file (at last an actual mnemonic command!) enter a file nam

Re: The "loop and a half"

2017-10-07 Thread bartc
r. Then the same with the next page. I think I did a 350-page manual like that. With pictures. My current language doesn't link its 'print' to graphic displays or images.) -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-07 Thread bartc
On 07/10/2017 09:35, Steve D'Aprano wrote: On Sat, 7 Oct 2017 11:05 am, bartc wrote: Um, that actually follows what interactive Python does. What is "that" to which you refer? If you mean, "what I, Bart C, suggested, namely having the program exit on a blank line"

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 12:51, Chris Angelico wrote: On Fri, Oct 6, 2017 at 10:41 PM, bartc <b...@freeuk.com> wrote: > What you REALLY mean is that you can't see the point of an interactive > sort command. It doesn't fit into your workflow. And that's fine. It's > not something you'd

Re: The "loop and a half"

2017-10-06 Thread bartc
On 06/10/2017 12:45, Chris Angelico wrote: On Fri, Oct 6, 2017 at 9:32 PM, bartc <b...@freeuk.com> wrote: (And properly, by being given the same of an actual file rather than using crude redirection.) Why do you call redirection "crude"? Do you not understand the value of g

Re: The "loop and a half"

2017-10-07 Thread bartc
On 07/10/2017 17:28, Steve D'Aprano wrote: On Sun, 8 Oct 2017 01:15 am, bartc wrote: You do remember this was about using programs /like/ sort as a model for writing true interactive scrolling text apps? I don't remember any such thing. I remember you *claiming* that, but if anyone actually

Re: The "loop and a half"

2017-10-07 Thread bartc
On 07/10/2017 14:19, Steve D'Aprano wrote: On Sat, 7 Oct 2017 11:06 pm, bartc wrote: So I have to copy 33,000 lines from a document, Don't be daft. Nobody says that stdin is a sufficient interface for a heavy-weight task like that. With 33000 lines of text, I absolutely would save them

Re: The "loop and a half"

2017-10-07 Thread bartc
On 07/10/2017 15:45, Grant Edwards wrote: On 2017-10-07, bartc <b...@freeuk.com> wrote: Interactive Python requires quit() or exit(), complete with parentheses. Nonsense. On Unix you can just press ctrl-D (or whatever you have configured as eof) at the command prompt. On windows, it'

Re: The "loop and a half"

2017-10-05 Thread bartc
On 05/10/2017 23:42, Gregory Ewing wrote: bartc wrote: It can be done with an in-band end-of-data code, Then you need some way of escaping that in-band code, in case it happens to equal some of the data you want to sort. It needn't be a big deal. You can do this (you have to in Python

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread bartc
rror, divide string by string .1e10 1e5 # 1.00 ten twenty # error, divide string by string For throwaway programs, or for testing, or for trusted input, this is perfectly reasonable. For perfect error checking, you need to do a bit more work on either verifying input, or using mo

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread bartc
On 11/10/2017 23:03, Gregory Ewing wrote: bartc wrote:     tokenrec * (*)[] > the original source and that type is written like this:     ref [] ref tokenrec The idiomatic way to write that type in C would be    tokenrec ** The original has an extra pointer so idiomatic C mi

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread bartc
. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread bartc
On 11/10/2017 15:36, Chris Angelico wrote: On Thu, Oct 12, 2017 at 1:14 AM, bartc <b...@freeuk.com> wrote: Python, maybe. C syntax isn't as painful as C++ but I still have a lot of trouble with it. (Eg. the variable declaration 'char(*(*x[3])())[5]'. The name of the variable can be

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread bartc
On 11/10/2017 15:52, breamore...@gmail.com wrote: On Wednesday, October 11, 2017 at 3:14:51 PM UTC+1, bartc wrote: On 11/10/2017 14:16, Marko Rauhamaa wrote: Python and C don't try to protect you. In return, you get syntactic convenience that probably enhances the quality of your programs

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread bartc
On 11/10/2017 17:16, Jonathan Cast wrote: On Wed, 2017-10-11 at 15:14 +0100, bartc wrote: On 11/10/2017 14:16, Marko Rauhamaa wrote: Python and C don't try to protect you. In return, you get syntactic convenience that probably enhances the quality of your programs. Python, maybe. C syntax

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread bartc
o int64'. The line includes two dereferences (^^) which /I think/ account for two of the "*" in the C version. Which * are dereferences, and which are part of the type, or indeed whether only one * is the dereference, I have absolutely no idea. Great language...) -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Lies in education [was Re: The "loop and a half"]

2017-10-11 Thread bartc
in one language that doesn't exist in the other. Surely it's better to have neither the cryptic type nor the typedef. Everything would be much cleaner. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: The "loop and a half"

2017-10-09 Thread bartc
up being used to mark the end of text files, I don't know.] -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Lies in education [was Re: The "loop and a half"]

2017-10-12 Thread bartc
element is a pointer, nothing stops you writing to what the pointer points to, unless that has a const target too. And then you've going to have problems doing normal updates. This constness just insinuates itself everywhere. -- bartc -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: why del is not a function or method?

2017-10-17 Thread bartc
argument). What does the second argument do? I thought Load and Store were of equal rank. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: why del is not a function or method?

2017-10-17 Thread bartc
On 17/10/2017 21:05, Chris Angelico wrote: On Wed, Oct 18, 2017 at 3:19 AM, bartc <b...@freeuk.com> wrote: On 17/10/2017 16:44, Terry Reedy wrote: In CPython left-hand expressions are not merely quoted for runtime evaluation and use. They are parsed at compile time and compiled to

Re: connect four (game)

2017-11-27 Thread bartc
On 27/11/2017 13:57, Chris Angelico wrote: On Mon, Nov 27, 2017 at 10:38 PM, bartc <b...@freeuk.com> wrote: Your decoder was straight-up buggy, and tests would have proven this. I created my Python version after the abysmal results from other Python decoders I tried which didn'

Re: While, If, Count Statements

2017-11-27 Thread bartc
On 27/11/2017 12:54, Cai Gengyang wrote: Input : count = 0 if count < 5: print "Hello, I am an if statement and count is", count while count < 10: print "Hello, I am a while and count is", count count += 1 Output : Hello, I am an if statement and count is 0 Hello, I am a while and

Re: connect four (game)

2017-11-27 Thread bartc
On 27/11/2017 03:04, Michael Torrie wrote: On 11/26/2017 08:39 AM, bartc wrote: The problem was traced to two lines that were in the wrong order (in the original program). I can't see how unit tests can have helped in any way at all, and it would probably have taken much longer. What makes

Re: connect four (game)

2017-11-27 Thread bartc
On 27/11/2017 17:41, Chris Angelico wrote: On Tue, Nov 28, 2017 at 2:14 AM, bartc <b...@freeuk.com> wrote: JPEG uses lossy compression. The resulting recovered data is an approximation of the original. Ah but it is a perfect representation of the JPEG stream. Any given compressed strea

Re: Argh!! Can't wrap my head around this Python stuff!

2017-11-26 Thread bartc
ing into sys.fn() uses the same CALL_FUNCTION byte-code as calling into a regular Python function.) As I said, it's not pure. More of a jungle as you've found out.) -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Benefits of unicode identifiers

2017-11-24 Thread bartc
boards will already take care of those. But which keyboards will have π [copied from the one above!]? Apart perhaps from the ones in Greece, where π might already be heavily used in the same way we use 'p'. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: connect four (game)

2017-11-26 Thread bartc
On 25/11/2017 16:07, Michael Torrie wrote: On 11/25/2017 06:00 AM, bartc wrote: And there's a quite lot left of the rest of the program to worry about too! If you add 'window()' at the end of the program, then it seems to run on Python 3. I'd play around with it first before thinking up

Re: connect four (game)

2017-11-26 Thread bartc
On 26/11/2017 14:23, Chris Angelico wrote: On Mon, Nov 27, 2017 at 1:11 AM, bartc <b...@freeuk.com> wrote: The way I write code isn't incrementally top down or bottom up. It's backwards and forwards. Feedback from different parts means the thing develops as a whole. Sometimes parts are

<    4   5   6   7   8   9   10   11   12   >