unittest vs py.test?

2005-03-31 Thread Roy Smith
I've used the standard unittest (pyunit) module on a few projects in the past and have always thought it basicly worked fine but was just a little too complicated for what it did. I'm starting a new project now and I'm thinking of trying py.test (http://codespeak.net/py/current/doc/test.html).

Re: Ternary Operator in Python

2005-04-01 Thread Roy Smith
praba kar <[EMAIL PROTECTED]> wrote: > Dear All, > I am new to Python. I want to know how to > work with ternary operator in Python. I cannot > find any ternary operator in Python. You answered your own question; there is no ternary operator in Python. There was a major debate on this new

Re: unittest vs py.test?

2005-04-01 Thread Roy Smith
Nigel Rowe <[EMAIL PROTECTED]> wrote: > Have you seen Grig Gheorghiu's 3 part comparison of unittest, and py.test? > > http://agiletesting.blogspot.com/2005/01/python-unit-testing-part-1-unittest.html > http://agiletesting.blogspot.com/2005/01/python-unit-testing-part-2-doctest.html > http://agil

Re: unittest vs py.test?

2005-04-01 Thread Roy Smith
Peter Hansen <[EMAIL PROTECTED]> wrote: > unittest can really be rather light. Most of our > test cases are variations on the following, with > primarily application-specific code added rather than > boilerplate or other unittest-related stuff: > > import unittest > > class TestCase(unittest.Tes

Re: Ternary Operator in Python

2005-04-01 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Carl Banks" <[EMAIL PROTECTED]> wrote: > Terry Reedy wrote: > > "praba kar" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > Dear All, > > >I am new to Python. I want to know how to > > > work with ternary operator in Python. I cannot >

Re: unittest vs py.test?

2005-04-01 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Peter Hansen <[EMAIL PROTECTED]> wrote: > As for Roy's comments: I use a small internally > developed driver script which uses os.walk to find > all the files matching tests/*_unit.py or tests/story*.py > in all subfolders of the project, and which runs them > in s

Re: unittest vs py.test?

2005-04-02 Thread Roy Smith
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Bengt Richter) > Is there a package that is accessible without svn? That seems to be its weak point right now. Fortunately, you can get pre-built svn clients for many platforms (http://subversion.tigris.org/project_packages.html#binary-packages

Re: unittest vs py.test?

2005-04-03 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > "Raymond Hettinger" <[EMAIL PROTECTED]> writes: > > When writing a large suite, you quick come to appreciate being able > > to use assert statements with regular comparision operators, debugging > > with normal print s

Re: unittest vs py.test?

2005-04-03 Thread Roy Smith
Scott David Daniels <[EMAIL PROTECTED]> wrote: > Any code depending upon __debug__ being 0 won't be tested. Sometimes > test structures update values as a side-effect of tracking the debugging > state. Not massively likely, but it makes for a scary environment when > your tests cannot be run on a

Re: unittest vs py.test?

2005-04-04 Thread Roy Smith
Peter Hansen <[EMAIL PROTECTED]> wrote: >It seems possible to me that I might have helped him >solely by pointing out that unittest might not be so >"heavy" as some people claimed. I got the impression >that he might be swayed by some unfounded claims not >even to look further at unittest, which

Re: unittest vs py.test?

2005-04-04 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Jeremy Bowers <[EMAIL PROTECTED]> wrote: > On Mon, 04 Apr 2005 22:50:35 +, John J. Lee wrote: > > What I don't understand about py.test (and trying it out seems > > unlikely to answer this) is why it uses the assert statement. > > unittest used to do that, too,

Re: Propagating poorly chosen idioms

2005-04-05 Thread Roy Smith
"Raymond Hettinger" <[EMAIL PROTECTED]> wrote: > The remainder of the unittest docs are somewhat obtuse and uninspiring. QOTW, perhaps? -- http://mail.python.org/mailman/listinfo/python-list

Re: unittest vs py.test?

2005-04-06 Thread Roy Smith
<[EMAIL PROTECTED]> wrote: >py.test is awesome, but there is one slight flaw in it. It produces to >much output. All I want to see when all tests pass is "All X passes >succeded!" (or something similar). py.test's output can be >distracting. I agree. -- http://mail.python.org/mailman/listinfo/pyt

Re: How to name Exceptions that aren't Errors

2005-04-07 Thread Roy Smith
Leo Breebaart <[EMAIL PROTECTED]> wrote: > I've recently become rather fond of using Exceptions in Python to > signal special conditions that aren't errors, but which I feel > are better communicated up the call stack via the exception > mechanism than via e.g. return values. > > For instance, I'

Re: database in python ?

2005-04-11 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello I need to build table which need searching data which needs more > power then dictionary or list in python, can anyone help me what kind > of database suitable for python light and easy to learn. Is mySQL a > n

Re: Compute pi to base 12 using Python?

2005-04-13 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Dan Bishop" <[EMAIL PROTECTED]> wrote: > But there's no reason other than tradition why you should arrange them > into groups of 10. Well, it is traditional for people to have 10 fingers :-) Other fun things to think about are negative bases. For example, 3(10)

Re: Codig style: " or """

2005-04-13 Thread Roy Smith
Sara Khalatbari <[EMAIL PROTECTED]> wrote: >What are the differences between " and """ ? The triple-quote form lets you write multi-line quoted strings: """This function does a lot of neat stuff. It takes many lines of text to describe what it does. Multiple paragraphs, even. """ >To be very

Re: Compute pi to base 12 using Python?

2005-04-13 Thread Roy Smith
Scott David Daniels <[EMAIL PROTECTED]> wrote: >If you think those are fun, try base (1j - 1) Get real. I can't imagine using anything so complex. -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping C++ Class Heirachy in Python

2005-04-18 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Chris Smith <[EMAIL PROTECTED]> wrote: > > Diez B Roggisch <[EMAIL PROTECTED]> writes: > > >> PyType_Ready but in Python the base class isn't recognised. Is > >> there anything obvious I'm missing? > > > Maybe - I'd go for one of the several avail

Re: Why does python class have not private methods? Will this never changed?

2005-04-19 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Simon Brunning <[EMAIL PROTECTED]> wrote: > On 4/19/05, could ildg <[EMAIL PROTECTED]> wrote: > > Python is an oop language, > > Yes. > > > Private stuff always makes programming much easier. > > That contention is, at best, debatable. See > http://groups-beta.g

Re: Why does python class have not private methods? Will this never changed?

2005-04-19 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Peter Hansen <[EMAIL PROTECTED]> wrote: >Roy Smith wrote: >> Simon Brunning <[EMAIL PROTECTED]> wrote: >>>On 4/19/05, could ildg <[EMAIL PROTECTED]> wrote: >>>>Private stuff always makes programming much easi

Re: exception handling

2005-04-20 Thread Roy Smith
Mage <[EMAIL PROTECTED]> wrote: >Hello, > > > def error_msg(msg): > sys.exit(msg) > > try: > do_something() > if value != my_wish: >error_msg('Invalid input') > except: > print "Fatal IO or Network error" > > This doesn't work because sys.exit raises an exceptio

Re: Why Python does *SLICING* the way it does??

2005-04-20 Thread Roy Smith
Antoon Pardon <[EMAIL PROTECTED]> wrote: > Personnaly I would like to have the choice. Sometimes I prefer to > start at 0, sometimes at 1 and other times at -13 or +7. Argggh. Having two (or more!) ways to do it, would mean that every time I read somebody else's code, I would have to figure out

Re: Why Python does *SLICING* the way it does??

2005-04-20 Thread Roy Smith
Antoon Pardon <[EMAIL PROTECTED]> wrote: >Op 2005-04-20, Roy Smith schreef <[EMAIL PROTECTED]>: >> Antoon Pardon <[EMAIL PROTECTED]> wrote: >> >>> Personnaly I would like to have the choice. Sometimes I prefer to >>> start at 0, sometimes at 1

Re: Why Python does *SLICING* the way it does??

2005-04-20 Thread Roy Smith
Terry Hancock wrote: >> I used to make "off by one" errors all the time in both C and Fortran, >> whereas I hardly ever make them in Python. Part of the reason may be that most loops over lists involve iterators, where the details of the index limits are hidden. In Python, you write: for item i

Re: How can I verify that a passed argument is an interible collection?

2005-04-21 Thread Roy Smith
Charles Krug <[EMAIL PROTECTED]> wrote: > Do I *coughs* simply *coughs* trap the exception created by: > >for v in x: > >when v is a scaler quantity? Sure. Why not? If you're coming from a type-bondage language like C++ or Java, it probabliy feels strange, but it's the Python way. It looks

Re: recording data between [ and ]

2005-04-21 Thread Roy Smith
Diez B. Roggisch <[EMAIL PROTECTED]> wrote: >> Yes, it does... may take me a few minutes to get my head around it >> though. Why do re's have to be so arcane and complicated... especially >> in Python? >> >> It's hard to preach 'ease of use' with stuff such as this in the >> language. Perhaps one

Re: goto statement

2005-04-21 Thread Roy Smith
Grant Edwards <[EMAIL PROTECTED]> wrote: >Sure, but what about the case where his program is on paper >tape and all he has for an editor is an ice pick? Can't you emulate that in emacs with M-X inclusive-or-overwrite-mode? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Greg Ewing <[EMAIL PROTECTED]> wrote: > Roy Smith wrote: > > > What would actually be cool is if Python were to support the normal math > > notation for open or closed intervals. > > > > foo = bar (1, 2) > > foo

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Roy Smith
Greg Ewing <[EMAIL PROTECTED]> wrote: > Also, everyone, please keep in mind that you always have > the option of using a *dictionary*, in which case your > indices can start wherever you want. > > You can't slice them, true, but you can't have everything. :-) Of course you can slice them, you jus

