Re: More About Unicode in Python 2 and 3

2014-01-06 Thread Mark Janssen
The argument is that a very important, if small, subset a data manipulation become very painful in Py3. Not impossible, and not difficult, but painful because the mental model and the contortions needed to get things to work don't sync up anymore. You are confused. Please see my reply to

Re: More About Unicode in Python 2 and 3

2014-01-06 Thread Mark Janssen
Chris didn't say bytes and ascii data, he said bytes and TEXT. Text != ascii data, and the fact that some people apparently think it does is pretty much the heart of the problem. The heart of a different problem, not this one. The problem I refer to is that many binary formats have

Re: the Gravity of Python 2

2014-01-06 Thread Mark Janssen
http://blog.startifact.com/posts/python-2-gravity.html A Way Forward - How to go forward then? I think it makes sense to work as hard as possible to lift those Python 2 codebases out of the gravity well. I think this is complete nonsense. There's only been five years since the first

Re: More About Unicode in Python 2 and 3

2014-01-06 Thread Mark Janssen
Looks like another bad batch, time to change your dealer again. ??? Strange, when the debate hits bottom, accusations about doing drugs come up. This is like the third reference (and I don't even drink alcohol). mark -- https://mail.python.org/mailman/listinfo/python-list

Re: More About Unicode in Python 2 and 3

2014-01-06 Thread Mark Janssen
Really? If people are using binary with well-defined ascii-encoded tidbits, they're doing something wrong. Perhaps you think escape characters \n are well defined tidbits, but YOU WOULD BE WRONG. The purpose of binary is to keep things raw. WTF? If you want to participate in this

Re: More About Unicode in Python 2 and 3

2014-01-06 Thread Mark Janssen
Really? If people are using binary with well-defined ascii-encoded tidbits, they're doing something wrong. Perhaps you think escape characters \n are well defined tidbits, but YOU WOULD BE WRONG. The purpose of binary is to keep things raw. WTF? If you want to participate in this

Re: More About Unicode in Python 2 and 3

2014-01-06 Thread Mark Janssen
I would still point out that Kenneth and Armin are not the whole Python community. I never said they were the whole community, of course. But they are not outliers either. [...] Your whole argument seems to be that a couple revered (!!) individuals should see their complaints taken for

Re: More About Unicode in Python 2 and 3

2014-01-05 Thread Mark Janssen
Most of the complaints about Py3 are it's harder to get something started (or port from Py2). My answer is that it's easier to get something finished. I like all of this logic, it makes sense to me. But Armin and Kenneth have more experience than I do actually writing networking software.

Re: interactive help on the base object

2013-12-08 Thread Mark Janssen
On Sun, Dec 8, 2013 at 2:33 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sat, 07 Dec 2013 20:21:06 -0800, Mark Janssen wrote: Is it just me, or is this basically useless? class object | The most *base* type [[Terry Reedy:]] How about something like. The default

Re: interactive help on the base object

2013-12-08 Thread Mark Janssen
help(object) Help on class object in module builtins: class object | The most base type '''The default top superclass for all Python classes. Its methods are inherited by all classes unless overriden. ''' The root class for all Python classes. Its methods are inherited by all

Re: interactive help on the base object

2013-12-08 Thread Mark Janssen
What methods, if any does it provide? Are they all abstract? etc??? Pretty much nothing useful :-) py dir(object) [...] So (prodding the student), Why does everything inherit from Object if it provides no functionality? Practicality-beats-purity-yours? -- MarkJ Tacoma, Washington --

Re: interactive help on the base object

