Re: Moderation and slight change of (de facto) policy

2016-04-19 Thread Random832
On Tue, Apr 19, 2016, at 12:05, Steven D'Aprano wrote: > It's worse than that. There are many other places that mirror this group, > such as gmane, Activestate, bytes.com, gossamer-threads.com, and of > course > Google Groups. Google groups goes through Usenet, and would be affected equally by

Re: Guido sees the light: PEP 8 updated

2016-04-19 Thread Random832
On Tue, Apr 19, 2016, at 08:55, Rustom Mody wrote: > > Like, it ends up looking like this: > > > > if foo("what if it's a much longer condition"):# comment > > do something # > >

Re: Guido sees the light: PEP 8 updated

2016-04-18 Thread Random832
On Mon, Apr 18, 2016, at 23:54, Rustom Mody wrote: > Start no tabs: > if foo# comment that is aligned > do some stuff# across multiple indent levels > > Add tabs as leading indents with second line indented 1 tab more > (showing tabs as |) > |if foo# comment that is aligned > ||do some stuff#

Re: Guido sees the light: PEP 8 updated

2016-04-18 Thread Random832
On Mon, Apr 18, 2016, at 23:04, Rustom Mody wrote: > See elastic tabstops: http://nickgravgaard.com/elastic-tabstops/ >From there: >A column block is a run of uninterrupted vertically adjacent cells. How's that going to handle this case: if foo: # comment that is aligned do some