Re: Regular Expressions - Python vs Perl

2005-04-22 Thread Roy Smith
[EMAIL PROTECTED] (Ilpo Nyyssönen) wrote: > Of course it caches those when running. The point is that it needs to > recompile every time you have restarted the program. With short lived > command line programs this really can be a problem. Are you speculating that it might be a problem, or saying

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "possibilitybox" <[EMAIL PROTECTED]> wrote: > this code here: > > > def wordcount(lines): > for i in range(len(lines)/8): > words = lines[i].split(" ") > if not locals().has_key("frequency"): > frequency = {} > for word in

Re: Sorting an Edge List

2005-04-29 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Anthony D'Agostino" <[EMAIL PROTECTED]> wrote: > I need to sort this list: > [('A','Y'), ('J','A'), ('Y','J')] like this: > [('A','Y'), ('Y','J'), ('J','A')]. > > Note how the Ys and Js are together. All I need is for the second element of > one tuple to equal t

Re: datetime question

2013-11-12 Thread Roy Smith
In article , Grant Edwards wrote: > On 2013-11-11, Mark Lawrence wrote: > > On 11/11/2013 23:21, mm0fmf wrote: > >> On 11/11/2013 19:39, Ethan Furman wrote: > >>> On 11/11/2013 11:19 AM, Denis McMahon wrote: > On Mon, 11 Nov 2013 11:57:36 +0200, ?? ?? > wr