2013-12-08 Thread Mark Janssen
On Sun, Dec 8, 2013 at 6:44 PM, Chris Angelico ros...@gmail.com wrote: On Mon, Dec 9, 2013 at 10:01 AM, Mark Janssen dreamingforw...@gmail.com wrote: (Note bene: as a comparison, C++ is very UNAMBIGUOUS about this fact -- all objects inherit from concrete machine types, which is why

Re: interactive help on the base object

2013-12-07 Thread Mark Janssen
Is it just me, or is this basically useless? class object | The most *base* type [[Terry Reedy:]] How about something like. The default top *superclass* for all Python classes. How 'bout you fools just admit that you didn't realize you've been confused this whole time? (It *is* possible

Re: Extending the 'function' built-in class

2013-12-01 Thread Mark Janssen
Hi, I can't figure out how I can extend the 'function' built-in class. I tried: class test(function): def test(self): print(test) but I get an error. Is it possible ? It has to do with differing models of computation, and python isn't designed for this. Perhaps you're

Re: Newbie - Trying to Help a Friend

2013-11-19 Thread Mark Janssen
Think they just needed a starting point really to be honest as they can't get there head round it. Then the problem is that your friend doesn't understand one or more of the words being used. This is s necessary prerequisite for making an algorithm from a text description. Perhaps they don't

Re: New user's initial thoughts / criticisms of Python

2013-11-11 Thread Mark Janssen
On Mon, Nov 11, 2013 at 3:32 AM, Chris Angelico ros...@gmail.com wrote: On Mon, Nov 11, 2013 at 10:17 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Mon, 11 Nov 2013 21:39:27 +1100, Chris Angelico wrote: denormalizes it into a lookup table by creating 70 entries quoting the

Re: New user's initial thoughts / criticisms of Python

2013-11-09 Thread Mark Janssen
A little late, but a couple of cents worth more data: I've just got a few thoughts I'd like to share and ask about: * Why not allow floater=float(int1/int2) - rather than floater=float (int1)/float(int2)? This has to do with evaluation order, the stuff inside the parens gets evaluated first,

Re: New user's initial thoughts / criticisms of Python

2013-11-09 Thread Mark Janssen
I'd be interested to hear your thoughts on where the field of computer languages is heading, and how that affects the choice of languages for building web sites. Well, there aren't that many groupings towards which languages specialize for (not including embedded or other

Re: Languages for different purposes (was Re: New user's initial thoughts / criticisms of Python)

2013-11-09 Thread Mark Janssen
On Sat, Nov 9, 2013 at 2:58 PM, Chris Angelico ros...@gmail.com wrote: So, on what basis _would_ you choose a language for some purpose? Without speaking specifically of web development here, how do you choose a language? Most generally, you choose a language informed by the language

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-07 Thread Mark Janssen
Well let me try to explain why it is working and i have implemented one. I only need to refresh my memory it was almost 15 years ago. This is not the solution but this is why it is working. 65536=256^2=16^4=***4^8***=2^16 All of those values are indeed the same, and yet that is completely

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-07 Thread Mark Janssen
On Thu, Nov 7, 2013 at 6:17 PM, Chris Angelico ros...@gmail.com wrote: On Fri, Nov 8, 2013 at 1:05 PM, jonas.thornv...@gmail.com wrote: I guess what matter is how fast an algorithm can encode and decode a big number, at least if you want to use it for very big sets of random data, or

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-07 Thread Mark Janssen
I am not sure if it is just stupidness or laziness that prevent you from seeing that 4^8=65536. I can see that 4^8 = 65536. Now how are you going to render 65537? You claimed that you could render *any* number efficiently. What you've proven is that a small subset of numbers can be rendered

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-03 Thread Mark Janssen
Congratulations Jonas. My kill file for this list used to have only one name, but now has 2. You have more patience than I! Jonas just made mine seven. :) Gosh, don't kill the guy. It's not an obvious thing to hardly anyone but computer scientists. It's an easy mistake to make. --

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-03 Thread Mark Janssen
Note that I *can* make a compression algorithm that takes any length-n sequence and compresses all but one sequence by at least one bit, and does not ever expand the data. 00 - 01 - 0 10 - 1 11 - 00 This, obviously, is just 'cause the length is an extra piece of data, but sometimes you

Re: Algorithm that makes maximum compression of completly diffused data.

2013-11-02 Thread Mark Janssen
)...)) and eventually the result get down to a single bit. I hope it is clear that there's no way to restore a single bit back into different source texts. Hey, that's a nice proof! Cheers, Mark Janssen -- https://mail.python.org/mailman/listinfo/python-list

