Re: Pep8 for long pattern

2018-03-27 Thread Rick Johnson
On Tuesday, March 27, 2018 at 9:37:14 PM UTC-5, Dan Stromberg wrote: > I can easily get 132+ columns of a font large enough for my > 52 year old eyes on a 15" laptop. Well, if you're comfortable with the long lines, fine. But be aware that long lines are poo-pooed in most professional enviroments.

Re: Ruby parens-free function calls [was Re: Accessing parent objects]

2018-03-28 Thread Rick Johnson
On Wednesday, March 28, 2018 at 2:25:42 AM UTC-5, Gregory Ewing wrote: > Rick Johnson wrote: > > The only difference is when you want to make a call from a > > _reference_, which, as you and i well know, is not the > > most common way func/meths are called (these are rare).

Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-30 Thread Rick Johnson
On Friday, March 30, 2018 at 10:45:35 AM UTC-5, Terry Reedy wrote: > https://www.jetbrains.com/research/python-developers-survey-2017/ > “Which version of Python do you use the most?” > 2014 80% 2.x, 20% 3.x > 2016 60% 2.x, 40% 3.x > 2017 25% 2.x, 75% 3.x > > This is a bigger jump than I anticipat

Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-30 Thread Rick Johnson
On Friday, March 30, 2018 at 7:44:40 PM UTC-5, Steven D'Aprano wrote: [...] > Reddit's /ruby subreddit: 40,571 subscribers. > > Reddit's /python subreddit: 230,858 subscribers. Those numbers mean nothing unless you can prove all two- hundred-thirty-odd thousand of them to be active, non- tolling,

Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Rick Johnson
On Friday, March 30, 2018 at 8:59:16 PM UTC-5, Chris Angelico wrote: [...] > You can pooh-pooh any statistic. Yeah, except the ones supported by actual _facts_. > So far, though, you have provided NO statistics of your > own, just your own gut feeling. Uh huh. And what do you call drawing naiv

Re: Python Developer Survey: Python 3 usage overtakes Python 2 usage

2018-03-31 Thread Rick Johnson
Grant Edwards wrote: > Etienne Robillard wrote: > > > Do you understand that a modern mobile device typically > > require a Internet subscription and an additional > > subscription for the smart phone? > > Huh? What is "an internet subscription"? Why would you > need two of them if all you have

Re: (no subject)

2018-06-10 Thread Rick Johnson
sagar daya wrote: > Couldn't install any module from pip > Plz help??? As with most actions, an algorithm is required. (shocking, i know!) What methodology have you implemented thus far to achieve your goal of "installing modules from PIP"? Please enumerate the steps you chose to take, and then w

Re: Why exception from os.path.exists()?

2018-06-10 Thread Rick Johnson
Marko Rauhamaa wrote: > Chris Angelico : > > > Marko Rauhamaa wrote: > >> > >> This surprising exception can even be a security issue: > >> > >>>>> os.path.exists("\0") > >>Traceback (most recent call last): > >> File "", line 1, in > >> File "/usr/lib64/python3.6/genericpath.p

Re: Stefan's headers [was:Names and identifiers]

2018-06-10 Thread Rick Johnson
On Friday, June 8, 2018 at 12:34:58 PM UTC-5, Marko Rauhamaa wrote: > PS IMO copyright laws should be abolished altogether. At > the very least one should pay for copyright protection. One > €1 for the first year, €2 for the second, €4 for the third > and so on exponentially. I like your idea of

Re: Stefan's headers [was:Names and identifiers]

2018-06-10 Thread Rick Johnson
Gene Heskett wrote: > I rather like that idea. Unforch, who would be in charge of keeping the > books uptodate? The USTPO? Of course that would expand another guvmnt > agencies payroll x10, and its a waste of taxpayer dollars since Albert > retired anyway. What century are you trapped in pal? H

Re: user defined modules

2018-06-10 Thread Rick Johnson
Sharan Basappa wrote: > Is there a specific location where user defined modules > need to be kept? My advice is that any location is a good location so long as the location you chose is _not_ a part of the PythonXY directory tree. For example, on a windoze machine (and in Python2.x at least), th

Re: Stefan's headers [was:Names and identifiers]

2018-06-11 Thread Rick Johnson
On Monday, June 11, 2018 at 1:02:15 PM UTC-5, Chris Angelico wrote: > You're trying to argue against my hypothetical statements > about game publishing, and declaring that it's possible to > use software to encourage hardware sales. But my point was > that, absent copyright and the ability to make