Re: datetime question

2013-11-12 Thread Roy Smith
In article , Alister wrote: > > Best practices say to move the value from local time to UTC as soon as > > possible, then store/use the UTC time internally for all operations. > > Only when it's about to be presented to the user should you convert it > > back to local time if you need to. > >

Re: PyMyth: Global variables are evil... WRONG!

2013-11-13 Thread Roy Smith
In article , Chris Angelico wrote: > I have yet to see any language that gives true globals. At very best, > they're just process-wide! Honestly. How am I supposed to write code > that accesses variables running on my New York server? Any one of a slew of remote procedure call protocols. These

Re: Odd msg received from list

2013-11-14 Thread Roy Smith
In article , Verde Denim wrote: > I got an odd message this morning from the list telling me that my > account was de-activated due to excessive bounces. I've only sent a > handful of messages to this board, but do read an awful lot of the posts > in order to learn more about the language. The m

The Spirit of Python

2013-11-14 Thread Roy Smith
https://twitter.com/dabeaz/status/400813245532876800/photo/1 "Now THIS is a Python book I should get. I'm guessing it's about design patterns. Or maybe just the GIL. " --- Roy Smith r...@panix.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Implementing #define macros similar to C on python

2013-11-14 Thread Roy Smith
In article , JL wrote: > One of my favorite tools in C/C++ language is the preprocessor macros. > > One example is switching certain print messages for debugging use only > > #ifdef DEBUG_ENABLE > DEBUG_PRINT print > #else > DEBUG_PRINT > > Is it possible to implement something similar in p