Re: Algorithm that makes maximum compression of completly diffused data.

2013-10-30 Thread Mark Janssen
On Wed, Oct 30, 2013 at 11:21 AM, jonas.thornv...@gmail.com wrote: I am searching for the program or algorithm that makes the best possible of completly (diffused data/random noise) and wonder what the state of art compression is. Is this an April Fool's Joke? A key idea of completely

Re: Python Front-end to GCC

2013-10-27 Thread Mark Janssen
the homework of computer science. Ask him. Otherwise, most of this, while sloppy, still stands. Mark Janssen Tacoma, Washington -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Front-end to GCC

2013-10-26 Thread Mark Janssen
[Getting back to some old comments] A language specification in BNF is just syntax. It doesn't say anything about semantics. So how could this be used to produce executable C code for a program? BNF is used to produce parsers. But a parser isn't sufficient. A C program is just syntax

Re: Python Front-end to GCC

2013-10-26 Thread Mark Janssen
Apologies will be accepted on the list. BTW, I can't resist pointing out that you guys are like a cup already full of (black) coffee -- too full to allow the pure water of clarity to enter. (cf. Buddhism) .. (boom) MarkJanssen Tacoma, Washington --

Re: Python Front-end to GCC

2013-10-26 Thread Mark Janssen
What a mess of a discussion. I see the big man stepping in to answer for his homies, but while his explanation satisfies their question of well why do these magic values get used then, if what Mark says is true?, it doesn't address the real confusion: What is the difference between script code

Re: Python Front-end to GCC

2013-10-25 Thread Mark Janssen
On Thu, Oct 24, 2013 at 8:40 PM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 22/10/2013 18:37, Oscar Benjamin wrote: OTOH why in particular would you want to initialise them with zeros? I often initialise arrays to nan which is useful for debugging. Is this some kind of joke? What has

Re: Python Front-end to GCC

2013-10-25 Thread Mark Janssen
OTOH why in particular would you want to initialise them with zeros? I often initialise arrays to nan which is useful for debugging. Is this some kind of joke? What has this list become? It's a useful debugging technique to initialize memory to distinctive values that should never occur in

Re: Python Front-end to GCC

2013-10-25 Thread Mark Janssen
OTOH why in particular would you want to initialise them with zeros? I often initialise arrays to nan which is useful for debugging. Is this some kind of joke? What has this list become? It's a useful debugging technique to initialize memory to distinctive values that should never occur in

Re: Python Front-end to GCC

2013-10-25 Thread Mark Janssen
On Fri, Oct 25, 2013 at 11:59 AM, rusi rustompm...@gmail.com wrote: On Saturday, October 26, 2013 12:15:43 AM UTC+5:30, zipher wrote: Clearly the python list has been taken over by TheKooks. Notice he did not respond to the request. Since we are talking about digital computers (with digital

Re: Python Front-end to GCC

2013-10-25 Thread Mark Janssen
to anything but 0 -- UNLESS you're from Stupid University. Thanks for providing fodder... Mark Janssen, Ph.D. Tacoma, WA -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Front-end to GCC

2013-10-25 Thread Mark Janssen
As for the hex value for Nan who really gives a toss? The whole point is that you initialise to something that you do not expect to see. Do you not have a text book that explains this concept? No, I don't think there is a textbook that explains such a concept of initializing memory to

Re: Python Front-end to GCC

2013-10-25 Thread Mark Janssen
We've been discussing *DEBUGGING*. Are you making it LOUD and *clear* that you don't know what you're talking about? Input: Yes/no no Now please explain what you do not understand about the data below that's been written by Oscar Benjamin, myself and Ned Batchelder, specifically the

Re: Python Front-end to GCC

2013-10-25 Thread Mark Janssen
But OTOH, it can also be explained away entirely by (as you previously noted) the Dunning-Kruger effect, with the same uninformed responses trotted out to everything. It was rusi who first mentioned this, I merely replied in my normal dead pan way. Slight aside, I spelt your surname

Re: Python Front-end to GCC

2013-10-25 Thread Mark Janssen
On Fri, Oct 25, 2013 at 2:07 PM, Ned Batchelder n...@nedbatchelder.com wrote: (Offlist) Mark, these conversations would go much more smoothly if you would make direct statements about technical points. Your messages are usually insinuating questions, or personal insults. Yes, thank you.

Re: Python Front-end to GCC

2013-10-22 Thread Mark Janssen
claim parses). So which of you is confused? I ask that in the inclusive (not exclusive OR) sense ;^) -- face says both. Mark Janssen Tacoma, Washington. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Front-end to GCC

