Re: python list index - an easy question

2016-12-18 Thread BartC
On 18/12/2016 21:04, Michael Torrie wrote: On 12/18/2016 09:21 AM, BartC wrote: So if you wanted a simple list giving the titles of the chapters in a book or on a DVD, on the colour of the front doors for each house in a street, usually you wouldn't be able to use element 0. It also depends

Re: python list index - an easy question

2016-12-18 Thread BartC
On 18/12/2016 22:21, BartC wrote: On 18/12/2016 21:04, Michael Torrie wrote: On 12/18/2016 09:21 AM, BartC wrote: So if you wanted a simple list giving the titles of the chapters in a book or on a DVD, on the colour of the front doors for each house in a street, usually you wouldn't be able

Re: python list index - an easy question

2016-12-18 Thread BartC
s to 1-based indexing! Or least, when -index is considered: x = [-4,-3,-2,-1] print x[-1] # -1 Notice the correspondence here... print x[-2] # -2 x = [1, 2, 3, 4] print x[1]# 2 ...and the lack of it here print x[2] # 3 -- Bartc -- https://mail.python

Re: python list index - an easy question

2016-12-19 Thread BartC
On 19/12/2016 01:10, Ben Bacarisse wrote: BartC <b...@freeuk.com> writes: On 18/12/2016 10:59, Paul Götze wrote: there is a nice short article by E. W. Dijkstra about why it makes sense to start numbering at zero (and exclude the upper given bound) while slicing a list. Might give

Re: python list index - an easy question

2016-12-20 Thread BartC
On 20/12/2016 00:49, Steve D'Aprano wrote: On Mon, 19 Dec 2016 03:21 am, BartC wrote: On 18/12/2016 10:59, Paul Götze wrote: Hi John, there is a nice short article by E. W. Dijkstra about why it makes sense to start numbering at zero (and exclude the upper given bound) while slicing a list

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread BartC
On 07/12/2016 13:58, Dennis Lee Bieber wrote: On Wed, 7 Dec 2016 11:54:35 +, BartC <b...@freeuk.com> declaimed the following: With automatic expansion, then EVERY program can become dangerous. Can no one else see this? With your scheme, EVERY PROGRAM HAS TO IMPLEMENT I

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread BartC
On 08/12/2016 00:09, Steve D'Aprano wrote: On Thu, 8 Dec 2016 02:48 am, BartC wrote: You make it sound like a big deal. Here's a program (in my language not Python) which prints the list of files matching a file-spec: println dirlist(cmdparams[2]) Does dirlist provide an escaping mechanism

Re: python 2.7.12 on Linux behaving differently than on Windows

2016-12-07 Thread BartC
On 07/12/2016 12:39, Chris Angelico wrote: On Wed, Dec 7, 2016 at 10:54 PM, BartC <b...@freeuk.com> wrote: But if a program existed that took N filename parameters with the purpose of deleting each of them, then it can't tell if they were typed in individually (so indicating a stronger

Re: Who are the "spacists"?

2017-03-20 Thread BartC
set of tab stops) that is recommended (eg. a comment at the top). -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Who are the "spacists"?

2017-03-20 Thread BartC
On 20/03/2017 14:32, Chris Angelico wrote: On Tue, Mar 21, 2017 at 1:24 AM, BartC <b...@freeuk.com> wrote: But it would be better IMO if tabs were used, with some scheme for suggesting the tab width (or set of tab stops) that is recommended (eg. a comment at the top). If you absolutel

Re: Python and the need for speed