Re: python 3.3 repr

2013-11-15 Thread Roy Smith
; \) because ASR-33's didn't have curly braces (or lower case). Having P3's repr() escape non-ascii characters today makes about as much sense as expecting P2's repr() to escape curly braces (and vertical bars, and a few others) because not every terminal can print those. -- Roy Smith r...@panix.com -- https://mail.python.org/mailman/listinfo/python-list

Re: python 3.3 repr

2013-11-15 Thread Roy Smith
eft over). Anybody remember RAD-50? It let you represent a 6-character filename (plus a 3-character extension) in a 16 bit word. RT-11 used it, not sure if it showed up anywhere else. --- Roy Smith r...@panix.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Question regarding 2 modules installed via 'pip'

2013-11-16 Thread Roy Smith
In article , Ned Batchelder wrote: > Just as you use "which python" to figure out what "python" was executing, > "which pip" will help you figure out what "pip" is running. And along those lines, if you're unsure where you're importing a module from, you can examine the __file__ attribute to

Re: Automation

2013-11-16 Thread Roy Smith
In article , William Ray Wing wrote: > And my personal peeve - using it's (contraction) when its (possessive) > should have been used; occasionally vice-versa. And one of mine is when people write, "Here, here!" to signify agreement. What they really mean to write is, "Hear, hear!", meaning

Re: When to use assert

2013-11-17 Thread Roy Smith
In article <528871d5$0$29975$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > * Don't use assert for any error which you expect to recover from. > In other words, you've got no reason to catch an AssertionError > exception in production code. Which leads to another reason for u

Re: Program Translation - Nov. 14, 2013

2013-11-17 Thread Roy Smith
In article , Henry Law wrote: > On 17/11/13 14:37, E.D.G. wrote: > > All of my own important programs are written using Perl. I am starting > > to run into calculation speed limitations with one of the programs. > > Your Perl code is, er, sub-optimal. There is absolutely no point in > doing

Re: Program Translation - Nov. 14, 2013

2013-11-17 Thread Roy Smith
In article , Tim Prince wrote: > Perhaps you would start with an automatic indentation tool before > translating. You may have a rule against using current syntax and > indentation for Fortran, but others don't. Does anybody still use ratfor? -- https://mail.python.org/mailman/listinfo/pyth

Re: Fire Method by predefined string!

2013-11-17 Thread Roy Smith
In article , Tamer Higazi wrote: > Hi people! > > Assume we have 2 methods, one called Fire and the other __DoSomething. > > I want the param which is a string to be converted, that I can fire > directly a method. Is it somehow possible in python, instead of writing > if else statements ???! >

Re: Having trouble setting up an extremely simple server...

2013-11-21 Thread Roy Smith
In article , Cilantro MC wrote: > > First thing, get rid of all those semicolons. This is Python you're > > > > writing, not C++. Likewise, the extra parens in your while statements. > > > > > > > > Your problem is that you're doing the accept() inside your main loop on > > > > the serv

Re: Having trouble setting up an extremely simple server...

2013-11-21 Thread Roy Smith
In article <9e773107-5a6c-486b-bef2-186101d8f...@googlegroups.com>, cilantr...@gmail.com wrote: > I'm attempting to set up an extremely simple server that receives a string, > and returns a string. However, I have 2 problems. I'm able to receive the > string from the client fine, but it only wi

Re: Having trouble setting up an extremely simple server...

2013-11-22 Thread Roy Smith
In article <528eec7a$0$29992$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > There are all sorts of things that you can do that don't make your code > "wrong" but do make it difficult to deal with. Why stop with semi-colons? > > import socket; pass; pass; pass; pass; pass; > serv

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-22 Thread Roy Smith
In article , Bharath Kummar wrote: > Could you please help me with my current research ? Am implementing the > concept in python language. > My doubts are : [Note to readers of American/British English; Indian English uses "doubt" the same way we would use "question"] > 1) Is it possible t

Re: select.select()