Re: Stefan's headers [was:Names and identifiers]

2018-06-11 Thread Rick Johnson
On Monday, June 11, 2018 at 3:04:14 PM UTC-5, MRAB wrote: > On 2018-06-11 20:17, Rick Johnson wrote: [...] > > A dashboard is a horrible analogy. Software and hardware > > are connected at the _hip_. A more correct analogy to > > describe the relationship between

Re: Index of entity in List with a Condition

2018-06-11 Thread Rick Johnson
subhaba...@gmail.com wrote: > I have the following sentence, > > "Donald Trump is the president of United States of America". > > I am trying to extract the index 'of', not only for single but also > for its multi-occurance (if they occur), from the list of words of the > string, made by simply

Re: Stefan's headers [was:Names and identifiers]

2018-06-12 Thread Rick Johnson
Gregory Ewing wrote: [...] > * Charging money for copies of software is not the only way > to make money from programming. You can charge for support > services. You can charge for writing custom one-off > software. There are people who make a good living from > doing these things. Microsoft not

Re: Splitting up large python module impact on performance?

2018-06-12 Thread Rick Johnson
Bill Deegan wrote: > I'm doing some refactoring on a fairly large python > codebase. Some of the files are > 4000 lines long and > contain many classes. I would argue that files of such size are a total pain to navigate and thus, edit. I prefer to place only one -- or only a handful of classes --

Re: Splitting up large python module impact on performance?

2018-06-12 Thread Rick Johnson
On Tuesday, June 12, 2018 at 10:35:47 PM UTC-5, Chris Angelico wrote: [...] > A few thousand lines in a file is only a problem if you're > using an editor that lacks a Find feature. Or if you use > bad function/class names that you can't search for. I'm unaware of any text editor that doesn't have

Re: Splitting up large python module impact on performance?

2018-06-13 Thread Rick Johnson
On Wednesday, June 13, 2018 at 4:27:35 AM UTC-5, Chris Angelico wrote: > It's more his definition of "large" and "small" that I was > disagreeing with. You're absolutely right that a dense > global scope is a problem; but a "one class per file" rule > is a terrible idea. What if the "one class" sp

Re: PEP8 compliance

2018-06-13 Thread Rick Johnson
On Wednesday, June 13, 2018 at 10:47:40 AM UTC-5, Steven D'Aprano wrote: > I'm of two minds here... Obviously. > [...] So use your own judgement: if following PEP 8 becomes > a chore, or if you would rather follow your own style, > don't feel guilty about ignoring the style guide. IOWs: "

Re: text mining

2018-06-15 Thread Rick Johnson
On Friday, June 15, 2018 at 8:00:36 AM UTC-5, Steven D'Aprano wrote: > Seriously, you are asking strangers to help you out of the goodness of > their heart. Stop lying Steven. Nobody here has a heart. This is Usenet, dammit. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python list vs google group

2018-06-16 Thread Rick Johnson
On Friday, June 15, 2018 at 9:14:13 PM UTC-5, Richard Damon wrote: > if the Windows driver broke some specification but still sort > of worked [...] ...that's when the engineers in the Redmond, WA area know it's time to package and ship the product! -- https://mail.python.org/mailman/listinfo/py

Re: syntax difference