2013-10-22 Thread Mark Janssen
So which of you is confused? I ask that in the inclusive (not exclusive OR) sense ;^) -- face says both. Could you please be less snarky? We're trying to communicate here, and it is not at all clear yet who is confused and who is not. If you are interested in discussing technical

Re: Python Front-end to GCC

2013-10-22 Thread Mark Janssen
So which of you is confused? I ask that in the inclusive (not exclusive OR) sense ;^) -- face says both. Could you please be less snarky? Okay. The purpose of BNF (at least as I envision it) is to produce/specify a *context-free* grammar. A lexer parses the tokens specified in the

Re: Python Front-end to GCC

2013-10-22 Thread Mark Janssen
Okay. The purpose of BNF (at least as I envision it) is to produce/specify a *context-free* grammar. A lexer parses the tokens specified in the BNF into an Abstract Syntax Tree. If one can produce such a tree for any given source, the language, in theory, can be compiled by GCC into an

Re: Python Front-end to GCC

2013-10-22 Thread Mark Janssen
Is your language Turing complete? 1) No, it's not. 2) So what? That should make it easier to compile to C, if anything. 3) Don't change the subject. Well, if your language is not Turing complete, it is not clear that you will be able to compile it at all. That's the difference between

Re: Python Front-end to GCC

2013-10-21 Thread Mark Janssen
On Mon, Oct 21, 2013 at 12:46 AM, Steven D'Aprano st...@pearwood.info wrote: On Sun, 20 Oct 2013 20:35:03 -0700, Mark Janssen wrote: [Attribution to the original post has been lost] Is a jit implementation of a language (not just python) better than traditional ahead of time compilation

Re: Python Front-end to GCC

2013-10-21 Thread Mark Janssen
On Mon, Oct 21, 2013 at 4:08 AM, Philip Herron herron.phi...@googlemail.com wrote: Thanks, i've been working on this basically on my own 95% of the compiler is all my code, in my spare time. Its been fairly scary all of this for me. I personally find this as a real source of interest to

Re: Python Front-end to GCC

2013-10-21 Thread Mark Janssen
No its not like those 'compilers' i dont really agree with a compiler generating C/C++ and saying its producing native code. I dont really believe its truely within the statement. Compilers that do that tend to put in alot of type saftey code and debugging internals at a high level to get

Re: Python Front-end to GCC

2013-10-21 Thread Mark Janssen
A language specification in BNF is just syntax. It doesn't say anything about semantics. So how could this be used to produce executable C code for a program? BNF is used to produce parsers. But a parser isn't sufficient. A C program is just syntax also. How does the compiler generate

Re: Python Front-end to GCC