2013-11-22 Thread Roy Smith
In article , Bhanu Karthik wrote: > please help me.. what does the following line do? > > read_sockets,write_sockets,error_sockets = > select.select(CONNECTION_LIST,[],[]) This is a little tricky. First,read the docs at http://docs.python.org/2/library/select.html. There's a lot of complic

Re: Using sh library with grep command

2013-11-23 Thread Roy Smith
In article , Luca wrote: > I'm trying to use sh (https://pypi.python.org/pypi/sh) for calling > system grep command but it's now working as expected. > > An example: > > import sh > sh.grep('abc', os.getcwd(), '-r') > > But I get the ErrorReturnCode_1: exception, that I learned is the

Re: stuck at this from so much time,need help....please ..

2013-11-23 Thread Roy Smith
In article <8445e47e-7efe-4f37-9b40-db2896d58...@googlegroups.com>, Bhanu Karthik wrote: > data = sock.recv(RECV_BUFFER) > username = str(sock.getpeername()) > username = usernames[username] > if data == "/quit"

Re: Implement logic on object.attribute and object.attribute()

2013-11-24 Thread Roy Smith
In article , Chris Angelico wrote: > On Mon, Nov 25, 2013 at 12:45 AM, Steven D'Aprano > wrote: > > Not quite impossible. All you need is an object that behaves like a > > string, except it has a __call__ method. Here's a sketch of a solution, > > completely untested. > > > > class Magic_HTTP_T

Re: calculate part of solid circle in 2D array

2013-11-25 Thread Roy Smith
In article <1fc9a269-4847-4d29-a35e-5cf91731e...@googlegroups.com>, Robert Voigtländer wrote: > Thanks a lot for the links. > > I don't need it to be drawn. I need the fields within the arc for some > statistical calculations for an occupancy map. > So the target is a 2D array, not a picture.

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-26 Thread Roy Smith
In article , Antoon Pardon wrote: > So I think we may expect more effort from the writer in trying to be > understandable than from the readers in trying to understand. And > that includes idiom use. We live in an international world (otherwise we wouldn't need that annoying unicode stuff).

Re: Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

2013-11-27 Thread Roy Smith
In article , alex23 wrote: > On 27/11/2013 7:12 PM, Antoon Pardon wrote: > > However that there is no perfect solution doesn't imply > > we can't expect some effort from those with english as a mother > > tongue to search for ways in which to express themselves that are > > more likely to be und

Re: Python and PEP8 - Recommendations on breaking up long lines?

2013-11-28 Thread Roy Smith
In article <34479463-b8a8-4417-9989-cd2936946...@googlegroups.com>, Victor Hooi wrote: > cur.executemany("INSERT INTO foobar_foobar_files VALUES (?)", > [[os.path.relpath(filename, foobar_input_folder)] for > filename in filenames]) I don't often wri

Re: Managing Google Groups headaches

2013-11-28 Thread Roy Smith
In article , Alister wrote: > Perhaps the best option is for everybody to bombard Google with bug > reports (preferably typed with extra long lines & double spaced as that > is clearly what they are used to & we would not want to upset them would > we? ) It's pretty clear Google doesn't care

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Roy Smith
In article <529934dc$0$29993$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > (8) What's the uppercase of "baffle" spelled with an ffl ligature? > > Like most other languages, Python 3.2 fails: > > py> 'baffle'.upper() > 'BAfflE' > > but Python 3.3 passes: > > py> 'baffle'.upper

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Roy Smith
In article , Chris Angelico wrote: > On Sat, Nov 30, 2013 at 1:08 PM, Roy Smith wrote: > > I would certainly expect, x.lower() == x.upper().lower(), to be True for > > all values of x over the set of valid unicode codepoints. Having > > u"\uFB04".upper() ==>

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Roy Smith
In article <529967dc$0$29993$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > You edited my text to remove the ligature? That's... unfortunate. It was un-ligated by the time it reached me. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Unicode handling wins again -- mostly

2013-11-29 Thread Roy Smith
In article <529967dc$0$29993$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > > The whole idea of ligatures like fi is purely typographic. > > In English, that's correct. I'm not sure if we can generalise that to all > languages that have ligatures. It also partly depends on how y

Re: Python Unicode handling wins again -- mostly

2013-11-30 Thread Roy Smith
In article , Chris Angelico wrote: > On Sun, Dec 1, 2013 at 11:54 AM, Steven D'Aprano > wrote: > > On Sat, 30 Nov 2013 18:52:48 -0600, Tim Chase wrote: > > > >> On 2013-12-01 00:22, Steven D'Aprano wrote: > >>> * KELVIN SIGN versus LATIN CAPITAL LETTER A > >> > >> I should hope so ;-) > > > > >