2018-06-17 Thread Rick Johnson
Chris Angelico wrote: [...] > For the record, there's nothing at all wrong with printf-style > formatting; its flexibility and brevity make it extremely useful in > many situations. Except that it's old, not elegant, error prone, feature poor, and not Pythonic! But besides all _that_ (and possibl

Re: syntax difference

2018-06-17 Thread Rick Johnson
Steven D'Aprano wrote: > Bart Wrote: > > So what's a Type Hint associated with in Python? > Since it is a type *hint*, not a type *declaration*, the > interpreter can and does ignore it. But yet, the _programmer_ cannot ignore it. Does that make any sense to you, or anyone else with half a brain?

Re: syntax difference

2018-06-17 Thread Rick Johnson
On Sunday, June 17, 2018 at 2:07:40 PM UTC-5, Jim Lee wrote: > IMHO, trying to shoehorn static type checking on top of a dynamically > typed language shows that the wrong language was chosen for the job. Exactly. I'm not against the idea of Python growing a new feature. Features are great. My ob

Re: syntax difference

2018-06-17 Thread Rick Johnson
On Sunday, June 17, 2018 at 3:58:26 PM UTC-5, Dan Stromberg wrote: [...] > I actually really like Python's type hinting, which I've recently started > using. I've now used it on 10 projects, and I imagine I'll be using it in > many more. > > Don't like them? I guess you don't have to use them.

Re: syntax difference

2018-06-17 Thread Rick Johnson
On Sunday, June 17, 2018 at 4:17:33 PM UTC-5, Chris Angelico wrote: > On Mon, Jun 18, 2018 at 7:10 AM, Jim Lee wrote: > > > > > > On 06/17/2018 01:56 PM, Chris Angelico wrote: > >> > >> On Mon, Jun 18, 2018 at 6:50 AM, Jim Lee wrote: > >>> > >>> > >>> On 06/17/2018 01:35 PM, Chris Angelico wrote:

Re: syntax difference

2018-06-17 Thread Rick Johnson
Chris Angelico wrote: [...] > A. Isn't it cute, how he thinks that comments are easier to remove > than other elements equally well defined in the grammar? And may we see your code that will remove all instances of type-hints error free? Hmm? I look forward to scraping the internet for s

Re: syntax difference

2018-06-17 Thread Rick Johnson
On Sunday, June 17, 2018 at 9:22:57 PM UTC-5, Chris Angelico wrote: > First, No. You're not squirming your way out this one Chris. _You_ leveled the assertion that removing interleaved type- hints from the executable code would be easier than removing my proposed "type-hint comments". What w

Re: syntax difference

2018-06-18 Thread Rick Johnson
Chris Angelico wrote: [...] > What was the quote before that? > > > "Type-hint comments" would allow: > > (3) and those who utterly *HATE* them, to write a simpl[e] > > little function which will strip them from any and all > > source code they might be forced to maintain. > > Put up or s

Re: syntax difference

2018-06-18 Thread Rick Johnson
Jim Lee wrote: > Chris wrote: > > > > I said that you can't decry changes that were before > > your time (they're simply the way things are). > > Really? Wow. I'd hate to live in your world! Just > because something exists, it can't be challenged or > questioned. Got it! Chris is a good choi

Re: syntax difference

2018-06-18 Thread Rick Johnson
On Monday, June 18, 2018 at 5:45:28 AM UTC-5, Chris Angelico wrote: > So in both cases, you would probably end up with something > like 2to3. And there you have it! Just Like Python3000, the python devs have caused a major disruption by saddling us with the syntactic noise of type- hints. There

Re: syntax difference

2018-06-18 Thread Rick Johnson
Chris Angelico wrote: > Bart wrote: [...] > > What will those look like? If copyright/license comments > > have their own specific syntax, then they just become > > another token which has to be recognized. > > If they have specific syntax, they're not comments, are they? Yes, they are. >From the

Re: syntax difference

2018-06-18 Thread Rick Johnson
On Monday, June 18, 2018 at 6:43:36 AM UTC-5, Steven D'Aprano wrote: > The programmer can ignore [type-hints], just as they can > ignore any other form of documentation. Type-hints, as implemented, break all the rules of conventional documentation. In any programming language i have ever seen, for

Re: syntax difference

2018-06-18 Thread Rick Johnson
On Monday, June 18, 2018 at 6:57:27 AM UTC-5, Steven D'Aprano wrote: > I still think that Python has been going nowhere but downhill ever since > extended slicing was added in version 1.4. Apples to oranges! -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax difference

2018-06-18 Thread Rick Johnson
Bart wrote: [...] > For example, comments that start with #T# (and in my case, > that begin at the start of a line). Such would be a _breeze_ to parse out. And i would argue (given a sufficiently unique tag) that arbitrary white space would not be any more error prone, either. Thus, your "tagged c

Re: syntax difference

2018-06-18 Thread Rick Johnson
Steven D'Aprano wrote: [...] > particular at DropBox, which is (I believe) funding a lot of Guido's time > on this, because they need it. And now we get to the truth! Guido's new puppet master is the sole reason why this fine community -- of once free-roaming *STALLIONS*-- is now corralled an

Re: syntax difference

2018-06-18 Thread Rick Johnson
Steven D'Aprano said: > Python is not only alive and well, but actually growing in > popularity according to (as far as I can see) all the well- > known measures of language popularity. Steven *ALSO* said: > "Ever since I learned about confirmation bias, I've been > seeing it everywhere." Hmm? --