2013-10-20 Thread Mark Janssen
Gccpy is an Ahead of time implementation of Python ontop of GCC. So it works as you would expect with a traditional compiler such as GCC to compile C code. Or G++ to compile C++ etc. That is amazing. I was just talking about how someone should make a front-end to GCC on this list a couple of

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-17 Thread Mark Janssen
Prior to that [the '70s] you have punch cards where there's no meaningful definition of parsing because there are no tokens. I have no idea what you mean by this. [...] You seem drawn to sweeping statements about the current state and history of computer science, but then make claims like

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-17 Thread Mark Janssen
On Thu, Oct 17, 2013 at 10:32 AM, rusi rustompm...@gmail.com wrote: On Wednesday, October 16, 2013 1:56:27 AM UTC+5:30, zipher wrote: Yes, well clearly we are not having the same thoughts, yet the purpose of the academic establishment is to pin down such terminology and not have these sloppy

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-17 Thread Mark Janssen
On Thu, Oct 17, 2013 at 3:10 PM, Ethan Furman et...@stoneleaf.us wrote: On 10/17/2013 01:57 PM, Ned Batchelder wrote: Read and listen more. Write and say less. Mark Janssen has no interest in learning. From a thread long-ago: Mark Janssen wrote: Ethan Furman wrote: Mark Janssen

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-17 Thread Mark Janssen
It's like this. No matter how you cut it, you're going to get back to the computers where you load instructions with switches. At that point, I'll be very much looking in anticipation to your binary-digit lexer. Why stop there? If you go back far enough, you've got Babbage with his

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Mark Janssen
On Tue, Oct 15, 2013 at 2:46 PM, Grant Edwards invalid@invalid.invalid wrote: On 2013-10-15, Mark Janssen dreamingforw...@gmail.com wrote: Yeah, well 40 years ago they didn't have parsers. That seems an odd thing to say. People were assembling and compiling computer programs long before 1973

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Mark Janssen
Types on the other hand correspond to our classifications and so are things in our minds. That is not how a C programmer views it. They have explicit typedefs that make it a thing for the computer. Speaking as a C programmer, no. We have explicit typedefs to create new labels for

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Mark Janssen
Who uses object abstraction in C? No one. That's why C++ was invented. If not, Linux, how about Python? http://hg.python.org/cpython/file/e2a411a429d6/Objects Or huge slabs of the OS/2 Presentation Manager, which is entirely object oriented and mostly C. It's done with SOM, so it's

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-16 Thread Mark Janssen
And your earlier idea that punched cards didn't have tokens is wildly ignorant of the state of software and languages 50 years ago. Please tell me how you parsed tokens with binary switches 50 years ago. Your input is rubbish. -- MarkJ Tacoma, Washington --

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-15 Thread Mark Janssen
Objects in programming languages (or 'values' if one is more functional programming oriented) correspond to things in the world. One of the things you're saying there is that values correspond to things in the world. But you will not get agreement in computer science on that anymore than

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-14 Thread Mark Janssen
On Mon, Oct 14, 2013 at 12:18 PM, John Nagle na...@animats.com wrote: On 10/12/2013 3:37 PM, Chris Angelico wrote: On Sat, Oct 12, 2013 at 7:10 AM, Peter Cacioppi peter.cacio...@gmail.com wrote: Along with batteries included and we're all adults, I think Python needs a pithy phrase

Re: Python was designed (was Re: Multi-threading in Python vs Java)

2013-10-14 Thread Mark Janssen
Python objects have dynamic operations suited to a naive interpreter like CPython. Naive, no. Naive, in this instance, means executing code exactly as written, without optimizing things (and it's not an insult, btw). In that case, you're talking about a non-optimizing interpreter, but

Re: Formal-ity and the Church-Turing thesis

2013-10-08 Thread Mark Janssen
I don't have an infinite stack to implement lambda calculus, but... And then But this is not a useful formalism. Any particular Program implements a DFA, even as it runs on a TM. The issue of whether than TM is finite or not can be dismissed because a simple calculation can usually

Re: Tail recursion to while iteration in 2 easy steps

2013-10-07 Thread Mark Janssen
That's fine. My point was: you can't at the same time have full dynamicity *and* procedural optimizations (like tail call opt). Everybody should be clear about the trade-off. Your wrong. Full dynamics is not in contradiction with tail call optimisation. Scheme has already done it for years.

Re: Tail recursion to while iteration in 2 easy steps

2013-10-07 Thread Mark Janssen
Only that you've got a consistent, stable (and therefore, formalizable) translation from your language to the machine. That's all. Everything else is magic. Do you know that the Warren Abstraction Engine used to power the predicate logic in Prolog into machien code for a VonNeumann machine

Re: Tail recursion to while iteration in 2 easy steps

2013-10-07 Thread Mark Janssen
On Mon, Oct 7, 2013 at 4:50 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Mon, 07 Oct 2013 15:47:26 -0700, Mark Janssen wrote: I challenge you to get down to the machine code in scheme and formally describe how it's doing both. For which machine? Right, I should stop

Re: Tail recursion to while iteration in 2 easy steps

2013-10-07 Thread Mark Janssen
But even putting that aside, even if somebody wrote such a description, it would be reductionism gone mad. What possible light on the problem would be shined by a long, long list of machine code operations, even if written using assembly mnemonics? Only that you've got a consistent, stable

Re: Tail recursion to while iteration in 2 easy steps

2013-10-07 Thread Mark Janssen
Yeah, and this is where two models of computation have been conflated, creating magical effects, confusing everybody. I challenge you to get down to the machine code in scheme and formally describe how it's doing both. Which two models of computation are you talking about? And what magica;

Re: Formal-ity and the Church-Turing thesis

2013-10-07 Thread Mark Janssen
On Tuesday, October 8, 2013 5:54:10 AM UTC+5:30, zipher wrote: Now, one can easily argue that I've gone too far to say no one has understood it (obviously), so it's very little tongue-in-cheek, but really, when one tries to pretend that one model of computation can be substituted for another

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Mark Janssen
def fact(n): return 1 if n = 1 else n * fact(n-1) into a tail recursion like [...] How do know that either = or * didn't rebind the name fact to something else? I think that's the main reason why python cannot apply any procedural optimization (even things like inlining are impossible, or

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Mark Janssen
On Wed, Oct 2, 2013 at 1:23 PM, Alain Ketterlin al...@unistra.fr wrote: On 10/02/2013 08:59 PM, Mark Janssen wrote: def fact(n): return 1 if n = 1 else n * fact(n-1) How do know that either = or * didn't rebind the name fact to something else? I think that's the main reason why python cannot

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Mark Janssen
Part of the reason that Python does not do tail call optimization is that turning tail recursion into while iteration is almost trivial, once you know the secret of the two easy steps. Here it is. That should be a reason it _does_ do it - saying people should rewrite their functions with

Re: What minimum should a person know before saying I know Python

2013-09-20 Thread Mark Janssen
I started Python 4 months ago. Largely self-study with use of Python documentation, stackoverflow and google. I was thinking what is the minimum that I must know before I can say that I know Python? Interesting. I would say that you must know the keywords, how to make a Class, how to write

Re: Language design

2013-09-14 Thread Mark Janssen
into making an equivocation of sorts. It's subtle and no one in the field has noticed it. It crept in slowly and imperceptively. Ah, and now we come to the heart of the matter -- people have been drawing tree-structures with the root at the top of the page for centuries, and Mark Janssen

Re: Language design

2013-09-13 Thread Mark Janssen
On Fri, Sep 13, 2013 at 4:57 PM, Chris Angelico ros...@gmail.com wrote: Evangelical vicar in want of a portable second-hand font. Would dispose, for the same, of a portrait, in frame, of the Bishop-elect of Vermont. I think you could quite easily reconstruct the formatting of that, based on

Re: Language design

2013-09-12 Thread Mark Janssen
Really? Are you saying you (and the community at-large) always derive from Object as your base class? Not directly, that would be silly. Silly? Explicit is better than implicit... right? But wait is it the base (at the bottom of the hierarchy) or is it the parent at the top? You see,

Re: Language design

2013-09-11 Thread Mark Janssen
* Imports are fiendishly complex, hidden below deceptively simple syntax. It's a reasonable expectation that one can import a module from a source code file given its path on the filesystem, but this turns out to be much more complicated than in many other languages. Why is this so

Re: Language design

2013-09-11 Thread Mark Janssen
1) It tried to make Object the parent of every class. No one's close enough to God to make that work. 2) It didn't make dicts inherit from sets when they were added to Python. 3) It used the set literal for dict, so that there's no obvious way to do it. This didn't get changed in Py3k. 4?) It