Re: Extending the 'function' built-in class

2013-12-01 Thread Roy Smith
In article <529b8ba2$0$2270$426a7...@news.free.fr>, "G." wrote: > 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 ? > > Regards, G. It really helps to g

Re: Managing Google Groups headaches

2013-12-02 Thread Roy Smith
In article , Neil Cerutti wrote: > On 2013-11-28, Roy Smith wrote: > > In article , > > Alister wrote: > >> Perhaps the best option is for everybody to bombard Google > >> with bug reports (preferably typed with extra long lines & > >> double s

Re: Code of Conduct, Trolls, and Thankless Jobs [was Re: Python Unicode handling wins again -- mostly]

2013-12-02 Thread Roy Smith
In article , Mark Lawrence wrote: > My fellow Pythonistas, ask not what our language can do for you, ask > what you can do for our language. "I believe that Pythonistas should commit themselves to achieving the goal, before this decade is out, of making Python 3 the default version and havin

Re: [OT] Managing Google Groups headaches

2013-12-02 Thread Roy Smith
In article , Michael Torrie wrote: > I wish Google hadn't bought a lot of things. Seems like they bye up a > lot of cool, nerd-centric apps and companies and then turned them into > apps that do less and do it poorly, but in a slick way that appeals to > the unwashed masses. And add "social" t

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Roy Smith
In article <17gt99hg615jfm7bdid26185884d2pf...@4ax.com>, Tim Roberts wrote: > Piotr Dobrogost wrote: > > > >Attribute access syntax being very concise is very often preferred > >to dict's interface. > > It is not "very concise". It is slightly more concise. > > x = obj.value1 > x =

Re: Managing Google Groups headaches

2013-12-04 Thread Roy Smith
In article , Rich Kulawiec wrote: > Yes, I'm > aware of web forums: I've used hundreds of them. They suck. They ALL > suck, they just all suck differently. I could spend the next several > thousand lines explaining why, but instead I'll just abbreviate: they > don't handle threading, they don

Re: Why is there no natural syntax for accessing attributes with names not being valid identifiers?

2013-12-04 Thread Roy Smith
In article , Dennis Lee Bieber wrote: > Spaces? I present to you two FORTRAN statements > > DO 10 I = 3 . 14159 > and > DO10I = 3 , 1 4 1 5 9 > > Which is the loop and which is the assignment? I know it's rude to quote oneself, but

Re: The Python license

2013-12-04 Thread Roy Smith
In article , musicdenotat...@gmail.com wrote: Now that's the kind of software license I like. Short, and easy to understand. -- https://mail.python.org/mailman/listinfo/python-list

Re: Packaging a proprietary Python library for multiple OSs

2013-12-05 Thread Roy Smith
In article <58d49c5b-c837-4dac-b764-369fea025...@googlegroups.com>, Michael Herrmann wrote: > 1. Is it considered a bad idea in the Python community to ship one large Zip > file with all dependencies? Yes. > How do *you* prefer to obtain and install Python libraries? "pip install" > 2. I

Re: Packaging a proprietary Python library for multiple OSs

2013-12-05 Thread Roy Smith
On Thursday, December 5, 2013 11:20:41 AM UTC-5, Chris Angelico wrote: > No, it's not like that. It's that there are some people who, despite > truckloads of evidence to the contrary, still think that Google Groups > > is worth using. Rusi is one of them. Fortunately, he has defended his > > posit

Re: Managing Google Groups headaches

2013-12-05 Thread Roy Smith
In article <51007240-6bc9-4f0b-9937-4883bcc0c...@googlegroups.com>, rusi wrote: > On Thursday, December 5, 2013 6:28:54 AM UTC+5:30, Roy Smith wrote: > > The real problem with web forums is they conflate transport and > > presentation into a single opaque blob, and are pr

Re: ASCII and Unicode [was Re: Managing Google Groups headaches]

2013-12-06 Thread Roy Smith
Steven D'Aprano pearwood.info> writes: > Yes, it appears that MT-NewsWatcher is *deeply, deeply* confused about > encodings and character sets. It doesn't just assume things are ASCII, > but makes a half-hearted attempt to be charset-aware, but badly. I can > only imagine that it was written b

Re: Eliminate "extra" variable

2013-12-06 Thread Roy Smith
In article , Joel Goldstick wrote: > Python lets you iterate over a list directly, so : > > for d in originalData: > dateStr, freq, source = d > data[source] = freq I would make it even simpler: > for dateStr, freq, source in originalData: > data[source] = freq

Re: One liners

2013-12-06 Thread Roy Smith
In article , Joel Goldstick wrote: > Aside from django urls, I am not sure I ever wrote regexes in python. For > some reason they must seem awfully sexy to quite a few people. Back to my > point above -- ever try to figure out a complicated regex written by > someone else? Regex has a bad rap

Re: One liners

2013-12-06 Thread Roy Smith
In article <52a287cb$0$30003$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > The ternary if is slightly unusual and unfamiliar It's only unusual an unfamiliar if you're not used to using it :-) Coming from a C/C++ background, I always found the lack of a ternary expression rath