Re: syntax difference

2018-06-18 Thread Rick Johnson
Steven D'Aprano wrote: > Moving the type-checking out of the core language into the > IDE or linter which can be used or not used according to > the desire of the programmer Except, what your poppycock commentary seems to glaze over is the fact that whilst a programmer can certainly decided to "us

Re: syntax difference

2018-06-18 Thread Rick Johnson
Ian wrote: > Uh, yes, they do. They're defined in PEP 484, and Mypy uses them for > type-checking Python 2 code, where the annotations don't exist. So when will the interleaved type-hints be removed from the language specification? -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax difference

2018-06-18 Thread Rick Johnson
On Monday, June 18, 2018 at 12:46:36 PM UTC-5, Chris Angelico wrote: > What about assertions? Are they comments too? Should we > have, for instance: > > if x > 0: > ... > elif x < 0: > ... > else: > #assert: x == 0 > ... > > or is it better to use an 'assert' statement? After all

Re: syntax difference

2018-06-18 Thread Rick Johnson
On Monday, June 18, 2018 at 1:02:18 PM UTC-5, Ian wrote: [...] > When PEP 3107 was written, it was anticipated that > annotations would find more uses than just type hinting. > Some of those proposed ideas (e.g. database query mapping) > depend on the annotation being readable at run-time, for > wh

Re: syntax difference

2018-06-18 Thread Rick Johnson
On Monday, June 18, 2018 at 1:50:09 PM UTC-5, Chris Angelico wrote: [...] > I don't know what you mean by "syntactic meaning". Do you mean that > they create no executable bytecode, that they have no run-time > influence? Because that's not entirely true; they are stored, and can > be viewed at run

Re: syntax difference

2018-06-18 Thread Rick Johnson
Chris Angelico wrote: [...] > assert """ > , ", ";print('Will I print?');\ > "';print("Or will I?");\ > ';print("What about me?");'''\ > print("And me? Where endeth");"""\ > print('the assertion?');\ Chris, that's not code... That's a syntactical representation of some random flea circus.

Re: syntax difference

2018-06-18 Thread Rick Johnson
On Monday, June 18, 2018 at 2:48:58 PM UTC-5, Ian wrote: > I would also note that none of this applies to type hinting > in any case. Type hints don't require the programmer to be > able to explain anything in natural language, nor are they > prone to becoming out-of-sync. > > Because if they do, t

Re: syntax difference

2018-06-19 Thread Rick Johnson
On Tuesday, June 19, 2018 at 5:21:25 AM UTC-5, Chris Angelico wrote: > On Tue, Jun 19, 2018 at 8:12 PM, Steven D'Aprano > wrote: > > On Mon, 18 Jun 2018 11:34:40 -0700, Jim Lee wrote: > > > >> On 06/18/2018 11:18 AM, Chris Angelico wrote: > >>> What, fundamentally, is the difference between type h

Re: syntax difference

2018-06-19 Thread Rick Johnson
Rhodri James wrote: [...] > It has little flea executioners running around with little flea axes > chopping off little flea heads? Hmm. And who knew that Python-list was really just a homicidal flea circus. Go figure! -- https://mail.python.org/mailman/listinfo/python-list

Re: syntax difference

2018-06-19 Thread Rick Johnson
On Tuesday, June 19, 2018 at 4:12:10 AM UTC-5, Steven D'Aprano wrote: [...] > People have been requesting static typing in Python virtually since Day > 1, "Day one"??? Really? "People"??? How many people? Contrary to to your fuzzy memories, Steven, we all know that Guido _purposely_ desig

Re: syntax difference

2018-06-19 Thread Rick Johnson
On Tuesday, June 19, 2018 at 1:02:52 PM UTC-5, Ian wrote: > On Mon, Jun 18, 2018 at 2:57 PM Rick Johnson [...] > > The point is, from the POV of the interpreter and the > > programmer. comments are always going to be comments > > regardless of whether special purpose tools

Re: "Data blocks" syntax specification draft

2018-06-24 Thread Rick Johnson
From: Rick Johnson On Sunday, May 20, 2018 at 5:29:11 PM UTC-5, Mikhail V wrote: > What against PDF? I'm not a big fan of PDF either. Adobe Reader is one the most bloated POS software i have ever had the misfortune of hosting on my computers, and i absolutely refuse to host that crap

Re: syntax difference