2017-04-11 Thread bartc
nerating that damned asm source - was from yesterday!) However, when the obstacle is a particular language design then the options are more limited. I think CPython does remarkably well given the language. And the official byte-code (which can do with tweaking as that Wpython project demons

Re: Text-mode apps (Was :Who are the "spacists"?)

2017-04-02 Thread bartc
the filename of another; is each "/" a separator, or part of the embedded path? Anyway, I'm sure out of the million unicode characters, there must be something that /looks/ like a stroke, but isn't a stroke. Just to add to the confusion. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and the need for speed

2017-04-09 Thread bartc
n dynamic variables as I said. So such things can be made viable with the proper language support rather than relying on layers of what I consider unnecessarily esoteric features. Get the basics working first. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and the need for speed

2017-04-10 Thread bartc
On 10/04/2017 03:40, Rick Johnson wrote: On Sunday, April 9, 2017 at 1:34:39 PM UTC-5, bartc wrote: I have my own interpreted language which I call 'dynamic', but compared with Python, code in it might as well be set in concrete. Is this a personal toy, or something that you can share

Re: Python and the need for speed

2017-04-11 Thread bartc
t a feature that adds clutter that is only there for performance hints. Well, a little clutter might be OK: constant pi = 3.14159 Now 'pi' is /guaranteed/ to be the value you've specified (unlike math.pi). That sort of thing can help optimisation /and/ readability. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and the need for speed

2017-04-14 Thread bartc
by 1 I don't know if it's possible to override __iadd__ for integers so that +=1 does something different here. But if there is any code between answer=0 and the start of the loop, then there is the possibility that answer could be something different. -- bartc -- https://mail.python.org/mai

Re: Looping [was Re: Python and the need for speed]

2017-04-16 Thread bartc
On 16/04/2017 19:42, Chris Angelico wrote: On Mon, Apr 17, 2017 at 4:21 AM, bartc <b...@freeuk.com> wrote: Here is a function from some old CPython source that appears to be something to do with While statements: static int validate_while(node *tree) { ... Look, no comments! Are you

Re: Python and the need for speed

2017-04-15 Thread bartc
be mistaken for that common idiom. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and the need for speed

2017-04-15 Thread bartc
On 15/04/2017 14:27, Marko Rauhamaa wrote: bartc <b...@freeuk.com>: while 1: body Why not say it like it is: while True: body but it's more psychological; I don't want to use an idiom to denote an endless loop, I want to be able to express it directly!

Re: Python and the need for speed

2017-04-19 Thread bartc
On 19/04/2017 12:27, Chris Angelico wrote: On Wed, Apr 19, 2017 at 8:33 PM, bartc <b...@freeuk.com> wrote: [Warning: this is nothing to do with Python.] My interpreter is on github as /one/ C source file (a link would be inappropriate here). People can compile it with -O3 or -O2 if the

Re: "Goto" statement in Python

2017-04-13 Thread bartc
On 13/04/2017 22:58, Ian Kelly wrote: On Thu, Apr 13, 2017 at 3:27 PM, Dennis Lee Bieber <wlfr...@ix.netcom.com> wrote: On Thu, 13 Apr 2017 15:52:24 +0100, bartc <b...@freeuk.com> declaimed the following: 'goto' would be one easy-to-execute byte-code; no variables, objects or ty

Re: Python and the need for speed

2017-04-14 Thread bartc
I means when lots of things are arranged on one line, where the output of one method feeds into the next. Vertical space is free after all. However, you might argue that having discrete, intermediate steps would be a little slower than one-lining.. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and the need for speed

2017-04-14 Thread bartc
On 14/04/2017 11:56, Chris Angelico wrote: On Fri, Apr 14, 2017 at 8:42 PM, bartc <b...@freeuk.com> wrote: Classes and decorators are not esoteric. You sound like an old man who complains about this new-fangled "telephone", and how things were so much better when we ha

Re: Python and the need for speed

2017-04-13 Thread bartc
k x+=y is most usefully optimised when x and y are numbers. But numbers can't be modified in-place, not in general. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and the need for speed

2017-04-13 Thread bartc
On 13/04/2017 12:55, bartc wrote: On 13/04/2017 09:08, Steven D'Aprano wrote: Is it possible to skip the STORE_NAME op-code? If the starting-point is the existing byte-code of a program, then what can be done is more limited. If the optimiser can generate new byte-codes, then it might

Re: "Goto" statement in Python

2017-04-14 Thread bartc
On 14/04/2017 02:44, Steve D'Aprano wrote: On Fri, 14 Apr 2017 12:52 am, bartc wrote: I know this isn't the Python need-for-speed thread, but this is a classic example where the lack of one simple feature leads to using slower, more cumbersome ones. Dear gods, have I fallen back in time

Re: "Goto" statement in Python

2017-04-13 Thread bartc
ent. It might be a better idea to have a multi-level loop break then. This would also be an absolute jump byte-code. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and the need for speed

2017-04-19 Thread bartc
On 19/04/2017 17:23, Marko Rauhamaa wrote: bartc <b...@freeuk.com>: Enough works in that 'pcc' project, in terms of file i/o, that it can still run plenty of useful programs, such as compilers. This might have come up before, but do you have a language specification somewhere? (N

Re: Static typing [was Re: Python and the need for speed]

2017-04-16 Thread bartc
On 16/04/2017 16:00, justin walters wrote: On Sun, Apr 16, 2017 at 3:55 AM, bartc <b...@freeuk.com> wrote: Example C of the same silly program in Python: def add(a,b): return a+b def testfn(): sum=a=b=0 for i in range(1): sum += add(a,b) a += 1

Re: Looping [was Re: Python and the need for speed]

2017-04-16 Thread bartc
On 16/04/2017 15:22, Chris Angelico wrote: On Sun, Apr 16, 2017 at 11:57 PM, bartc <b...@freeuk.com> wrote: Technically, adding this one feature to Python /is/ trivial, for example, allowing while: as a synonym for while True:, but preferably using a new keyword such as loop. Nothing else

Re: Looping [was Re: Python and the need for speed]

2017-04-16 Thread bartc
On 16/04/2017 03:51, Steve D'Aprano wrote: On Sat, 15 Apr 2017 10:17 pm, bartc wrote: Yes, I'm constantly surprised at this, as such syntax has a very low cost (in my last compiler, supporting 'while' for example only added 30 lines to the project). That's the advantage of writing your own

Re: Static typing [was Re: Python and the need for speed]

2017-04-16 Thread bartc
CPython also makes use of label-pointers when compiled with gcc - as happens on Linux - but not when compiled with MSVC, so that CPython on Windows is a little slower for that reason. I don't know if this is still the case. Those Python timings were on Windows...) -- bartc -- https

Re: Looping [was Re: Python and the need for speed]

2017-04-16 Thread bartc
On 16/04/2017 17:30, Steve D'Aprano wrote: On Sun, 16 Apr 2017 10:06 pm, bartc wrote: (The 30 Loc figure is with support for loops /in general/ already in place, and is for /adding/ a new loop statement, in this case 'while') What part of *testing* and *documenting* do you not understand

Re: Static typing [was Re: Python and the need for speed]

2017-04-16 Thread bartc
On 16/04/2017 18:13, Steve D'Aprano wrote: On Mon, 17 Apr 2017 02:20 am, justin walters wrote: On Sun, Apr 16, 2017 at 8:46 AM, bartc <b...@freeuk.com> wrote: What were the results with Python on your machine? Well, at first I tried to implement it with a generator. I gave up on w

Re: Looping [was Re: Python and the need for speed]

2017-04-16 Thread bartc
On 16/04/2017 13:22, Rustom Mody wrote: On Sunday, April 16, 2017 at 5:36:28 PM UTC+5:30, bartc wrote: On 16/04/2017 03:51, Steve D'Aprano wrote: On Sat, 15 Apr 2017 10:17 pm, bartc wrote: Yes, I'm constantly surprised at this, as such syntax has a very low cost (in my last compiler

Re: Static typing [was Re: Python and the need for speed]

2017-04-16 Thread bartc
On 16/04/2017 20:00, Chris Angelico wrote: On Mon, Apr 17, 2017 at 4:43 AM, bartc <b...@freeuk.com> wrote: Sure! If all you care about is winning benchmarks, The benchmarks should be about comparing things. But they have to be like for like. Since this was about the effects o

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread bartc
re excuses to make use of it. Plus Python programmers may be more averse to using convoluted logic just to avoid a 'break' in the middle of a loop. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and the need for speed

2017-04-19 Thread bartc
On 19/04/2017 15:35, Chris Angelico wrote: On Wed, Apr 19, 2017 at 11:46 PM, bartc <b...@freeuk.com> wrote: You'd be surprised how easy it is to be non-OS-neutral. I misread that as 'easy to be OS-neutral'. If I turn it around, you're saying it is easy to be OS-specific. But w

Re: Python and the need for speed

2017-04-19 Thread bartc
On 19/04/2017 01:07, Erik wrote: On 19/04/17 00:33, bartc wrote: [Talking about an interpreter that is /not/ for Python] With the sort of lower level programs I write (in another dynamic language not Python), such an assembly layer improved performance 2-3 times over using 100% HLL compiled

Re: Write a function sorting(L).

2017-04-21 Thread bartc
sorted in-place, or a new list is returned with the elements sorted.) -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Looping [was Re: Python and the need for speed]

2017-04-17 Thread bartc
extra lookups per loop I guess (this was run inside a function otherwise the dynamics are different). -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: "Goto" statement in Python

2017-04-13 Thread bartc
On 13/04/2017 16:03, Ian Kelly wrote: On Thu, Apr 13, 2017 at 8:52 AM, bartc <b...@freeuk.com> wrote: On 13/04/2017 15:35, Chris Angelico wrote: Personally, I can't remember the last time I yearned for "goto" in Python, and the only times I've ever wished for it or used it in

Re: Python and the need for speed

2017-04-18 Thread bartc
.) -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and the need for speed

2017-04-18 Thread bartc
On 18/04/2017 23:33, Erik wrote: On 18/04/17 11:30, bartc wrote: On 18/04/2017 10:32, Erik wrote: the improvements over the original huge switch() to dispatch the bytecodes to the correct handler appear to have made this type of optimization less effective. What did they do

Re: Python and the need for speed

2017-04-18 Thread bartc
. But you would reduce two lookups to one, so the gains might be greater with those more elaborate accesses. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Python and the need for speed

2017-04-18 Thread bartc
On 19/04/2017 00:19, Gregory Ewing wrote: bartc wrote: Another optimisation for something like ADD, was to to check for very common types such as INT, and deal with those locally. And then you're on the path to writing a JIT compiler. If you can identify such cases, you might as well

Re: Rosetta: Range extraction

2017-04-24 Thread bartc
it doesn't seem to work. I thought it might use advanced Python features I didn't know about. -- bartc (Regarding this particular task, one of my languages has it built-in (for a 'set' object not a list): println [0, 1, 2, 4, 6, 7, 8, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22

Re: How to install Python package from source on Windows

2017-05-17 Thread bartc
On 17/05/2017 16:06, Rhodri James wrote: On 17/05/17 14:53, bartc wrote: It doesn't work. I can post something that is easy to compile, but someone is going to say, Ah, but it doesn't do this, it doesn't do that, it doesn't work on X... "Few people seem to see the point in m

Re: How to install Python package from source on Windows

2017-05-17 Thread bartc
On 17/05/2017 15:13, Chris Angelico wrote: On Wed, May 17, 2017 at 11:53 PM, bartc <b...@freeuk.com> wrote: That's all true. But the answer is not to make it a nightmare for everyone else as well as yourself. If the requirement is to get other people to build your product from

Re: How to install Python package from source on Windows

2017-05-17 Thread bartc
On 17/05/2017 17:23, Chris Angelico wrote: On Thu, May 18, 2017 at 1:37 AM, bartc <b...@freeuk.com> wrote: On 17/05/2017 15:13, Chris Angelico wrote: [1] Does work on Windows. Install bash for Windows, or (on a recent-enough Windows) just use the subsystem that Microsoft provides

Re: How to install Python package from source on Windows

2017-05-17 Thread bartc
not the author of Tiny C, so I wouldn't know. My own approach with the standard library is that I just use what is provided by the OS (so msvcrt.dll or libc.so.6). I expect Tiny C does the same as it doesn't appear to come with any libraries of its own. -- bartc -- https://mail.python.org

Re: How to install Python package from source on Windows

2017-05-17 Thread bartc
On 17/05/2017 21:05, breamore...@gmail.com wrote: On Wednesday, May 17, 2017 at 8:32:40 PM UTC+1, bartc wrote: On 17/05/2017 17:23, Chris Angelico wrote: On Thu, May 18, 2017 at 1:37 AM, bartc <b...@freeuk.com> wrote: On 17/05/2017 15:13, Chris Angelico wrote: [1] Does work on W

Re: How to install Python package from source on Windows

2017-05-17 Thread bartc
On 17/05/2017 21:17, Michael Torrie wrote: On 05/17/2017 01:32 PM, bartc wrote: Sometimes, if there's a problem. But usually the code is doing something sensible. The stuff in configure is complete gobbledygook (if anyone doesn't believe me, just have look). Well trying to edit an executable

Re: How to install Python package from source on Windows

2017-05-17 Thread bartc
On 17/05/2017 21:39, Chris Angelico wrote: On Thu, May 18, 2017 at 5:32 AM, bartc <b...@freeuk.com> wrote: It is impossible that all this is needed just to figure out what source files need to be compiled. (If it generated CPython sources fractal-style, then I might be impressed, but d

Re: How to install Python package from source on Windows

2017-05-17 Thread bartc
On 17/05/2017 22:40, Chris Angelico wrote: On Thu, May 18, 2017 at 6:52 AM, bartc <b...@freeuk.com> wrote: determines whether your system has the required compilers and libraries, figures out what source files should be compiled, and calculates the order in which to build the source

Re: How to install Python package from source on Windows

2017-05-17 Thread bartc
On 17/05/2017 23:32, Chris Angelico wrote: On Thu, May 18, 2017 at 8:21 AM, bartc <b...@freeuk.com> wrote: My own approach with the standard library is that I just use what is provided by the OS (so msvcrt.dll or libc.so.6). I expect Tiny C does the same as it doesn't appear to come wi

Re: How to install Python package from source on Windows

2017-05-17 Thread bartc
blob/master/qlang/pcc64.c The first is a compiler, the second an interpreter. They need to be built for a system with 64-bit pointers (as these aren't original sources but intermediate code targetted at 64-bit C). >Or for something a little more current, how > about Android? If Android

Re: How to install Python package from source on Windows

2017-05-16 Thread bartc
esn't handle label pointers. I believe that CPython makes use of label pointers with gcc to get an extra boost. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: How to install Python package from source on Windows

2017-05-17 Thread bartc
On 17/05/2017 02:18, Chris Angelico wrote: On Wed, May 17, 2017 at 10:41 AM, bartc <b...@freeuk.com> wrote: On 17/05/2017 00:24, Chris Angelico wrote: On Wed, May 17, 2017 at 9:01 AM, bartc <b...@freeuk.com> wrote: You mean like wheel files? Yeah, whodathunk. They don't need

Re: How to install Python package from source on Windows

2017-05-16 Thread bartc
nerate native code.) -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: How to install Python package from source on Windows

2017-05-16 Thread bartc
On 16/05/2017 23:15, breamore...@gmail.com wrote: On Tuesday, May 16, 2017 at 10:19:06 PM UTC+1, Chris Angelico wrote: On Wed, May 17, 2017 at 7:14 AM, bartc wrote: That PCbuild line is step 3 of Quick Start. You have to get past steps 1 and 2 first. It talks about something called Git; I

Re: How to install Python package from source on Windows

2017-05-17 Thread bartc
On 17/05/2017 13:35, Rhodri James wrote: On 17/05/17 01:41, bartc wrote: As a cross-platform developer, I find your naivity refreshing. If only life were so simple. When you develop code yourself, you can lay out your files however you find most convenient, code to the foibles of your

Re: How to install Python package from source on Windows

2017-05-17 Thread bartc
On 17/05/2017 14:53, bartc wrote: Note: none of these three projects is written in C. C is used as an intermediate language for the convenience, for ... For the 'convenience of others' that should be before it was badly edited. Not for me, as using C, even just generating C, is a pain

Re: Rosetta: Babbage problem

2017-05-09 Thread bartc
r was used above. (There was a short-lived language actually called 'Babbage', which I once implemented, although I doubt the man himself would have made much of it. But he might have been p*ssed off that it wasn't quite as successful as 'Ada', named after his programmer.) -- bartc -- https:/

Re: How to install Python package from source on Windows

2017-05-19 Thread bartc
ven if it fails to run for many other reasons. Once this exercise can be done for a compiler which is expected to (ie. gcc) /then/ it would be possible to try with another. -- Bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: How to install Python package from source on Windows

2017-05-19 Thread bartc
On 19/05/2017 04:31, Steve D'Aprano wrote: On Fri, 19 May 2017 04:17 am, bartc wrote: There is one uninitialised variable reported. And that is used only in an error situation. But yes, that was a mistake. "Only one"? Its a bit naughty to claim "one" uniniti

Re: I need help with making my claculator

2017-05-20 Thread bartc
uestions, you're not going to get anything more than a basic eyeballing of the code. Try running the program. (I did that but I can't follow this style of coding so can't help.) -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: I need help with making my claculator

2017-05-20 Thread bartc
On 20/05/2017 14:49, Steve D'Aprano wrote: On Sat, 20 May 2017 09:13 pm, bartc wrote: Try running the program. (I did that but I can't follow this style of coding so can't help.) Chris is within his rights to refuse to run untrusted code downloaded over the internet. It's not even

Re: How to install Python package from source on Windows

2017-05-20 Thread bartc
and people will still moan that it's too complex. You've reduced the job of building a set of kitchen units to hammering in just one nail, but then find that someone has never hammered a nail in before. I'm now investigating how to reduce a project to no files at all!) -- bartc -- https://mail.python.o

Re: How to install Python package from source on Windows

2017-05-18 Thread bartc
On 18/05/2017 07:13, Steven D'Aprano wrote: On Thu, 18 May 2017 02:12:58 +0100, bartc wrote: A portable C application should run anywhere there is a C compiler. Ha, somebody believed the advertising hype that C is a portable, write- once-run-anywhere language. Maybe somebody can try

Re: How to install Python package from source on Windows

2017-05-18 Thread bartc
On 18/05/2017 12:37, Rhodri James wrote: On 18/05/17 02:12, bartc wrote: So tell us Bart, what do you think are the chances that your Q compiler will *just work* with no modifications at all if somebody tried to build it on an IBM AS/400, or under BeOS? Maybe somebody can try it: https

Re: How to install Python package from source on Windows

2017-05-18 Thread bartc
On 18/05/2017 15:32, Ian Kelly wrote: On Thu, May 18, 2017 at 8:02 AM, bartc <b...@freeuk.com> wrote: On 18/05/2017 12:37, Rhodri James wrote: but (a) you have no leg to stand on criticising configure scripts with that file, You think so? After the first 50 lines, there are no #in

Re: Concatenating files in order

2017-05-24 Thread bartc
On 24/05/2017 16:41, Peter Otten wrote: Dennis Lee Bieber wrote: On Tue, 23 May 2017 21:42:45 +0100, bartc <b...@freeuk.com> declaimed the following: Is it necessary to sort them? If XXX is known, then presumably the first file will be called XXX_chunk_0, the next XXX_chunk_1

Re: Concatenating files in order

2017-05-23 Thread bartc
. (But this won't work if there are gaps in the sequence or the numeric format is variable.) -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread bartc
On 24/05/2017 23:59, Gregory Ewing wrote: bartc wrote: Yet the language will stop you assigning to 672, or "abc". Maybe the language could have been made even smaller if that was not checked; after all the developer ought to be trusted not to assign to them! I'm told that so

Re: Verifiably better, validated Enum for Python

2017-05-26 Thread bartc
fail (because string literals have slightly different types compared with C). -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: How to install Python package from source on Windows

2017-05-19 Thread bartc
On 19/05/2017 12:41, Steve D'Aprano wrote: On Fri, 19 May 2017 08:36 pm, bartc wrote: Which gcc version? I can't get mine (5.1.0) to report any of these, even with -Wall -Wextra -Wpedantic. [steve@ando langs]$ gcc --version gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) Interesting; an older

Re: How to install Python package from source on Windows

2017-05-20 Thread bartc
On 20/05/2017 19:37, Chris Angelico wrote: On Sun, May 21, 2017 at 4:11 AM, bartc <b...@freeuk.com> wrote: (Which is exactly what I strive to do. Although my projects are small, they could still involve dozens of source and support files, and require running non-standard tools to build,

Re: How to install Python package from source on Windows

2017-05-21 Thread bartc
able machine in the same place - is not scalable.) -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: Python compiled by tcc

2017-05-21 Thread bartc
un at half the speed is irrelevant. (Not such good news for me, as now I feel obliged to make my own C compiler manage it. And it sort of competes with tcc for compilation speed (and size too but that wasn't intentional). However it lacks some C99 features at the minute.) -- bart

Re: How to install Python package from source on Windows

2017-05-21 Thread bartc
On 21/05/2017 12:06, Chris Angelico wrote: On Sun, May 21, 2017 at 8:23 PM, bartc <b...@freeuk.com> wrote: (If you imagine a future where the number of targets has increased a hundred-fold (or we colonise the galaxy and there are a million possible targets), then it might become c

Re: Scala considering significant indentation like Python

2017-05-22 Thread bartc
checked by the language, it's only to aid readability, so ends may be placed incorrectly or left out - Multple ends on one line need a comma separator: end, end, end - No one actually does this so it can't solve any of the problems people might have with indentation -- Bartc -- https

Re: How to install Python package from source on Windows

2017-05-21 Thread bartc
On 21/05/2017 16:21, Chris Angelico wrote: On Mon, May 22, 2017 at 12:58 AM, bartc <b...@freeuk.com> wrote: On 21/05/2017 12:06, Chris Angelico wrote: Explain why ALL these drivers, including the one I've just created, need to be part of the common source code for the OS. I don't kno

Re: type hinting backward compatibility with python 3.0 to 3.4

2017-05-21 Thread bartc
anyway, it is not visible at compile-time, when type hints could best be put to good effect. Furthermore, both A, and the type-hinting code, might be conditional. So that on Tuesdays, A is a class, the rest of the week it's the name of a module. Python doesn't make things easy. -- bartc --

Re: Verifiably better, validated Enum for Python

2017-05-24 Thread bartc
lookups, and named constants defined inside a module or class so requiring an attribute lookup. Ideally a named constant would be instantly mapped to the equivalent literal, and done during compilation. Then a range of optimisations also become possible (and enables a fast 'switch' statement).

Re: How to install Python package from source on Windows

2017-05-18 Thread bartc
On 18/05/2017 18:11, Steve D'Aprano wrote: On Thu, 18 May 2017 11:38 pm, bartc wrote: Speaking of user-hostile experiences, why do you need separate source files for 32- and 64-bit builds? Why isn't it just a build option? I've never heard of people using separate source code for 32- and 64

Re: How to install Python package from source on Windows

2017-05-18 Thread bartc
is perfectly legal, meanwhile it will deluge you with hundreds of pointless warnings. In my original language, such a mixup is illegal. So, do you still trust a C compiler more? The language is inherently unsafe. -- bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: How to install Python package from source on Windows

2017-05-18 Thread bartc
\build.bat -e -d is too complicated. You're right of course. But it makes you wonder then why they bother making available binary builds of Python for Windows, when someone just needs to enter a simple command and it will effortlessly build you a customised version from source. -- bartc

Re: How to install Python package from source on Windows

2017-05-18 Thread bartc
On 18/05/2017 18:11, Steve D'Aprano wrote: On Thu, 18 May 2017 11:38 pm, bartc wrote: Seems a bit hypocritical, don't you think? Expecting people to go spelunking into your undocumented mystery language source code to work out how to build it from source, and then turning around

Re: How to install Python package from source on Windows

2017-05-18 Thread bartc
On 18/05/2017 19:17, bartc wrote: On 18/05/2017 18:11, Steve D'Aprano wrote: unsafe dereferencing of type-punned pointers, missing parentheses, suggested parentheses not missing. And they are suggested because, in C, when people write a<<b+c they will sometimes have assumed it

Re: How to install Python package from source on Windows

2017-05-18 Thread bartc
On 18/05/2017 21:12, Chris Angelico wrote: On Fri, May 19, 2017 at 5:29 AM, bartc <b...@freeuk.com> wrote: "largely" verified. Can you be absolutely certain that not one of these compiler-detected issues is actually a problem? Would you stake your life on it - for example, w

Re: How to install Python package from source on Windows

2017-05-19 Thread bartc
On 19/05/2017 19:53, eryk sun wrote: On Fri, May 19, 2017 at 1:57 PM, bartc <b...@freeuk.com> wrote: The 'improvement' seems to involve making things more complicated rather than less. You don't need a full Visual Studio 2015 installation. You can install Visual C++ 2015 Build To

Re: How to install Python package from source on Windows

2017-05-19 Thread bartc
On 19/05/2017 12:00, bartc wrote: These are the binary files on my Python 3.4 system: python.exe pythonw.exe DLLs/pyexpat.pyd DLLs/python3.dll ... So, which sources are needed to compile and link python.exe for example? Which headers or other files need to be synthesised for them

Re: How to install Python package from source on Windows

2017-05-16 Thread bartc
On 16/05/2017 22:18, Chris Angelico wrote: On Wed, May 17, 2017 at 7:14 AM, bartc <b...@freeuk.com> wrote: That PCbuild line is step 3 of Quick Start. You have to get past steps 1 and 2 first. It talks about something called Git; I don't know what that is or what I'm supposed

Re: How to install Python package from source on Windows

2017-05-16 Thread bartc
On 16/05/2017 21:18, breamore...@gmail.com wrote: On Tuesday, May 16, 2017 at 5:09:34 PM UTC+1, bartc wrote: I can't test with Python because it's too complicated to compile, especially on Windows. What is the problem with the documentation given here https://docs.python.org/devguide

Re: How to install Python package from source on Windows

2017-05-16 Thread bartc
On 16/05/2017 23:33, Chris Angelico wrote: On Wed, May 17, 2017 at 8:17 AM, bartc <b...@freeuk.com> wrote: Then you are stuck in your own little bubble. That's fine as long as you never try to foist your software OR your system on anyone else. The rest of us collaborate with other

Re: How to install Python package from source on Windows

2017-05-16 Thread bartc
On 17/05/2017 00:42, Michael Torrie wrote: On 05/16/2017 05:01 PM, bartc wrote: It should be a piece of cake, yes? If TCC implements the standard sufficiently, then yes it's possible. However it won't be easy because the Python build tools are geared towards the dominant compilers (GCC

Re: How to install Python package from source on Windows

2017-05-16 Thread bartc
On 17/05/2017 00:24, Chris Angelico wrote: On Wed, May 17, 2017 at 9:01 AM, bartc <b...@freeuk.com> wrote: You mean like wheel files? Yeah, whodathunk. They don't need a C compiler or anything. I don't know if that's the same kind of thing. I'm not talking about something like a

Re: How to install Python package from source on Windows

2017-05-30 Thread bartc
to the latest version (a mere 4.5GB download). And there would have been a page where you told it what parts you wanted. -- 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 22/05/2017 01:07, Gregory Ewing wrote: is not easy, but nobody should *need* to do that unless they're -- https://mail.python.org/mailman/listinfo/python-list

<    3   4   5   6   7   8   9   10   11   12   >