Re: Managing Google Groups headaches

2013-12-06 Thread Roy Smith
In article <52a290ed$0$30003$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > In contrast, that is not the case with nearly all web forums. By > deliberate design, or mere ignorance and neglect, they mix up the message > you care about ("Hi Bob...") and the stuff you need to get t

Re: One liners

2013-12-06 Thread Roy Smith
In article , Dan Stromberg wrote: > A lot of things people do with regex's, could be done with string methods > more clearly and concisely. That is true. The problem is, there are a lot of things for which regex is the right tool, but people get out of practice using them (or never learned h

Re: Managing Google Groups headaches

2013-12-07 Thread Roy Smith
In article <31f1bb84-1432-446c-a7d4-79ce16f2a...@googlegroups.com>, wxjmfa...@gmail.com wrote: > It is on this level the FSR fails. What is "FSR"? I apologize if this was explained earlier in the thread and I can't find the reference. https://en.wikipedia.org/wiki/FSR#Science_and_technology w

Re: Is It Bug?

2013-12-07 Thread Roy Smith
In article , Chris Angelico wrote: > The first thing to get your head around is Python string literals. > You'll find them well described in the online tutorial, or poke around > in the interactive interpreter. A couple of ideas to explore along those lines: 1) Read up on raw strings, i.e. r

Re: python programming help

2013-12-08 Thread Roy Smith
In article <264c1144-5d04-4ad0-aa32-f4e6770d2...@googlegroups.com>, rafaella...@gmail.com wrote: > i have a dictionary with names and ages for each name. I want to write a > function that takes in an age and returns the names of all the people who are > that age. > please help Homework problem

Re: Eliminate "extra" variable

2013-12-08 Thread Roy Smith
In article , Mark Lawrence wrote: > On 08/12/2013 18:58, Tim Chase wrote: > > On 2013-12-07 23:14, Igor Korot wrote: > > [big snip] > > > > > Whenever I need date manipulations I always reach out to this > http://labix.org/python-dateutil The problem with dateutil is it's dog slow. Sure, I

Re: django - adding a button with parallel functionality

2013-12-08 Thread Roy Smith
In article , chip9m...@gmail.com wrote: > Hi all! I'll try to be clear and brief. > > I have created a django project some months ago. It is an online survey. > Now I want to add a button that when pressed adds something to a database, > but does not change any existing functionalities. > > B

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-09 Thread Roy Smith
In article , Chris Angelico wrote: > On Mon, Dec 9, 2013 at 11:23 PM, Oscar Benjamin > wrote: > > 1) Some people felt that Python is not an "industry standard" unlike > > C/C++/Java and that it is not as good for employability. > > Disprove that by checking any job listing site in your area/in

Re: Meta Fight About Posting (was: python programming help)