Re: QWERTY was not designed to intentionally slow typists down (was: Unicode normalisation [was Re: [beginner] What's wrong?])

2016-04-17 Thread Random832
On Sun, Apr 17, 2016, at 21:39, Steven D'Aprano wrote: > Oh no, it's the thread that wouldn't die! *wink* > > Actually, yes it is. At least, according to this website: > > http://www.mit.edu/~jcb/Dvorak/history.html I'd really rather see an instance of the claim not associated with Dvorak

Re: Guido sees the light: PEP 8 updated

2016-04-17 Thread Random832
On Sun, Apr 17, 2016, at 19:56, Gregory Ewing wrote: > And then legacy command-line exes will be supported by running > cmd.exe under WINE in the Linux subsystem. Running the command directly under WINE, more like. Because cmd.exe is pretty terrible as a scripting language and command interpreter

Re: Moderation and slight change of (de facto) policy

2016-04-17 Thread Random832
On Sun, Apr 17, 2016, at 18:08, Matt Ruffalo wrote: > Hi- > > That seems like a reasonable approach, though I think there *really* > needs to be an option along the lines of "subscribed to the list for the > purposes of moderation, but not receiving list messages via email". There is. I'm on

Re: Guido sees the light: PEP 8 updated

2016-04-16 Thread Random832
On Sun, Apr 17, 2016, at 01:01, eryk sun wrote: > It doesn't support fonts that mix half-width and full-width glyphs. This is the most baffling bit to me. I mean, it _has_ to, for Chinese, Japanese, and Korean users. This support obviously exists in the code. Why not extend it to everyone,

Re: Guido sees the light: PEP 8 updated

2016-04-16 Thread Random832
On Sat, Apr 16, 2016, at 21:30, Tim Chase wrote: > On 2016-04-16 19:39, eryk sun wrote: > > On Sat, Apr 16, 2016 at 4:50 PM, Tim Chase wrote: > > > I also do some editing/diffing within a cmd.exe window on Windows > > > which is limited to 80 characters unless you do some hijinks in > > > the

Re: Fraud

2016-04-16 Thread Random832
On Sat, Apr 16, 2016, at 20:20, Joel Goldstick wrote: > As it turns out, the OP hasn't engaged in any further back and forth, > which to me enforces my original post. It's entirely possible he's not subscribed to the mailing list. -- https://mail.python.org/mailman/listinfo/python-list

Re: Falsehoods People Believe about PEP 8 (was: Guido sees the light: PEP 8 updated)

2016-04-16 Thread Random832
On Sat, Apr 16, 2016, at 16:21, Ben Finney wrote: > * Oh, come on, no-one would use U+000C FORM FEED in source code. Some text editors have shortcuts to navigate to the previous/next line that begins with a form feed. -- https://mail.python.org/mailman/listinfo/python-list

[issue17859] improve error message for saving ints to file

2016-04-16 Thread random832
random832 added the comment: This bug should be closed since #16518 was accepted and the error is now "TypeError: a bytes-like object is required, not 'int'" -- nosy: +random832 ___ Python tracker <rep...@bugs.python.org> <htt

[issue26781] os.walk max_depth

2016-04-16 Thread random832
random832 added the comment: Wouldn't the "symlink infinite loop" case be better handled by making it track where it's already been? This can be done by inode and dev number on Unix; I'm not sure what equivalent exists on Windows (though symlinks are uncommon on Windows) but you

Re: installing python

2016-04-14 Thread Random832
On Thu, Apr 14, 2016, at 13:59, Cheryl Arko wrote: > I am having issues installing the python software on my laptop. I have > tried to install it several times and when I try to get into the program > it > keeps giving me options to modify, repair or uninstall. I have tried all > of those

Re: how to setup for localhost:8000

2016-04-14 Thread Random832
Just a note, some browsers will try to resolve this as www.localhost.com - try http://127.0.0.1:8000 . On Thu, Apr 14, 2016, at 14:06, Andrew Farrell wrote: > What happens when you type > > http://localhost:8000 > > Into the address bar of your browser as this is running? --

Re: sum accuracy

2016-04-13 Thread Random832
On Wed, Apr 13, 2016, at 12:51, Robin Becker wrote: > Does anyone know if sum does anything special to try and improve > accuracy? My > simple tests seem to show it is exactly equivalent to a for loop > summation. No, it doesn't. Sum works on any type that can be added (except strings), it can't

Re: sys.exit(1) vs raise SystemExit vs raise

2016-04-12 Thread Random832
On Tue, Apr 12, 2016, at 10:12, Ganesh Pal wrote: > > > > > > No; raise SystemExit is equivalent to sys.exit(0); you would need raise > > SystemExit(1) to return 1. > > > > Thanks will replace SystemExit with SystemExit(1) . > > > > > Why do you want to do this, though? What do you think you

Re: sys.exit(1) vs raise SystemExit vs raise

2016-04-12 Thread Random832
On Tue, Apr 12, 2016, at 08:50, Ganesh Pal wrote: > I m on python 2.7 and Linux , I have a simple code need suggestion if > I > I could replace sys.exit(1) with raise SystemExit . No; raise SystemExit is equivalent to sys.exit(0); you would need raise SystemExit(1) to return 1. Why do you

Re: Is threading better on Usenet or gmane?

2016-04-11 Thread Random832
On Mon, Apr 11, 2016, at 10:24, Grant Edwards wrote: > I've been reading c.l.p on Usenet for many, many years. There has > always been a certain abount of thread breakage (presumably due to > broken e-mail clients and/or the list<->usenet gateway), but it seems > to have gotten worse lately. > >

Re: Parens do create a tuple

2016-04-11 Thread Random832
On Mon, Apr 11, 2016, at 04:01, Steven D'Aprano wrote: > What tuple that is passed to FunctionType.__call__? > > Where is the tuple in these examples? > > > py> from types import FunctionType > py> FunctionType.__call__(lambda x: x+1, 23) > 24 > py> FunctionType.__call__(lambda x, y:

Re: Parens do create a tuple

2016-04-10 Thread Random832
On Mon, Apr 11, 2016, at 00:08, Steven D'Aprano wrote: > Should we say that the / and - operators therefore create tuples? I don't > think so. But I am talking about the tuple that is passed to FunctionType.__call__ at runtime, not a tuple created within some parser stage. --

Re: Parens do create a tuple

2016-04-10 Thread Random832
On Sun, Apr 10, 2016, at 22:32, Steven D'Aprano wrote: > def func(arg1, arg2, arg3): > pass > > func(1, 2, 3) > > does not create a tuple (1, 2, 3) anywhere in its execution. Well, the second argument to PyObject_Call and function_call is a tuple, which had to come from somewhere. That may

Re: Unacceptable behavior

2016-04-10 Thread Random832
On Sun, Apr 10, 2016, at 13:15, breamore...@gmail.com wrote: > Or are you in the camp that believes when someone > is too bone idle to do any work for themselves, and turns up here asking > for us to write all of their code for them, we should kill the fatted > calf, roll out the red carpet, and

Re: how to convert code that uses cmp to python3

2016-04-09 Thread Random832
On Sat, Apr 9, 2016, at 07:49, Ben Finney wrote: > I find that a dubious claim. > > The ‘cmp’ implementation must decide *at least* between three > conditions: less-than, equal-to, greater-than. That is *at least* two > inflection points. Yes, but in a sequence it can decide that at each

Re: QWERTY was not designed to intentionally slow typists down (was: Unicode normalisation [was Re: [beginner] What's wrong?])

2016-04-09 Thread Random832
On Fri, Apr 8, 2016, at 23:28, Steven D'Aprano wrote: > This is the power of the "slowing typists down is a myth" meme: same > Wikipedia contributor takes an article which *clearly and obviously* > repeats the conventional narrative that QWERTY was designed to > decrease the number of key presses

Re: QWERTY was not designed to intentionally slow typists down (was: Unicode normalisation [was Re: [beginner] What's wrong?])

2016-04-09 Thread Random832
On Fri, Apr 8, 2016, at 23:28, Steven D'Aprano wrote: > And how did it enable fast typing? By *slowing down the typist*, and thus > having fewer jams. Er, no? The point is that type bars that are closer together collide more easily *at the same actual typing speed* than ones that are further

Re: Repair??

2016-04-09 Thread Random832
- Original message - From: Amaya McLean <mcleamay...@gotvdsb.ca> To: Random832 <random...@fastmail.com> Subject: Re: Repair?? Date: Sat, 9 Apr 2016 10:41:52 -0400 How, specifically, are you installing Python? There are many ways, and > we can't guess which you use. > I'm

Re: Repair??

2016-04-08 Thread Random832
I suspect that the reason that a lot of people who report issues like this don't seem to follow up is that they may not be subscribed to the list, and replies are sent to the list exclusively. Quoting the entire reply so they see it. On Fri, Apr 8, 2016, at 21:24, Ben Finney wrote: > Amaya

test post please ignore

2016-04-08 Thread Random832
Testing posting from an email address other than the one I'm subscribed in, to determine whether it's possible to post to the list without being subscribed. -- https://mail.python.org/mailman/listinfo/python-list

Re: how to convert code that uses cmp to python3

2016-04-08 Thread Random832
On Fri, Apr 8, 2016, at 10:08, Chris Angelico wrote: > seq1 == seq2 > seq1 < seq2 > > You only need ONE comparison, and the other is presumed to be its > opposite. When, in the Python 3 version, would you need to compare > twice? == might be just as expensive as the others, particularly if the

Re: Untrusted code execution

2016-04-07 Thread Random832
On Thu, Apr 7, 2016, at 08:13, Jon Ribbens wrote: > > All the obvious, and even not-so-obvious, attack tools are gone: > > eval, exec, getattr, type, __import__. We don't even need to take these away, per se. eval and exec could be replaced with functions that perform the evaluation with the

Re: Untrusted code execution

2016-04-07 Thread Random832
On Thu, Apr 7, 2016, at 00:48, Steven D'Aprano wrote: > Sure, but I'm just demonstrating that the unrestricted builtins are just > one > attribute lookup away. And as Chris points out, if you have (say) the os > module, then: > > magic = os.sys.modules[ > ''.join(chr(i-1) for i in >

Re: read a file and remove Mojibake chars

2016-04-07 Thread Random832
On Thu, Apr 7, 2016, at 04:47, Daiyue Weng wrote: > Hi, when I read a file, the file string contains Mojibake chars at the > beginning, the code is like, > > file_str = open(file_path, 'r', encoding='utf-8').read() > print(repr(open(file_path, 'r', encoding='utf-8').read()) > > part of the

Re: Untrusted code execution

2016-04-06 Thread Random832
On Wed, Apr 6, 2016, at 21:45, Steven D'Aprano wrote: > And you would have to do something about the unfortunate matter that > modules > have a reference to the unrestricted __builtins__: > > py> os.__builtins__['eval'] > Well, I thought that the solution being discussed uses AST to generally

Re: recursive methods require implementing a stack?

2016-04-06 Thread Random832
On Wed, Apr 6, 2016, at 16:21, Charles T. Smith wrote: > I just tried to write a recursive method in python - am I right that > local > variables are only lexically local scoped, so sub-instances have the same > ones? Is there a way out of that? Do I have to push and pop my own > simulated >

Re: Promoting Python

2016-04-06 Thread Random832
On Wed, Apr 6, 2016, at 14:23, Marko Rauhamaa wrote: > Chris Angelico : > > > Plus, anyone could implement a Python interpreter with TCE. > > Tricky in practice because None is the default return value. > > If the programmer were careful to return the value of the tail call,

Re: Untrusted code execution

2016-04-06 Thread Random832
On Wed, Apr 6, 2016, at 12:04, Chris Angelico wrote: > On Thu, Apr 7, 2016 at 1:41 AM, Ian Kelly wrote: > > type might also be a concern since it can be used to assemble > > arbitrary classes. > > Sadly, this means denying the ability to interrogate an object for its >

Re: Untrusted code execution

2016-04-06 Thread Random832
On Tue, Apr 5, 2016, at 21:43, Steven D'Aprano wrote: > As Zooko says, Guido's "best argument is that reducing usability (in > terms > of forbidding language features, especially module import) and reducing > the > usefulness of extant library code" would make the resulting interpreter > too >

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-06 Thread Random832
On Tue, Apr 5, 2016, at 17:37, Nagy László Zsolt wrote: > > >> It is blurred by design. There is an interpretation where an interval > >> between [0..4] equals to a set of intervals ([0..2],[2..4]). > > No, because 2.5 is in one and not the other. > My notation was: 0..4 for any number between 0

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-05 Thread Random832
On Tue, Apr 5, 2016, at 04:11, Nagy László Zsolt wrote: > But there is still need to check begin <= end. But maybe > you are right: if we suppose that nobody will try to use an interval > where end < begin then we can use plain tuples. But then the user *must* > make sure not to use invalid

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-05 Thread Random832
On Tue, Apr 5, 2016, at 01:44, Nagy László Zsolt wrote: > If you want to manipulate an interval set, you cannot just "add another > interval" to it. Adding an interval may result in unifying thousands of > other intervals. It is possible that you add a wide interval to a set > with 1000 elements,

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Random832
On Mon, Apr 4, 2016, at 11:32, Oscar Benjamin wrote: > On 4 April 2016 at 16:09, Random832 <random...@fastmail.com> wrote: > > Like I said before, I don't think the set-like operations on Intervals > > are useful - what can you accomplish with them rather than by making

Re: Set type for datetime intervals

2016-04-04 Thread Random832
On Mon, Apr 4, 2016, at 06:15, Nagy László Zsolt wrote: > If you define the intersection operation on interval sets only, then you > need to write something like this: > > if IntervalSet(i1)*IntervalSet(i2): > pass > > which is both uglier and an overkill. I guess what I don't understand in

Re: ANN: intervalset Was: Set type for datetime intervals

2016-04-04 Thread Random832
On Mon, Apr 4, 2016, at 03:12, Nagy László Zsolt wrote: > > Hi All, > > If anyone is interested, a module was born: > > https://bitbucket.org/nagylzs/intervalset > https://pypi.python.org/pypi/intervalset/0.1.1 I don't know if I like it being immutable. Maybe have separate mutable and

Re: Sorting a list

2016-04-04 Thread Random832
On Mon, Apr 4, 2016, at 02:56, Peter Otten wrote: > > That works well. Why is it 'cheating'? > > On second thought it isn't ;) It does require a numeric type, though. There are lots of types that are orderable but do not have a negation operator that provides a key with reversed ordering. --

Re: Strange range

2016-04-02 Thread Random832
On Sun, Apr 3, 2016, at 00:43, Steven D'Aprano wrote: > If you personally don't see any advantage in this, so be it, but you > might > not be aware of the history of (x)range: > > Guido in 2001: "Nobody uses this extra functionality, and its buggy, > let's > get rid of it." > >

Re: Drowning in a teacup?

2016-04-02 Thread Random832
On Sat, Apr 2, 2016, at 19:15, Ethan Furman wrote: > Also, if "pass-by-value" is being used, even mutation of the passed > object will not show up in the caller. I disagree. I don't think the definition of pass-by-value implies this. -- https://mail.python.org/mailman/listinfo/python-list

Re: Drowning in a teacup?

2016-04-02 Thread Random832
On Sat, Apr 2, 2016, at 15:28, Ned Batchelder wrote: > On Friday, April 1, 2016 at 4:27:30 PM UTC-4, Fillmore wrote: > > notorious pass by reference vs pass by value biting me in the backside > > here. Proceeding in order. > > As others have pointed out, this is false dichotomy. There are other

Re: [beginner] What's wrong?

2016-04-01 Thread Random832
On Fri, Apr 1, 2016, at 19:29, Michael Selik wrote: > Humans have always had trouble with this, in many contexts. I remember > being annoyed at folks saying the year 2000 was the first year of the new > millennium, rather than 2001. They'd forgotten the Gregorian calendar > starts from AD 1.

Re: extract rar

2016-04-01 Thread Random832
On Fri, Apr 1, 2016, at 15:22, Jianling Fan wrote: > Hello everyone, > > I am wondering is there any way to extract rar files by python without > WinRAR software? > > I tried Archive() and patool, but seems they required the WinRAR > software. Rar is a proprietary format. They do distribute a

Re: Set type for datetime intervals

2016-04-01 Thread Random832
More thoughts... sorry. On Fri, Apr 1, 2016, at 01:24, Nagy László Zsolt wrote: > > Hello, > > I need to compare sets of datetime intervals, and make set operations on > them: intersect, union, difference etc. One element of a set would be an > interval like this: > > element ::=

Re: Set type for datetime intervals

2016-04-01 Thread Random832
On Fri, Apr 1, 2016, at 01:24, Nagy László Zsolt wrote: > > Hello, > > I need to compare sets of datetime intervals, and make set operations on > them: intersect, union, difference etc. One element of a set would be an > interval like this: Two thoughts on this: Such an object is not

Re: Strange range

2016-04-01 Thread Random832
On Fri, Apr 1, 2016, at 09:24, Chris Angelico wrote: > It is an iterable. It is not a factory, as that implies that you call > it. I do have an objection to this statement. It's perfectly reasonable to describe the factory pattern as applying to objects on which you call a method to return the

Re: Strange range

2016-04-01 Thread Random832
On Fri, Apr 1, 2016, at 10:12, Marko Rauhamaa wrote: > Yes, I realize it now. I had thought it was: > > def range(start, end=None, step=1): > if end is None: > start, end = 0, start > i = start > while step * (end - i) > 0: > yield i >

Re: Suggestion: make sequence and map interfaces more similar

2016-03-31 Thread Random832
On Thu, Mar 31, 2016, at 09:17, Mark Lawrence via Python-list wrote: > On 31/03/2016 14:08, Antoon Pardon wrote: > > Op 31-03-16 om 13:57 schreef Chris Angelico: > >> Okay. I'll put a slightly different position: Prove that your proposal > >> is worth discussing by actually giving us an example

Re: Threading is foobared?

2016-03-30 Thread Random832
On Thu, Mar 31, 2016, at 01:25, Random832 wrote: > Actually, merely prepending the original Message-ID itself append, not prepend... I'd misremembered the order that References go in. -- https://mail.python.org/mailman/listinfo/python-list

Re: Threading is foobared?

2016-03-30 Thread Random832
On Thu, Mar 31, 2016, at 01:25, Random832 wrote: > > if a message is cross-posted to two lists which both gateway to Usenet, > > and Mailman didn't make the Message-IDs unique, the news server would > > discard one of the two posts as a duplicate and the post would be &g

Re: Threading is foobared?

2016-03-30 Thread Random832
On Thu, Mar 31, 2016, at 00:50, Mark Sapiro wrote: > What Mailman does do as noted by Random832 is replace the Message-ID: > header value in posts gated to Usenet with a list specific, Mailman > generated unique value. There is a reason for this, and that reason is > if a message is

Re: Statements as expressions [was Re: Undefined behaviour in C]

2016-03-30 Thread Random832
On Wed, Mar 30, 2016, at 19:01, Dennis Lee Bieber wrote: > Though I'm surprised GoogleGroups would expire that fast. > > Google is the reason I inserted that header -- I started back in the > days when news-servers routinely expired stuff (text groups about monthly > lifespan, the

Re: Statements as expressions [was Re: Undefined behaviour in C]

2016-03-30 Thread Random832
On Wed, Mar 30, 2016, at 12:59, Rustom Mody wrote: > On Wednesday, March 30, 2016 at 7:56:50 PM UTC+5:30, Ben Bacarisse wrote: > > Dennis Lee Bieber writes: > > Sorry Dennis > Dont see you at all > Neither on googlegroups -- which of course everyone loves to hate > Nor the archive: >

Re: Suggestion: make sequence and map interfaces more similar

2016-03-30 Thread Random832
This discussion is getting a bit distracted from the original request. Let's look at it from a higher level. What is being requested, regardless of if you call it a "map interface" or whatever, is a single way, for sequences and maps... broadly, anything with a __getitem__, to iterate over all

Re: Suggestion: make sequence and map interfaces more similar

2016-03-30 Thread Random832
On Wed, Mar 30, 2016, at 01:43, Steven D'Aprano wrote: > This is not an argument about dicts being mutable, because clearly they > aren't. This is an argument about key:value pairs being stable. "Stable" > doesn't mean "immutable". If you change the value associated with a key > directly, then

Re: Suggestion: make sequence and map interfaces more similar

2016-03-29 Thread Random832
On Tue, Mar 29, 2016, at 20:56, Chris Angelico wrote: > The map contract is this: > > x = StrangeDict() > x[123] = 456 > ... > assert x[123] == 456 > > Your mapping does violate the map contract. So, you can put *anything* in that "..."? x = dict() x[123] = 456 x[123] = 789 assert x[123] ==

Re: Threading is foobared?

2016-03-29 Thread Random832
On Tue, Mar 29, 2016, at 19:54, Rob Gaddi wrote: > Just read on Usenet instead of through the mailing list. That way > you can accept broken threading as a given rather than wonder why it's > happening in a particular case. It's a given everywhere. Any thread that contains a sufficient number of

Re: [stdlib-sig] Can imaplib be improved?

2016-03-29 Thread Random832
On Tue, Mar 29, 2016, at 14:45, Grant Edwards wrote: > I think giving up on backwards compatiblity and starting from scratch > is the best idea. > > I like imaplib2 > > https://pypi.python.org/pypi/imaplib2 > https://github.com/bcoe/imaplib2 > https://sourceforge.net/projects/imaplib2/ > >

Re: [stdlib-sig] Can imaplib be improved?

2016-03-29 Thread Random832
I'd posted this to stdlib-...@python.org without realizing that that list is mostly dead. On Thu, Mar 24, 2016, at 22:33, Random832 wrote: > I assume that everyone who has ever used imaplib is familiar with how > painful its output format is to deal with. I am wondering if anyone else >

Re: List of Functions

2016-03-28 Thread Random832
On Mon, Mar 28, 2016, at 19:40, Steven D'Aprano wrote: > Not to mention "Monad". I don't think *anyone* knows what a Monad is ;-) A monad is just a monoid in the category of endofunctors; what's the problem? Well, someone had to say it. -- https://mail.python.org/mailman/listinfo/python-list

Re: repeat items in a list

2016-03-28 Thread Random832
On Mon, Mar 28, 2016, at 07:36, larudwer wrote: > in case you want to mainain order: > > ["a","b"]*3 > ['a', 'b', 'a', 'b', 'a', 'b'] > > is completely suffincient. I think you've completely missed the point of what order he's talking about. How do you turn ['a', 'c', 'b'] into ['a', 'a',

Re: Threading is foobared?

2016-03-27 Thread Random832
On Sat, Mar 26, 2016, at 23:18, Ben Finney wrote: > What you've demonstrated is that at least one host is violating > communication standards by altering existing reference fields on > messages in transit. The usenet gateway relays posts that originated on the mailing list to usenet with their

Re: Undefined behaviour in C [was Re: The Cost of Dynamism]

2016-03-25 Thread Random832
On Fri, Mar 25, 2016, at 22:46, Steven D'Aprano wrote: > Culturally, C compiler writers have a preference for using undefined > behaviour to allow optimizations, even if it means changing the semantics > of your code. The C compiler is allowed to ignore your code, move it > around > so that things

Re: Tkinter --> Why multiple windows

2016-03-24 Thread Random832
On Thu, Mar 24, 2016, at 16:24, kevind0...@gmail.com wrote: > Hello: > > newbie Tkinter question > > If I run the code below two windows appear. > One empty and one with the text box and button. The empty one is the root window. -- https://mail.python.org/mailman/listinfo/python-list

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-24 Thread Random832
On Thu, Mar 24, 2016, at 11:18, BartC wrote: > On 24/03/2016 15:03, Jon Ribbens wrote: > > No it isn't, it's replacing the elements in-place, > > Replace them with what, if not an entirely new list built from > '[0]*len(L)'? Well, the *contents* of such a list, obviously. But the original

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-24 Thread Random832
On Thu, Mar 24, 2016, at 10:49, BartC wrote: > On 24/03/2016 14:34, Jussi Piitulainen wrote: > > You understand correctly, but it may be more natural in practice to > > write it this way: > > > > for k, item in enumerate(them): > > them[k] = f(item) > > > > I _think_ I might write

Re: netrc and password containing whitespace

2016-03-24 Thread Random832
On Thu, Mar 24, 2016, at 06:14, Lele Gaifax wrote: > I tried to insert an entry in my ~/.netrc for an account having a > password that contains a space, something like: > > machine my-host-name login myname password "My Password" > > The standard library netrc module does not seem able to parse

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-23 Thread Random832
On Wed, Mar 23, 2016, at 19:55, Steven D'Aprano wrote: > while psource: > c, psource = psource[0], psource[1:] > lxsymbol = disptable[min(ord(c), 256)](c, psource) > > > But one positive: this conclusively proves that "Pythonic" is in the eye > of > the

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-23 Thread Random832
On Wed, Mar 23, 2016, at 12:08, Mark Lawrence wrote: > > And doing it 'Pythonically' can lead to suggestions such as the > > following the other day: > > > > c, psource = psource[0], psource[1:] > > > > (where psource is a very long string), which even I could tell, from > > knowing what goes

Re: [Not actually OT] Trouble in node.js land

2016-03-23 Thread Random832
On Wed, Mar 23, 2016, at 10:52, Steven D'Aprano wrote: > - He didn't bother to check to see whether the name was in use when he > picked it. Someone not making a commercial product shouldn't have to worry about a name collision with something they've never heard of. > - The lawyers were polite

Re: [Not actually OT] Trouble in node.js land

2016-03-23 Thread Random832
On Wed, Mar 23, 2016, at 05:03, Steven D'Aprano wrote: > https://medium.com/@azerbike/i-ve-just-liberated-my-modules-9045c06be67c > > Of course, moving his allegedly infringing package "kik" to github isn't > going to fix the problem. It's still allegedly infringing. I think the issue, and it

Re: os.rename on Windows

2016-03-23 Thread Random832
On Wed, Mar 23, 2016, at 08:17, Steven D'Aprano wrote: > Any Windows users here? > > print(e.winerror) # Windows only > print(e.errno) > print(repr(e)) 183 17 FileExistsError(17, 'Cannot create a file when that file already exists') Python 3.5.1. --

Re: The Cost of Dynamism (was Re: Pyhon 2.x or 3.x, which is faster?)

2016-03-21 Thread Random832
On Mon, Mar 21, 2016, at 09:48, Steven D'Aprano wrote: > Pardon me, do I understand you correctly? You're saying that the C parser > is > Unicode-aware and allows you to use Unicode in C source code? Er, "the" C parser? In the C standard, the source character set is implementation-defined, and

Re: How to waste computer memory?

2016-03-20 Thread Random832
On Sun, Mar 20, 2016, at 10:55, Ben Bacarisse wrote: > It's 21. The reason being (or at least part of the reason being) that > 21 bits can be UTF-8 encoded in 4 bytes: 0xxx 10xx 10xx > 10xx (3 + 3*6). The reason is the UTF-16 limit. Prior to that, UTF-8 had no such limit (it

Re: Bash-like pipes in Python

2016-03-20 Thread Random832
On Wed, Mar 16, 2016, at 11:20, Random832 wrote: > How about: > > from functools import partial, reduce > from operator import mul > def rcall(arg, func): return func(arg) > def fpipe(*args): return reduce(rcall, args) It occurs to me that this suggests a further refinement:

Re: How to waste computer memory?

2016-03-19 Thread Random832
On Fri, Mar 18, 2016, at 11:17, Ian Kelly wrote: > > Just to play devil's advocate, here, why is it so bad for indexing to be > > O(n)? Some simple caching is all that's needed to prevent it from making > > iteration O(n^2), if that's what you're worried about. > > What kind of caching do you

Re: empty clause of for loops

2016-03-19 Thread Random832
On Wed, Mar 16, 2016, at 13:01, Sven R. Kunze wrote: > On 16.03.2016 17:56, Sven R. Kunze wrote: > > On 16.03.2016 17:37, Random832 wrote: > >> for item in collection: > >> if good(item): > >>thing = item > >>break > >>

Usenet Message-ID (was Re: How to waste computer memory?)

2016-03-19 Thread Random832
On Fri, Mar 18, 2016, at 15:46, Tim Golden wrote: > Speaking for a moment as the list owner. Posts by this OP are usually > blatant provocation and I usually filter them out before they hit the > list. (They'll still appear if you're reading via Usenet). In this case > I approved a post

Re: Bash-like pipes in Python

2016-03-19 Thread Random832
On Wed, Mar 16, 2016, at 10:57, Steven D'Aprano wrote: > For instance, we can take a string, extract all the digits, convert them > to > ints, and finally multiply the digits to give a final result: > > py> from operator import mul > py> "abcd12345xyz" | Filter(str.isdigit) | Map(int) |

Re: How to waste computer memory?

2016-03-19 Thread Random832
On Fri, Mar 18, 2016, at 12:44, Steven D'Aprano wrote: > And I don't understand this meme that indexing strings is not important. > Have people never (say) taken a slice of a string, or a look-ahead, or > something similar? > > i = mystring.find(":") find is already O(N). > next_char =

Re: How to waste computer memory?

2016-03-19 Thread Random832
On Fri, Mar 18, 2016, at 10:59, Michael Torrie wrote: > This seems to me to be a leaky abstraction. Julia's approach is > interesting, but it strikes me as somewhat broken as it pretends to do > O(1) indexing, but in reality it's still O(n) because you still have to > iterate through the bytes

Re: Bash-like pipes in Python

2016-03-19 Thread Random832
On Wed, Mar 16, 2016, at 11:09, Joel Goldstick wrote: > > This is interesting, but the part I'm missing is the use of the Pipe > symbol '|' in python. Can you elaborate His "Filter", "Map", and "Reduce" are classes which define __ror__ methods, obviously. --

Re: Bash-like pipes in Python

2016-03-19 Thread Random832
On Thu, Mar 17, 2016, at 10:36, Chris Angelico wrote: > This object has a generator/list duality, but if you observe it, it > collapses to a list. When used interactively, it'd be pretty much the > same as calling list() as the last step, but in a script, they'd > operate lazily. > > Quantum

Re: empty clause of for loops

2016-03-18 Thread Random832
On Wed, Mar 16, 2016, at 11:17, Sven R. Kunze wrote: > I can imagine that. Could you describe the general use-case? From what I > know, "else" is executed when you don't "break" the loop. When is this > useful? for item in collection: if good(item): thing = item break else:

Re: How to waste computer memory?

2016-03-18 Thread Random832
On Fri, Mar 18, 2016, at 03:00, Ian Kelly wrote: > jmf has been asked this before, and as I recall he seems to feel that > UTF-8 should be used for all purposes, ignoring the limitations of > that encoding such as that indexing becomes a O(n) operation. Just to play devil's advocate, here, why is

Re: How to waste computer memory?

2016-03-18 Thread Random832
On Fri, Mar 18, 2016, at 20:55, Chris Angelico wrote: > On Sat, Mar 19, 2016 at 9:03 AM, Marko Rauhamaa wrote: > > Also, special-casing '\0' and '/' is > > lame. Why can't I have "Results 1/2016" as a filename? > > Would you be allowed to have a directory named "Results 1" as

Re: Question

2016-03-07 Thread Random832
On Mon, Mar 7, 2016, at 13:09, Jon Ribbens wrote: > It only appears to have downloads for 32-bit, or 64-bit AMD processors, > not 64-bit Intel processors. Current 64-bit processors produced by Intel use the "AMD64" architecture, not the Intel IA-64 (Itanium) architecture. --

Re: A mistake which almost went me mad

2016-03-07 Thread Random832
On Mon, Mar 7, 2016, at 11:19, Ian Kelly wrote: > Relative imports only work inside packages. You can't use a relative > import to import one top-level module from another. > > Besides, the relative import doesn't help to disambiguate in this > case. The absolute path of the stdlib email module

Re: yield in try/finally case

2016-03-03 Thread Random832
On Thu, Mar 3, 2016, at 08:47, Peter Otten wrote: > This is because the last generator uf = upperfile(...) is not garbage- > collected and wasn't explicitly closed either. But the program hasn't ended yet when you run your assertion. import sys _open = open files = [] def myclose(self):

Re: yield in try/finally case

2016-03-03 Thread Random832
On Thu, Mar 3, 2016, at 06:52, 刘琦帆 wrote: > I have just saw PEP 255, and it says that > > "A yield statement is not allowed in the try clause of a try/finally > construct. The difficulty is that there's no guarantee the generator > will ever be resumed, hence no guarantee that the finally block

Re: Dynamic object attribute creation

2016-02-29 Thread Random832
On Mon, Feb 29, 2016, at 10:36, ast wrote: > but why doesn't it work with built-in classes int, float, list ? > > L = [1, 8, 0] > L.test = 'its a list !' > > (however lists are mutable, int, float ... are not) Because those classes do not have attribute dictionaries, in order to save space.

Re: Make a unique filesystem path, without creating the file

2016-02-25 Thread Random832
On Tue, Feb 23, 2016, at 03:22, Paul Rubin wrote: > Thanks. It would be nice if those were gatewayed to usenet like this > group is. I can't bring myself to subscribe to mailing lists. Have you tried gmane? -- https://mail.python.org/mailman/listinfo/python-list

Re: setting the font of the root title

2016-02-23 Thread Random832
On Tue, Feb 23, 2016, at 11:30, kevind0...@gmail.com wrote: > Hello: > > Newbee here. > > I need to change the font of the title of the root. > Actually I just need it to be larger, which means I may need the > top boarder to be larger. > > I wrote the bit of code below, hoping for the desired

<    1   2   3   4   5   6   7   8   >