Re: Language design

2013-09-11 Thread Mark Janssen
On Tue, 10 Sep 2013, Ben Finney wrote: The sooner we replace the erroneous “text is ASCII” in the common wisdom with “text is Unicode”, the better. I'd actually argue that it's better to replace the common wisdom with text is binary data, and we should normally look at that text

Re: Language design

2013-09-11 Thread Mark Janssen
Why is this so difficult? Add a Graph class to the collections module (networkx is quite good) and simply check for circular imports. Er? That doesn't address the task of importing a module from a source code file given its path on the filesystem. That's true, I guess was hooked on Python's

Re: Language design

2013-09-11 Thread Mark Janssen
Unicode is not 16-bit any more than ASCII is 8-bit. And you used the word encod[e], which is the standard way to turn Unicode into bytes anyway. No, a Unicode string is a series of codepoints - it's most similar to a list of ints than to a stream of bytes. Okay, now you're in blah, blah land.

Re: Language design

2013-09-11 Thread Mark Janssen
1) It tried to make Object the parent of every class. Tried, and succeeded. Really? Are you saying you (and the community at-large) always derive from Object as your base class? No one's close enough to God to make that work. Non-sequitor. One doesn't need to be close to a deity to have a

Casting classes WAS: Documenting builtin methods

2013-07-11 Thread Mark Janssen
A user was wondering why they can't change a docstring in a module's class. This made me think: why not have a casting operator (reciprocal?) to transform a bonafide class into a mere carcass of a class which can then modified and reanimated back into its own type with the type function? Such