2013-12-09 Thread Roy Smith
In article <058a0d03-4017-4e95-b402-94d8959ec...@googlegroups.com>, rusi wrote: > On Monday, December 9, 2013 9:14:08 PM UTC+5:30, Travis Griggs wrote: > > As long as we¹re in full scale rant drift, I¹d like to remind others > > of the time honored tradition of changing the post subject, when, >

Re: Meta Fight About Posting (was: python programming help)

2013-12-09 Thread Roy Smith
In article , Travis Griggs wrote: > The python mailing list is the only one I know of that is cross posted > between 3 different technologies. Maybe it¹s an outgrowth of the ³multi > paradigm² philosophy of python or something. Usenet is not a bicycle. -- https://mail.python.org/mailman/list

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-09 Thread Roy Smith
In article , bob gailer wrote: > Understanding the real machine may be of interest to some but is not > essential. Surprisingly (to myself, anyway), I agree. Languages like C, Fortran, and Java, are fairly close to the machine. They all expose (C more than the others) fundamental machine fe

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-09 Thread Roy Smith
In article , "Rhodri James" wrote: > Pascal and BCPL contrasted rigid typing with practically non-existent > typing Wow, you actually used BCPL? I didn't realize the language ever had any real use. I had only ever heard of it in the context of being a C precursor, mentioned once in an int

Re: interactive help on the base object

2013-12-09 Thread Roy Smith
In article <5f7e3e2f-2f86-4a2b-bea5-6e70b6fc2...@googlegroups.com>, rusi wrote: > On Tuesday, December 10, 2013 10:40:27 AM UTC+5:30, Steven D'Aprano wrote: > > By the way, I'm curious. Why are discussions about object oriented coding > > off-topic to Python? This is not a rhetorical question.

Re: interactive help on the base object

2013-12-09 Thread Roy Smith
In article <52a6af26$0$2829$c3e8da3$76491...@news.astraweb.com>, Steven D'Aprano wrote: > > What about whether the arrows should have solid heads, open heads, > > barbed heads, double-barbed heads, or circles (filled or open)? Surely > > you can't expect people to write decent programs when th

Re: Trouble with Multi-threading

2013-12-10 Thread Roy Smith
In article , dan.r...@parker.com wrote: > "PLEASE NOTE: The preceding information may be confidential or > privileged. It only should be used or disseminated for the purpose > of conducting business with Parker. If you are not an intended > recipient, please notify the sender by replying to this

Re: Is there any advantage to using a main() in python scripts?

2013-12-11 Thread Roy Smith
In article <32615c9a-b983-4399-bb55-6df6c230f...@googlegroups.com>, JL wrote: > Python scripts can run without a main(). What is the advantage to using a > main()? Is it necessary to use a main() when the script uses command line > arguments? (See script below) > > #!/usr/bin/python > > impo

Re: Is there any advantage to using a main() in python scripts?

2013-12-11 Thread Roy Smith
In article , mar...@letterboxes.org wrote: > I would agree with the previous post but also add that I've stopped > calling the main function "main()" and usually give it a more > descriptive name, such as "bake_cookies()" or whatever. I think that > that makes it clearer what it's doing when use

Re: grab dict keys/values without iterating ?!

2013-12-11 Thread Roy Smith
In article <3efc283f-419d-41b6-ad20-c2901c3b9...@googlegroups.com>, rusi wrote: > The classic data structure for this is the trie: > General idea: http://en.wikipedia.org/wiki/Trie > In python: > http://stackoverflow.com/questions/11015320/how-to-create-a-trie-in-python/ I agree that a trie fit

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-11 Thread Roy Smith
In article , rusi wrote: > Kernighan and Ritchie set an important "first" in our field by making > "Hello World" their first program. Yup. > People tend to under-estimate the importance of this: > Many assumptions need to be verified/truthified/dovetailed > starting from switching on the machi

Re: Experiences/guidance on teaching Python as a first programming language

2013-12-11 Thread Roy Smith
In article , Mark Lawrence wrote: > On 11/12/2013 16:04, Chris Angelico wrote: > > I strongly believe that a career > > programmer should learn as many languages and styles as possible, but > > most of them can wait. > > I chuckle every time I read this one. Five years per language, ten > lan

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