2018-06-25 Thread Rick Johnson
To: Steven D'Aprano From: Rick Johnson On Sunday, June 24, 2018 at 10:05:14 AM UTC-5, Steven D'Aprano wrote: [...] > Be fair. It's more like 50% of the time. Let's not dogpile > onto Bart. He asked a question, I answered it, we don't all > need to sink the bo

Re: Anyone here on Python-Dev mailing list?

2018-06-26 Thread Rick Johnson
To: Steven D'Aprano From: Rick Johnson Steven D'Aprano wrote: [...] > I get spam bots trying to flush out suckers. I don't get > bots that send out random messages to random people. Why? Steven, my son, i suppose some questions just answer themselves... --- BBBS/Li6

Re: syntax difference

2018-06-26 Thread Rick Johnson
To: Steven D'Aprano From: "Rick Johnson" To: Steven D'Aprano From: Rick Johnson On Sunday, June 24, 2018 at 10:05:14 AM UTC-5, Steven D'Aprano wrote: [...] > Be fair. It's more like 50% of the time. Let's not dogpile > onto Bart. He asked a questi

Re: Python for beginners or not? [was Re: syntax difference]

2018-06-26 Thread Rick Johnson
To: Steven D'Aprano From: Rick Johnson On Monday, June 25, 2018 at 5:56:04 AM UTC-5, Steven D'Aprano wrote: > Nearly everybody misses the fact that the Zen is a joke, > not to be taken *too* seriously. A particularly subtle > joke, but still a joke. The Python Zen is not

Re: [tkinter] widget size adjustment

2016-06-21 Thread Rick Johnson
On Sunday, June 19, 2016 at 1:29:11 PM UTC-5, Pierre-Alain Dorange wrote: > I got a small interface handle with tkinter / Gridmanager. > I configure row and column to follow user window size > adjustement, that' fine. but i do not know how to adjust > the main widget : a canvas displaying a portion

Re: the global keyword:

2016-06-21 Thread Rick Johnson
On Sunday, June 12, 2016 at 2:08:01 PM UTC-5, BartC wrote: > Anyway, it shows Python doesn't have true cross-module globals. BS! You can inject symbols into sys.modules and achieve a true global. ## BEGIN: INTERACTIVE SESSION ## py> import sys py> def foo(): ... print 'My name

Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-21 Thread Rick Johnson
On Tuesday, June 21, 2016 at 6:03:28 AM UTC-5, Pushpanth Gundepalli wrote: > Guys, can you please share me some sites where we can practice python > programs for beginners and Intermediate. Have you tried googling for "python interactive tutorial"? Someone had created one similar to Ruby's, but

Re: [tkinter] widget size adjustment

2016-06-21 Thread Rick Johnson
On Tuesday, June 21, 2016 at 12:24:56 PM UTC-5, Pierre-Alain Dorange wrote: > > > (3) Or perhaps you want the canvas content(s) to resize > > dynamically as the canvas expands and contacts? > > That is more close to my needs. > > A picture is often better than words, here is a scren > capture of my

Re: the global keyword:

2016-06-21 Thread Rick Johnson
On Tuesday, June 21, 2016 at 12:15:38 PM UTC-5, Random832 wrote: > You can put a function or constant there, sure. But if > you're using it as a variable, you'd have to do that > *every* time (in which case what's the point) Well, since the term "variable" has been so abused, using it in such a n

Re: the global keyword:

2016-06-21 Thread Rick Johnson
On Tuesday, June 21, 2016 at 5:32:43 PM UTC-5, Chris Angelico wrote: > On Wed, Jun 22, 2016 at 8:20 AM, Rick Johnson: > > Then one could have added module-level symbols without all > > the semantic hubbub. > > > > MSFL.foo = 0 > > > > def iter_foo():

Re: the global keyword:

2016-06-21 Thread Rick Johnson
On Tuesday, June 21, 2016 at 5:20:53 PM UTC-5, Rick Johnson wrote: > py> import sys > py> def foo(): > ... print 'My name is Foo!' > py> sys.modules['__builtin__'].__dict__['foo_func'] = foo > py> foo() > My

Re: the global keyword:

2016-06-21 Thread Rick Johnson
On Tuesday, June 21, 2016 at 6:16:09 PM UTC-5, BartC wrote: > On 21/06/2016 23:20, Rick Johnson wrote: > > On Tuesday, June 21, 2016 at 12:15:38 PM UTC-5, Random832 wrote: > > > Storing dynamic data to global space is almost always > > foolish, and I'm a fan

Re: Is it possible to draw a BUTTON?

2016-07-27 Thread Rick Johnson
On Wednesday, July 27, 2016 at 7:15:20 PM UTC-5, MRAB wrote: > On 2016-07-28 00:13, huey.y.ji...@gmail.com wrote: > > On Wednesday, July 27, 2016 at 4:18:29 PM UTC-4, huey.y...@gmail.com wrote: > >> Hi Folks, > >> > >> It is common to put a BUTTON on a canvas by the means of coding. However, > >>

Re: Is it possible to draw a BUTTON?

2016-08-01 Thread Rick Johnson
On Thursday, July 28, 2016 at 11:32:19 PM UTC-5, huey.y...@gmail.com wrote: > Yes, Rick's code works great. Well, could you go a little > further? No, i think we've gone far enough. Just FYI, Rick doesn't do homework for free *OR* for a fee. Now, it's time for *YOU* to

Re: Ned Batchelder: Loop Like A Native

2016-08-07 Thread Rick Johnson
On Saturday, August 6, 2016 at 10:43:01 PM UTC-5, Steven D'Aprano wrote: > Yes. The two ways of ending the loop are distinct and different: > > - reach the end, and stop; > - bail out early. > > > When you read a book, there are two ways of stopping: > > - reach the end, and run out of pages t

Re: make an object read only

2016-08-07 Thread Rick Johnson
On Thursday, August 4, 2016 at 7:03:32 PM UTC-5, Lawrence D’Oliveiro wrote: > As GvR has said: “we’re all consenting adults here”. But as we've learned from animal farm, some are more consenting than others. -- https://mail.python.org/mailman/listinfo/python-list

Re: Win32 API in pywin32

2016-08-07 Thread Rick Johnson
On Thursday, August 4, 2016 at 6:50:28 PM UTC-5, jj0ge...@gmail.com wrote: > According to Python.org Mark Hammond has an Add-on > (pywin32) that supports Win32 and COM. Does anyone know if > the Add-on covers all Win32 API functions, and if not is > there a list of the subset of Win32 API function

Re: Win32 API in pywin32

2016-08-07 Thread Rick Johnson
On Thursday, August 4, 2016 at 6:58:05 PM UTC-5, Lawrence D’Oliveiro wrote: > On Friday, August 5, 2016 at 11:50:28 AM UTC+12, jj0ge...@gmail.com wrote: > > According to Python.org Mark Hammond has an Add-on (pywin32) that supports > > Win32 and COM. > > Are people still using Win32? I thought Win

Re: Awful code of the week

2016-08-08 Thread Rick Johnson
On Sunday, August 7, 2016 at 1:54:51 AM UTC-5, Steven D'Aprano wrote: > Seen in the office IRC channel: > > > (13:23:07) fred: near_limit = [] > (13:23:07) fred: near_limit.append(1) > (13:23:07) fred: near_limit = len(near_limit) > (13:23:09) fred: WTF Sure, this code smells of naus

Re: What is "self"?

2005-09-23 Thread Rick Wotnaz
Roy Smith <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Ron Adam <[EMAIL PROTECTED]> wrote: >> You can actually call it anything you want but "self" is sort >> of a tradition. > > That's true, but I think needs to be said a bit more > emphatically. There's no reason to call it anything

Re: What is "self"?

2005-09-23 Thread Rick Wotnaz
Terry Hancock <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On Friday 23 September 2005 07:11 am, Rick Wotnaz wrote: >> I've long thought that Guido missed an opportunity by not >> choosing to use 'i' as the instance identifier, and making it a >&

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-10-06 Thread Rick Wotnaz
Mike Meyer <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Grant Edwards <[EMAIL PROTECTED]> writes: >> On 2005-10-06, DaveM <[EMAIL PROTECTED]> wrote: Frankly, I can't watch Shakespeare or movies like "the full monty" or "trainspotting" because I can't understand a damn word t

Re: convert char to byte representation

2005-10-10 Thread Rick Wotnaz
Scott David Daniels <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Philipp H. Mohr wrote: >> I am trying to xor the byte representation of every char in a >> string with its predecessor. But I don't know how to convert a >> char into its byte representation. > ord('a') == 97; chr(97) ==

Re: Python doc problem example: gzip module (reprise)

2005-11-05 Thread Rick Wotnaz
"Gerard Flanagan" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Xah Lee wrote: >> Python Doc Problem Example: gzip >> [...] >> A quality documentation should be clear, succinct, precise. >> And, the least it assumes reader's expertise to obtain these >> qualities, the better it is. >> >>

Re: is parameter an iterable?

2005-11-16 Thread Rick Wotnaz
Steven D'Aprano <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > def foo(inputVal): > try: > for val in inputVal: > # do stuff > except TypeError, msg: > if msg == "iteration over non-sequence": > # handle non-iterable case > else: >

Re: is parameter an iterable?

2005-11-16 Thread Rick Wotnaz
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Rick Wotnaz wrote. > >> ... which leads me to belive that 'msg' is not type(str). It >> can be coerced (str(msg).find works as expected). But what >> exactly is msg? It

Re: about lambda

2005-11-20 Thread Rick Wotnaz
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > Shi Mu wrote: >> what does the following code mean? It is said to be used in the >> calculation of the overlaid area size between two polygons. >> map(lambda x:b.setdefault(x,[]),a) > > The equivalent of : > > def oh_

Re: Why are there no ordered dictionaries?

2005-11-23 Thread Rick Wotnaz
"Fuzzyman" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > Christoph Zwerschke wrote: >> - the internal keys list should be hidden > > I disagree. It is exposed so that you can manually change the > order (e.g. to create a "sorted" dict, rather than one ordered > by key insertion). >

Re: Why I need to declare import as global in function

2005-11-30 Thread Rick Wotnaz
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On 30 Nov 2005 00:58:45 -0800, [EMAIL PROTECTED] > declaimed the following in comp.lang.python: > >> yes I have imported math in the file I want to use it. But the >> imported module "math" is not visible in function withou

Re: General question about Python design goals

2005-12-01 Thread Rick Wotnaz
"Donn Cave" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: [...] > Tuples and lists really are intended to serve two fundamentally > different purposes. We might guess that just from the fact that > both are included in Python, in fact we hear it from Guido van > Rossum, and one might ad

RE: Making immutable instances

2005-12-01 Thread Rick Wotnaz
"Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Was it *really* necessary to send 4 separate emails to reply to > four sections of the same email? > > Good netiquette is to intersperse your comments with quoted > sections in a single email. > > Tim Delaney Good

Re: General question about Python design goals

2005-12-01 Thread Rick Wotnaz
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Rick Wotnaz wrote: > >> I'm sure Antoon wouldn't object if lists were to be allowed as >> dictionary keys, which would eliminate the multiple castings for >> that situation.

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-05 Thread Rick Wotnaz
[EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: >> a decent description or tutorial... is better > > Sound good but... we're programmers, not documentation > specialist or motivational speakers. Why, when I suggest fixing > a design defect with code, do so many programmers want to > respon

Re: subset permutations

2005-12-08 Thread Rick Wotnaz
Jay Parlar <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > http://www.bigbold.com/snippets/posts/show/753 A string is also iterable, so whether s is the string (as shown) or list('ACDEFGHIKLMNPQRSTVWY'), as you have it above, this should generate the 16 permutations, as a list of 4-

Re: % operation

2005-01-05 Thread Rick Holbert
It also looks like you are using an old version of Python running on an old version of Linux. Time to upgrade? Christopher Koppler wrote: > On Wed, 05 Jan 2005 15:36:30 +0900, Daewon YOON wrote: > >> >> Python 1.5.2 (#1, Jul 5 2001, 03:02:19) [GCC 2.96 2731 (Red Hat >> Linux 7.1 2 on

Re: Another look at language comparisons

2005-01-08 Thread Rick Parsons
there is hope for Python, as Guido has recently been seen with a > beard :-) > http://www.tbray.org/ongoing/When/200x/2004/12/08/-big/IMG_3061.jpg > > Regards, > Jan What about languages USED by men with beards? There may be hope for me yet. Regards, Rick -- http://mail.python.org/mailman/listinfo/python-list

Re: pulling info from website

2005-01-10 Thread Rick Holbert
Bob, Have a look at feedparser: http://www.feedparser.org/ http://diveintomark.org/projects/feed_parser/ For bbc news feeds, I use the following url: http://www.bbc.co.uk/syndication/feeds/news/ukfs_news/front_page/rss091.xml bob wrote: > i am trying to write a script for Xbox media center th

dict.updated

2005-01-12 Thread Rick Morrison
Would there be any way to add a method to all dict objects that operated like the .update() method, but also returned a reference to the updated dict? .update() is clumsy to use inside of list comprehensions and the like. Or am I missing something? Thanks, Rick -- http://mail.python.org

Re: dict.updated

2005-01-12 Thread Rick Morrison
seem to figure out. Yeah I know that's "bad", but to my mind so is polluting the global namespace with the "updated" function. -- Or maybe I'm just lazy and picked up too many bad habits from Javascript. Rick "Steven Bethard" <[EMAIL PROTECTED]> wrote in m

Where are gui-sig archives?

2005-07-06 Thread Rick Wotnaz
I was trying to view the gui-sig archives, but when I click on the link (from ), I get a "Not Found" error: The requested URL /pipermail/gui-sig/ was not found on this server. Apache/1.3.33 Server at mail.python.org Port 80 Does anyone have an active link to

Re: loop in python

2005-08-22 Thread Rick Wotnaz
km <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Hi all, > > Why is it that the implementation of empty loop so slow in > python when compared to perl ? > > #i did this in python (v 1.5) > for x in xrange(1000): > print x > # this took 0.017 seconds > -- >

Re: Reg python nature.

2005-08-23 Thread Rick Wotnaz
praba kar <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Dear All, >I want to know the link between c and python. > Some people with C background use Python instead > of programming in C.why? > I will now reveal the secret that explains why some people who know how to program i

Re: Bug in string.find; was: Re: Proposed PEP: New style indexing, was Re: Bug in slice type

2005-08-26 Thread Rick Wotnaz
Bryan Olson <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Steve Holden asked: > > Do you just go round looking for trouble? > > In the course of programming, yes, absolutly. > > > As far as position reporting goes, it seems pretty clear that > > find() will always report positive index

Re: Proposal: add sys to __builtins__

2005-09-01 Thread Rick Wotnaz
Michael Hoffman <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > What would people think about adding sys to __builtins__ so that > "import sys" is no longer necessary? This is something I must > add to every script I write that's not a one-liner since they > have this idiom at the bottom:

Re: Proposal: add sys to __builtins__

2005-09-04 Thread Rick Wotnaz
"Terry Reedy" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > > "Colin J. Williams" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Rick Wotnaz wrote: >>> +1 here. As far as I'm concerned, both os and sys c

Re: Proposal: add sys to __builtins__

2005-09-05 Thread Rick Wotnaz
"Michael J. Fromberger" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > In article <[EMAIL PROTECTED]>, > Rick Wotnaz <[EMAIL PROTECTED]> wrote: > >> Michael Hoffman <[EMAIL PROTECTED]> wrote in >> news:[EMAIL PROTECTED]

Re: Proposal: add sys to __builtins__

2005-09-06 Thread Rick Wotnaz
"Michael J. Fromberger" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > In article <[EMAIL PROTECTED]>, > Rick Wotnaz <[EMAIL PROTECTED]> wrote: > >> You're right that there is no necessity for such a change. I >> was not actually

Re: date diff calc

2004-11-29 Thread Rick Holbert
Here's how to do it as a one-liner: python -c "import datetime; import time; print 'Only %d days until Christmas' % (datetime.date(2004, 12, 25) - datetime.date.fromtimestamp(time.time())).days" Here's a slightly shorter way of doing it: python -c "import time; print 'Only %f more days until Ch

Re: jython and swing

2004-12-09 Thread Rick Holbert
Could it have something to do with your PATH or CLASSPATH settings? Here's a test script that works for me: #!/usr/bin/env jython from java import lang from javax import swing print "lang attributes: " for attr in dir(lang): print "\t%s" % attr print print "swing attributes: " for attr i

Re: PyWart: Python modules are not so "modular" after all!

2013-11-11 Thread Rick Johnson
On Monday, November 11, 2013 1:34:54 AM UTC-6, Steven D'Aprano wrote: > import sys > sys.modules["mymodule"] = any_object_you_like() Thanks for this great advice! I'm not particularly fond of injecting names and objects in this manner due to the "surprise factor", especially when the names are go

PyMyth: Global variables are evil... WRONG!

2013-11-11 Thread Rick Johnson
= One of the shortcomings of the current implementation of global variables is their inherent "flat" access nature. There is no hierarchy of globals, and once all the good names are taken, your screwed! "But Rick, even when we use

<    1   2   3   4   5   6   7   8   9   10   >