Re: Documenting builtin methods

2013-07-10 Thread Mark Janssen
I have this innocent and simple code: from collections import deque exhaust_iter = deque(maxlen=0).extend exhaust_iter.__doc__ = Exhaust an iterator efficiently without caching any of its yielded values. Obviously it does not work. Is there a way to get it to work simply and without

Re: how to calculate reputation

2013-07-02 Thread Mark Janssen
Hi all, this seems to be quite stupid question but I am confused.. We set the initial value to 0, +1 for up-vote and -1 for down-vote! nice. I have a list of bool values True, False (True for up vote, False for down-vote).. submitted by users. should I take True = +1, False=0 [or] True =

Re: What is the semantics meaning of 'object'?

2013-06-29 Thread Mark Janssen
On 26/06/2013 9:19 AM, Mark Janssen wrote: Did you ever hear of the Glass Bead Game? Which was Hesse's condemnation of the pure-academic-understanding-unbound-by-pragmatic-use approach as mental masturbation, It was not. He was conflicted. On the one hand he knew the enterprise was noble

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Mark Janssen
This bothers me as well. If you look at Raymond Hettinger's super() considered super article, he includes the (correct) advice that super() needs to be used at every level of the call chain. At the end of the article, he offers this example to show how easy multiple inheritance can be:

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Mark Janssen
So instead of super(), you would have sub()? It's an interesting concept, but I don't think it changes anything. You still have to design your classes cooperatively if you expect to use them with multiple inheritance. Yes, and let new instances of the child classes automatically ensure the

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Mark Janssen
The main problem is getting to the top/end of the call chain. Classic example is with __init__, but the same problem can also happen with other calls. Just a crazy theory, but would it be possible to construct a black-holing object that, for any given method name, returns a dummy function

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Mark Janssen
Sorry my last message got sent prematurely. Retrying... So instead of super(), you would have sub()? It's an interesting concept, but I don't think it changes anything. You still have to design your classes cooperatively if you expect to use them with multiple inheritance. Yes, and let

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Mark Janssen
Combining integers with sets I can make a Rational class and have infinite-precision arithmetic, for example. Combining two integers lets you make a Rational. Ah, but what is going to group them together? You see you've already gotten seduced. Python already uses a set to group them

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Mark Janssen
Here's how it *should* be made: the most superest, most badassed object should take care of its children. New instances should automatically call up the super chain (and not leave it up to the subclasses), so that the parent classes can take care of the chil'en. When something goes wrong

Re: What is the semantics meaning of 'object'?

2013-06-25 Thread Mark Janssen
Combining two integers lets you make a Rational. Ah, but what is going to group them together? You see you've already gotten seduced. Python already uses a set to group them together -- it's called a Dict and it's in every Class object. When you inherit a set to make a Rational, you're

Re: What is the semantics meaning of 'object'?

2013-06-24 Thread Mark Janssen
Mostly I'm saying that super() is badly named. What else would you call a function that does lookups on the current object's superclasses? ^. You make a symbol for it. ^__init__(foo, bar) -- MarkJ Tacoma, Washington -- http://mail.python.org/mailman/listinfo/python-list

Re: n00b question on spacing

2013-06-24 Thread Mark Janssen
On Mon, Jun 24, 2013 at 4:48 PM, alex23 wuwe...@gmail.com wrote: On 23/06/2013 3:43 AM, Mark Janssen wrote: There was a recent discussion about this (under implicit string concatenation). It seems this is a part of the python language specification that was simply undefined. It's part

Re: n00b question on spacing

2013-06-22 Thread Mark Janssen
Also remember when entering long lines of text that strings concatenate within parenthesis. So, (a, b, c d, e, f g, h, i) Is the same as (a, b, cd, e, fg, h, i) There was a recent discussion about this (under implicit string concatenation). It seems this is a part of the python language

Re: Compiling vs interpreting [was Re: A certainl part of an if() structure never gets executed.]

2013-06-16 Thread Mark Janssen
Whats the difference of interpreting to compiling ? OK, I give up! Actually, that's a more subtle question than most people think. Python, for example, is a compiled language. (What did you think the c in .pyc files stood for? and the compile() function?) Careful there. This terminology

Re: My son wants me to teach him Python

2013-06-13 Thread Mark Janssen
Despite not want to RTFM as you say, you might set him in front of VPython, type I totally forgot PyGame -- another likely source of self-motivated learning for a teen programmer. -- MarkJ Tacoma, Washington -- http://mail.python.org/mailman/listinfo/python-list

Re: Don't rebind built-in names* - it confuses readers

2013-06-12 Thread Mark Janssen
list = [] Reading further, one sees that the function works with two lists, a list of file names, unfortunately called 'list', That is very good advice in general: never choose a variable name that is a keyword. -- MarkJ Tacoma, Washington --

Re: Re-using copyrighted code

2013-06-12 Thread Mark Janssen
At least partially, my confusion seems to be caused by the dichotomy of the concepts of copyright and license. How do these relate to each other? A license emerges out of the commercial domain is purely about commercial protections. I should clarify, that commercial protections here means

Re: Don't rebind built-in names* - it confuses readers

2013-06-12 Thread Mark Janssen
On Wed, Jun 12, 2013 at 7:24 AM, Grant Edwards invalid@invalid.invalid wrote: On 2013-06-11, Mark Janssen dreamingforw...@gmail.com wrote: list = [] Reading further, one sees that the function works with two lists, a list of file names, unfortunately called 'list', That is very good

Re: Don't rebind built-in names* - it confuses readers

2013-06-12 Thread Mark Janssen
You're right. I was being sloppy. ['ArithmeticError', 'AssertionError', 'AttributeError', 'BaseException', 'BlockingIOError', 'BrokenPipeError', 'BufferError', 'BytesWarning', 'ChildProcessError', 'ConnectionAbortedError', 'ConnectionError', 'ConnectionRefusedError', 'ConnectionResetError',

  1   2   3   >