Re: Beazley 4E P.E.R, Page29: Unicode

2013-07-14 Thread Joshua Landau
On 14 July 2013 04:09, vek.m1...@gmail.com wrote: http://stackoverflow.com/questions/17632246/beazley-4e-p-e-r-page29-unicode directly writing a raw UTF-8 encoded string such as 'Jalape\xc3\xb1o' simply produces a nine-character string U+004A, U+0061, U+006C, U+0061, U+0070, U+0065,

Re: Documenting builtin methods

2013-07-12 Thread Joshua Landau
On 12 July 2013 04:43, alex23 wuwe...@gmail.com wrote: My last post seems to have been eaten by either Thunderbird or the EternalSeptember servers, but it contained an erroneous claim that the straight function version performed as well as the factory one. However, in the interim a co-worker

Re: RE Module Performance

2013-07-12 Thread Joshua Landau
On 12 July 2013 10:27, Chris Angelico ros...@gmail.com wrote: On Fri, Jul 12, 2013 at 7:23 PM, wxjmfa...@gmail.com wrote: I would not care too much about the performance of re. With the new Flexible String Representation, you can use a logarithmic scale to compare re results. To be

Re: RE Module Performance

2013-07-12 Thread Joshua Landau
On 12 July 2013 11:45, Devyn Collier Johnson devyncjohn...@gmail.com wrote: Could you explain what you mean? What and where is the new Flexible String Representation? Do not worry. jmf is on about his old rant comparing broken previous versions of Python to newer ones which in some

Re: hex dump w/ or w/out utf-8 chars

2013-07-12 Thread Joshua Landau
On 9 July 2013 10:34, wxjmfa...@gmail.com wrote: There is no symbole for radian because mathematically radian is a pure number, a unitless number. You can hower sepecify a = ... in radian (rad). Isn't a superscript c the symbol for radians? --

[issue2292] Missing *-unpacking generalizations

2013-07-12 Thread Joshua Landau
Joshua Landau added the comment: http://www.python.org/dev/peps/pep-0448/ is out; see what you think. See http://mail.python.org/pipermail/python-ideas/2013-July/021872.html for all the juicy discussion so far. -- nosy: +Joshua.Landau ___ Python

Re: Documenting builtin methods

2013-07-11 Thread Joshua Landau
On 11 July 2013 07:06, Steven D'Aprano st...@pearwood.info wrote: But really, I'm having trouble understanding what sort of application would have run an iterator to exhaustion without doing anything with the values as the performance bottleneck :-) Definitely not this one. Heck, there's even

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Joshua Landau
On 10 July 2013 10:12, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, Jul 10, 2013 at 2:46 AM, Mats Peterson matsp...@aim.com wrote: Then they would have full control of this list and what gets pos Ahhh so this is pos, right? Telling the truth? Interesting. I don't know what you mean by

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Joshua Landau
On 10 July 2013 08:55, Mats Peterson matsp...@aim.com wrote: Unjustified Insult. [anumuson from Stack Overflow] has deleted all my postings regarding Python regular expression matching being extremely slow compared to Perl. Additionally my account has been suspended for 7 days. Unjustified

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Joshua Landau
Google Groups is writing about your recently sent mail to Joshua Landau. Unfortunately this address has been discontinued from usage for the foreseeable future. The sent message is displayed below: On 10 July 2013 12:08, Robert Kern robert.k...@gmail.com wrote: On 2013-07-10 10:52, Joshua

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Joshua Landau
On 10 July 2013 13:01, Mats Peterson matsp...@aim.com wrote: Antoon Pardon antoon.par...@rece.vub.ac.be wrote: Op 10-07-13 11:03, Mats Peterson schreef: Not a troll. It's just hard to convince Python users that their beloved language would have inferior regular expression performance to Perl.

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Joshua Landau
On 10 July 2013 12:14, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: Op 10-07-13 11:03, Mats Peterson schreef: Not a troll. It's just hard to convince Python users that their beloved language would have inferior regular expression performance to Perl. All right, you have convinced me. Now

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Joshua Landau
On 10 July 2013 13:35, Skip Montanaro s...@pobox.com wrote: Either that or it's funny only to other Australians. Or the Dutch. Or us Brits. -- http://mail.python.org/mailman/listinfo/python-list

Re: Prime number generator

2013-07-10 Thread Joshua Landau
On 10 July 2013 15:00, Chris Angelico ros...@gmail.com wrote: And now for something completely different. I knocked together a prime number generator, just for the fun of it, that works like a Sieve of Eratosthenes but unbounded. It keeps track of all known primes and the next composite that

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Joshua Landau
On 10 July 2013 10:00, Steven D'Aprano st...@pearwood.info wrote: On Wed, 10 Jul 2013 07:55:05 +, Mats Peterson wrote: A moderator who calls himself “animuson” on Stack Overflow doesn’t want to face the truth. He has deleted all my postings regarding Python regular expression matching

Re: Prime number generator

2013-07-10 Thread Joshua Landau
On 10 July 2013 17:15, Chris Angelico ros...@gmail.com wrote: On Thu, Jul 11, 2013 at 1:47 AM, bas blswink...@gmail.com wrote: On Wednesday, July 10, 2013 5:12:19 PM UTC+2, Chris Angelico wrote: Well, that does answer the question. Unfortunately the use of lambda there has a severe performance

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Joshua Landau
On 10 July 2013 18:15, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 10 Jul 2013 16:54:02 +0100, Joshua Landau wrote: On 10 July 2013 10:00, Steven D'Aprano st...@pearwood.info wrote: On Wed, 10 Jul 2013 07:55:05 +, Mats Peterson wrote: A moderator who calls himself

Re: Stack Overflow moderator “animuson”

2013-07-10 Thread Joshua Landau
On 10 July 2013 17:18, Ethan Furman et...@stoneleaf.us wrote: On 07/10/2013 08:54 AM, Joshua Landau wrote: On 10 July 2013 10:00, Steven D'Aprano st...@pearwood.info wrote: On Wed, 10 Jul 2013 07:55:05 +, Mats Peterson wrote: A moderator who calls himself “animuson” on Stack Overflow

Re: Prime number generator

2013-07-10 Thread Joshua Landau
On 10 July 2013 19:56, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, Jul 10, 2013 at 11:47 AM, Joshua Landau jos...@landau.ws wrote: If you care about speed, you might want to check the heapq module. Removing the smallest item and inserting a new item in a heap both cost O(log(N)) time

Re: the general development using Python

2013-07-10 Thread Joshua Landau
On 11 July 2013 00:18, CM cmpyt...@gmail.com wrote: I was mainly talking in the context of the original post, where it seems something slightly different was meant. If you're deploying to customers, you'd want to offer them an installer. At least, I think you would. That's different from

Re: Stupid ways to spell simple code

2013-07-10 Thread Joshua Landau
On 30 June 2013 07:06, Chris Angelico ros...@gmail.com wrote: So, here's a challenge: Come up with something really simple, and write an insanely complicated - yet perfectly valid - way to achieve the same thing. Bonus points for horribly abusing Python's clean syntax in the process. This

Documenting builtin methods

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

Re: Documenting builtin methods

2013-07-10 Thread Joshua Landau
On 11 July 2013 04:57, Ben Finney ben+pyt...@benfinney.id.au wrote: Joshua Landau jos...@landau.ws writes: I have this innocent and simple code: from collections import deque exhaust_iter = deque(maxlen=0).extend exhaust_iter.__doc__ = Exhaust an iterator efficiently without caching any

Re: Documenting builtin methods

2013-07-10 Thread Joshua Landau
On 11 July 2013 05:13, Joshua Landau jos...@landau.ws wrote: misunderstanding in response to misunderstanding Ah, I get it. It is easy to misread my post as I have this exhaust_iter and it's obvious it doesn't work because why else would I post here what do I do HALP! Yeah, sorry -- it wasn't

Re: the general development using Python

2013-07-09 Thread Joshua Landau
On 9 July 2013 03:08, Adam Evanovich ajetrum...@gmail.com wrote: Joshua, Why did you send me an email reply instead of replying in the google groups? Apologies, although it's not quite that simple. I access this list the way it was originally intended -- through EMail. I replied to all, which

Re: the general development using Python

2013-07-09 Thread Joshua Landau
On 9 July 2013 05:46, CM cmpyt...@gmail.com wrote: *I said*: There are projects that bundle the CPython interpreter with your project, but this makes those files really big. Maybe 5-20 MB. That's a lot bigger than a few hundred K, but it's not that important to keep size down, really. Fair

Re: the general development using Python

2013-07-09 Thread Joshua Landau
On 10 July 2013 00:35, CM cmpyt...@gmail.com wrote: On Tuesday, July 9, 2013 5:13:17 PM UTC-4, Joshua Landau wrote: On 9 July 2013 03:08, Adam Evanovich ajetrum...@gmail.com wrote: Can you wrap source code/libs/apps into an EXE and just send that to the end user? Or is it more complicated

Re: the general development using Python

2013-07-09 Thread Joshua Landau
On some multitude of times, CM cmpyt...@gmail.com wrote: What I was thinking of was that if you are going to sell software, you want to make it as easy as possible, and that includes not making the potential customer have to install anything, or even agree to allow you to explicitly install

Re: the general development using Python

2013-07-09 Thread Joshua Landau
On 10 July 2013 05:49, CM cmpyt...@gmail.com wrote: On Wednesday, July 10, 2013 12:12:16 AM UTC-4, Joshua Landau wrote: On some multitude of times, CM cmpyt...@gmail.com wrote: What I was thinking of was that if you are going to sell software, you want to make it as easy as possible

Re: Illegal suggestions on python list

2013-07-08 Thread Joshua Landau
On 5 July 2013 08:34, Chris Angelico ros...@gmail.com wrote: On Fri, Jul 5, 2013 at 5:23 PM, Νίκος Gr33k ni...@superhost.gr wrote: Of course we all know that a serial/patch/keygen/crack can be found for this great edit very easily on warez or torrentz sites so it was like a common secret to

Re: Newbie. Need help

2013-07-08 Thread Joshua Landau
On 8 July 2013 09:53, Sanza101 sandile.mnu...@gmail.com wrote: I just started using Python recently, and i need help with the following: Please assist. Rather than saying you want help with Please assist, why don't you ask a question? I find when people start their post with I need help,

Re: A small question about PEP 8

2013-07-08 Thread Joshua Landau
On 8 July 2013 00:32, Xue Fuqiao xfq.f...@gmail.com wrote: Hi all, (English is not my native language; please excuse typing errors.) I'm a Python newbie and just started reading PEP 8. PEP says: --- |The closing

Re: Newbie. Need help

2013-07-08 Thread Joshua Landau
On 8 July 2013 13:05, Sandile Mnukwa sandile.mnu...@gmail.com wrote: Hi Joshua, Hello. You replied off-list (to me only, not to Python-list). I imagine this was a mistake, so I'm posting to Python-list again. If this wasn't a mistake, then I apologize and suggest telling people when you mean to

Re: A small question about PEP 8

2013-07-08 Thread Joshua Landau
On 8 July 2013 13:02, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Mon, 08 Jul 2013 11:39:21 +0100, Joshua Landau wrote: Imagine: a_wonderful_set_of_things = { bannanas_made_of_apples, chocolate_covered_horns, doors_that_slide, china_but_on_the_moon

Re: How do I write a script to generate 10 random EVEN numbers and write them to a .txt file?

2013-07-08 Thread Joshua Landau
On 8 July 2013 13:27, Dave Angel da...@davea.name wrote: One of your classmates has already posted the question. However, you win the prize for a better subject line. Or are you the same student, changing your name and wasting our time by starting a new thread. Considering the body of the

Re: Default scope of variables

2013-07-08 Thread Joshua Landau
On 8 July 2013 12:54, Neil Cerutti ne...@norwich.edu wrote: On 2013-07-07, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Fri, 05 Jul 2013 13:24:43 +, Neil Cerutti wrote: for x in range(4): print(x) print(x) # Vader NOoOO!!! That loops do *not* introduce a

Re: Default scope of variables

2013-07-08 Thread Joshua Landau
On 4 July 2013 05:36, Chris Angelico ros...@gmail.com wrote: On Thu, Jul 4, 2013 at 2:30 PM, Joshua Landau joshua.landau...@gmail.com wrote: That said, I'm not too convinced. Personally, the proper way to do what you are talking about is creating a new closure. Like: for i in range(100

Re: make sublists of a list broken at nth certain list items

2013-07-08 Thread Joshua Landau
On 8 July 2013 21:52, CM cmpyt...@gmail.com wrote: I'm looking for a Pythonic way to do the following: I have data in the form of a long list of tuples. I would like to break that list into four sub-lists. The break points would be based on the nth occasion of a particular tuple. (The

Re: make sublists of a list broken at nth certain list items

2013-07-08 Thread Joshua Landau
On 8 July 2013 22:24, Joshua Landau joshua.landau...@gmail.com wrote: if count == 60: Obviously this should be: if count == length: -- http://mail.python.org/mailman/listinfo/python-list

Re: homework + obfuscation ... this might work ...

2013-07-08 Thread Joshua Landau
On 8 July 2013 21:43, Skip Montanaro s...@pobox.com wrote: I have an idea. Take the threads where students ask the list to do their homework for them (but don't have the cojones to admit that's what they are doing), and merge them with the obfuscated Python idea. A group of people could come

Re: hex dump w/ or w/out utf-8 chars

2013-07-08 Thread Joshua Landau
On 8 July 2013 22:38, MRAB pyt...@mrabarnett.plus.com wrote: On 08/07/2013 21:56, Dave Angel wrote: Characters do not have a width. [snip] It depends what you mean by width! :-) Try this (Python 3): print(A\N{FULLWIDTH LATIN CAPITAL LETTER A}) AA Serious question: How would one find

Re: the general development using Python

2013-07-08 Thread Joshua Landau
On 9 July 2013 02:45, ajetrum...@gmail.com wrote: all, I am unhappy with the general Python documentation and tutorials. I have worked with Python very little and I'm well aware of the fact that it is a lower-level language that integrates with the shell. I came from a VB legacy

Re: Numeric coercions

2013-07-07 Thread Joshua Landau
On 7 July 2013 09:15, Vlastimil Brom vlastimil.b...@gmail.com wrote: 2013/7/7 Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: I sometimes find myself needing to promote[1] arbitrary numbers (Decimals, Fractions, ints) to floats. E.g. I might say: numbers = [float(num) for num in

Re: Important features for editors

2013-07-06 Thread Joshua Landau
On 6 July 2013 06:19, rusi rustompm...@gmail.com wrote: On Saturday, July 6, 2013 10:05:14 AM UTC+5:30, Joshua Landau wrote: I never got why Vi doesn't support Ctrl-C by default -- it's not like it's a used key-combination and it would have helped me so many times when I was younger. Dunno

Re: Simple recursive sum function | what's the cause of the weird behaviour?

2013-07-06 Thread Joshua Landau
On 6 July 2013 13:59, Russel Walker russ.po...@gmail.com wrote: Since I've already wasted a thread I might as well... Does this serve as an acceptable solution? def supersum(sequence, start=0): result = type(start)() for item in sequence: try: result +=

Re: need data structure to for test results analysis

2013-07-06 Thread Joshua Landau
On 6 July 2013 15:58, terry433...@googlemail.com wrote: I have a python program that reads test result information from SQL and creates the following data that I want to capture in a data structure so it can be prioritized appropriately :- test_name new fail

Re: Numeric coercions

2013-07-06 Thread Joshua Landau
On 7 July 2013 04:56, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I sometimes find myself needing to promote[1] arbitrary numbers (Decimals, Fractions, ints) to floats. E.g. I might say: numbers = [float(num) for num in numbers] or if you prefer: numbers = map(float,

Re: Numeric coercions

2013-07-06 Thread Joshua Landau
On 7 July 2013 05:48, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sun, 07 Jul 2013 05:17:01 +0100, Joshua Landau wrote: On 7 July 2013 04:56, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: ... def promote(x): if isinstance(x, str): raise TypeError return

Re: Numeric coercions

2013-07-06 Thread Joshua Landau
On 7 July 2013 06:14, Joshua Landau joshua.landau...@gmail.com wrote: On 7 July 2013 05:48, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Sun, 07 Jul 2013 05:17:01 +0100, Joshua Landau wrote: On 7 July 2013 04:56, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote

Re: How to make this faster

2013-07-05 Thread Joshua Landau
On 5 July 2013 17:25, MRAB pyt...@mrabarnett.plus.com wrote: For comparison, here's my solution: CODE Unfortunately, there are some sudokus that require guessing - your algorithm will not solve those. A combination algorithm would be best, AFAIK. - FWIW, this is my interpretation of the

Re: Important features for editors

2013-07-05 Thread Joshua Landau
On 6 July 2013 04:25, Roy Smith r...@panix.com wrote: In article mailman.4323.1373080433.3114.python-l...@python.org, Rustom Mody rustompm...@gmail.com wrote: I'm a vi user. Once I mastered hit ESC by reflex when you pause typing an insert I was never confused above which mode I was in.

Re: Default scope of variables

2013-07-04 Thread Joshua Landau
On 4 July 2013 17:54, Rotwang sg...@hotmail.co.uk wrote: 53*(63**100 - 1)//62 Or about 10**10**6.255 (so about 1.80M digits long). For the unicode side (Python 3, in other words) and reusing your math (ya better hope it's right!), you are talking: 97812*((97812+2020)**100 -

Re: Important features for editors

2013-07-04 Thread Joshua Landau
On 4 July 2013 08:32, cutems93 ms2...@cornell.edu wrote: I am researching on editors for my own reference. I found that each of them has some features that other don't, but I am not sure which features are significant/necessary for a GOOD editor. What features do you a good editor should

Re: Decorator help

2013-07-04 Thread Joshua Landau
On 4 July 2013 06:39, Peter Otten __pete...@web.de wrote: Joshua Landau wrote: On 3 July 2013 23:19, Joshua Landau joshua.landau...@gmail.com wrote: If you don't want to do that, you'd need to use introspection of a remarkably hacky sort. If you want that, well, it'll take a mo. After some

Re: First attempt at a Python prog (Chess)

2013-07-04 Thread Joshua Landau
Just a minor suggestion: def display_board(board): print ' a b c d e f g h' print '+---+---+---+---+---+---+---+---+' for row in range(8): for col in range(8): piece = board[row * 8 + col] if piece_type[piece] == WHITE: print '|

Re: python adds an extra half space when reading from a string or list

2013-07-04 Thread Joshua Landau
On 4 July 2013 12:19, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: Op 04-07-13 01:40, Joshua Landau schreef: Bear in mind that if the way you were acting was all in my with trepidation category, I would likely have not spoken up. I believe you crossed a lot further beyond that line. I

Re: Default scope of variables

2013-07-04 Thread Joshua Landau
On 5 July 2013 03:03, Dave Angel da...@davea.name wrote: On 07/04/2013 09:24 PM, Steven D'Aprano wrote: On Thu, 04 Jul 2013 17:54:20 +0100, Rotwang wrote: It's perhaps worth mentioning that some non-ascii characters are allowed in identifiers in Python 3, though I don't know which ones. PEP

Re: Default scope of variables

2013-07-04 Thread Joshua Landau
On 5 July 2013 03:03, Dave Angel da...@davea.name wrote: In particular, http://docs.python.org/3.3/reference/lexical_analysis.html#identifiers has a definition for id_continue that includes several interesting categories. I expected the non-ASCII digits, but there's other stuff there,

Re: how to calculate reputation

2013-07-03 Thread Joshua Landau
On 2 July 2013 23:19, Surya Kasturi sur...@ieee.org wrote: I think I didnt explain it clearly.. let me make it clear.. Yeah... I don't get it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorator help

2013-07-03 Thread Joshua Landau
On 3 July 2013 23:09, Joseph L. Casale jcas...@activenetwerx.com wrote: I have a set of methods which take args that I decorate twice, def wrapped(func): def wrap(*args, **kwargs): try: val = func(*args, **kwargs) # some work except BaseException

Re: Decorator help

2013-07-03 Thread Joshua Landau
On 3 July 2013 23:19, Joshua Landau joshua.landau...@gmail.com wrote: If you don't want to do that, you'd need to use introspection of a remarkably hacky sort. If you want that, well, it'll take a mo. After some effort I'm pretty confident that the hacky way is impossible. -- http

Re: python adds an extra half space when reading from a string or list

2013-07-03 Thread Joshua Landau
On 3 July 2013 02:21, ru...@yahoo.com wrote: On 07/02/2013 05:18 PM, Joshua Landau wrote: On 2 July 2013 23:34, Ben Finney ben+pyt...@benfinney.id.au wrote: [...] Needless to say, I disagree with your position. There is no place for baseless insults in this community; but when the behaviour

Re: python adds an extra half space when reading from a string or list

2013-07-03 Thread Joshua Landau
On 3 July 2013 11:01, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: Op 02-07-13 15:40, Joshua Landau schreef: On 2 July 2013 13:01, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: There is not ever a place on this list where you will need to call someone incompetent. You can explain

Re: Why this code works in python3, but not python 2:

2013-07-03 Thread Joshua Landau
On 4 July 2013 04:52, Maciej Dziardziel fied...@gmail.com wrote: Out of curiosity: Does anyone know why the code below is valid in python3, but not python2: def foo(*args, bar=1, **kwargs): pass Python 3 gained syntax for keyword-only arguments. Try foo(1) and it will fail -- bar needs

Re: Default scope of variables

2013-07-03 Thread Joshua Landau
On 4 July 2013 05:07, Chris Angelico ros...@gmail.com wrote: On Thu, Jul 4, 2013 at 1:27 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: With respect to the Huffman coding of declarations, Javascript gets it backwards. Locals ought to be more common, but they require more

Re: Default scope of variables

2013-07-03 Thread Joshua Landau
On 4 July 2013 05:36, Chris Angelico ros...@gmail.com wrote: On Thu, Jul 4, 2013 at 2:30 PM, Joshua Landau joshua.landau...@gmail.com wrote: That said, I'm not too convinced. Personally, the proper way to do what you are talking about is creating a new closure. Like: for i in range(100

Re: Why this code works in python3, but not python 2:

2013-07-03 Thread Joshua Landau
On 4 July 2013 05:47, alex23 wuwe...@gmail.com wrote: On 4/07/2013 2:12 PM, Joshua Landau wrote: On 4 July 2013 04:52, Maciej Dziardziel fied...@gmail.com wrote: def foo(*args, bar=1, **kwargs): pass Try foo(1) and it will fail -- bar needs to be given as a keyword. No it won't

Re: python adds an extra half space when reading from a string or list

2013-07-02 Thread Joshua Landau
On 2 July 2013 08:22, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: Op 01-07-13 21:28, Joshua Landau schreef: Well then you are wrong. But fine, I'll use your definition incorrect as it may be (when talking to you, please don't misrepresent my other posts). Nevertheless

Re: python adds an extra half space when reading from a string or list

2013-07-02 Thread Joshua Landau
On 2 July 2013 13:01, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: Op 02-07-13 11:34, Joshua Landau schreef: No it does not. I'd give you more of a counter but I actually have no idea how you came up with that. Please answer the following question. If someone behaved incompetently, how

Re: Python list code of conduct

2013-07-02 Thread Joshua Landau
On 2 July 2013 16:51, Steve Simmons square.st...@gmail.com wrote: Erm, It probably isn't the best time to start this post but I was wondering... Does this list have a code of conduct or a netiqeutte (sp?) statement/requirement? If not, should it? Is the membership of this list presently

Re: Parsing Text file

2013-07-02 Thread Joshua Landau
On 2 July 2013 20:50, Tobiah t...@tobiah.org wrote: How do we know whether we have Sometext? If it's really just a literal 'Sometext', then just print that when you hit maskit. Otherwise: for line in open('file.txt').readlines(): if is_sometext(line): memory =

Re: Parsing Text file

2013-07-02 Thread Joshua Landau
On 2 July 2013 21:28, sas4...@gmail.com wrote: Here I am looking for the line that contains: WORK_MODE_MASK, I want to print that line as well as the file name above it: config/meal/governor_mode_config.h or config/meal/components/source/ceal_PackD_kso_aic_core_config.h. SO the output

Re: how to calculate reputation

2013-07-02 Thread Joshua Landau
On 2 July 2013 22:43, Surya Kasturi sur...@ieee.org wrote: Hi all, this seems to be quite stupid question but I am confused.. We set the initial value to 0, +1 for up-vote and -1 for down-vote! nice. I have a list of bool values True, False (True for up vote, False for down-vote).. submitted

Re: python adds an extra half space when reading from a string or list

2013-07-02 Thread Joshua Landau
On 2 July 2013 23:34, Ben Finney ben+pyt...@benfinney.id.au wrote: Joshua Landau joshua.landau...@gmail.com writes: There is not ever a place on this list where you will need to call someone incompetent. So even if that term describes their behaviour and manner, you think no-one should ever

Re: HTML Parser

2013-07-02 Thread Joshua Landau
On 2 July 2013 18:43, subhabangal...@gmail.com wrote: I could not use BeautifulSoup as I did not find an .exe file. Were you perhaps looking for a .exe file to install BeautifulSoup? It's quite plausible that a windows user like you might be dazzled at the idea of a .tar.gz. I suggest just

Re: python adds an extra half space when reading from a string or list

2013-07-02 Thread Joshua Landau
On 3 July 2013 01:36, Ben Finney ben+pyt...@benfinney.id.au wrote: I think we've found the root of the disagreement. I've made my position clear and will let it rest there. Seconded. Thanks for caring enough about this community to act in the interest of keeping it open, considerate, and

Re: Bug reports [was Re: Python list code of conduct]

2013-07-02 Thread Joshua Landau
On 3 July 2013 01:52, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: If you are a beginner to a programming language, assume that anything that doesn't work the way you expect is a bug in YOUR code, or YOUR understanding, not in the language. Not just beginners. Out of the

Re: indexerror: list index out of range??

2013-07-01 Thread Joshua Landau
On 29 June 2013 15:30, Mark Lawrence breamore...@yahoo.co.uk wrote: On 29/06/2013 14:44, Dave Angel wrote: Since you're using the arrogant and buggy GoogleGroups, this http://wiki.python.org/moin/GoogleGroupsPython. Please don't make comments like this, you'll upset the Python Mailing List

Re: Stupid ways to spell simple code

2013-07-01 Thread Joshua Landau
On 1 July 2013 14:14, Chris Angelico ros...@gmail.com wrote: On Mon, Jul 1, 2013 at 10:59 PM, Neil Cerutti ne...@norwich.edu wrote: On 2013-06-30, Chris Angelico ros...@gmail.com wrote: So, here's a challenge: Come up with something really simple, and write an insanely complicated - yet

Re: python adds an extra half space when reading from a string or list

2013-07-01 Thread Joshua Landau
to be insulting) Nikos Antoon Pardon And here are the people who have reminded them to stop: Steve Simmons Steven D'Aprano Andrew Berg Walter Hurry rusi Joshua Landau (me) So yes, Antoon Pardon and Nikos, please stop. You are not representing the list. I haven't followed any of the other arguments

Re: python adds an extra half space when reading from a string or list

2013-07-01 Thread Joshua Landau
On 1 July 2013 18:15, Νίκος ni...@superhost.gr wrote: Στις 1/7/2013 7:56 μμ, ο/η Joshua Landau έγραψε: So yes, Antoon Pardon and Nikos, please stop. You are not representing the list. I haven't followed any of the other arguments, true, but you two in particular are causing a lot of trouble

Re: python adds an extra half space when reading from a string or list

2013-07-01 Thread Joshua Landau
On 1 July 2013 19:29, rusi rustompm...@gmail.com wrote: On Monday, July 1, 2013 10:26:21 PM UTC+5:30, Joshua Landau wrote: So yes, Antoon Pardon and Nikos, please stop. You are not representing the list. This 'and' is type-wrong. I don't follow. I haven't followed any of the other

Re: python adds an extra half space when reading from a string or list

2013-07-01 Thread Joshua Landau
On 1 July 2013 20:12, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: Op 01-07-13 18:56, Joshua Landau schreef: To put things in perspective, these are the people who have been insulting on this post: Mark Lawrence (once, probably without meaning to be insulting) Nikos Antoon Pardon

Re: python adds an extra half space when reading from a string or list

2013-07-01 Thread Joshua Landau
On 1 July 2013 20:18, Antoon Pardon antoon.par...@rece.vub.ac.be wrote: Op 01-07-13 17:33, Steven D'Aprano schreef: On Mon, 01 Jul 2013 15:08:18 +0200, Antoon Pardon wrote: Op 01-07-13 14:43, Steven D'Aprano schreef: Νίκος, I am not going to wade through this long, long thread to see what

Re: python adds an extra half space when reading froma string or list -- back to the question

2013-07-01 Thread Joshua Landau
On 1 July 2013 20:32, Joel Goldstick joel.goldst...@gmail.com wrote: I copied the original question so that the rant on the other thread can continue. Let's keep this thread ontopic Thank you. I shall do the same below. Unfortunately I don't have high hopes that any progress will be made on

Re: python adds an extra half space when reading from a string or list

2013-07-01 Thread Joshua Landau
On 2 July 2013 05:34, rusi rustompm...@gmail.com wrote: On Monday, July 1, 2013 8:36:53 PM UTC+5:30, Neil Cerutti wrote: On 2013-07-01, rusi wrote: 1. Kill-filing/spam-filtering are tools for spam. Nikos is certainly not spamming in the sense of automated sending out of cooked mail to

Re: Stupid ways to spell simple code

2013-06-30 Thread Joshua Landau
On 30 June 2013 07:06, Chris Angelico ros...@gmail.com wrote: There's a bit of a discussion on python-ideas that includes a function that raises StopIteration. It inspired me to do something stupid, just to see how easily I could do it... On Sun, Jun 30, 2013 at 3:45 PM, Nick Coghlan

Re: Stupid ways to spell simple code

2013-06-30 Thread Joshua Landau
On 30 June 2013 15:58, Rick Johnson rantingrickjohn...@gmail.com wrote: Chris, i'm sorry, but your challenge is decades too late. If you seek amusement you need look no further than the Python stdlib. If you REALLY want to be amused, peruse the idlelib -- not only is the code obfuscated, it

Re: Stupid ways to spell simple code

2013-06-30 Thread Joshua Landau
On 30 June 2013 18:36, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Pfft! Where's the challenge in that? Let's use an O(n!) algorithm for sorting -- yes, n factorial -- AND abuse a generator expression for its side effect. As a bonus, we use itertools, and just for the lulz, I

Re: python adds an extra half space when reading from a string or list

2013-06-30 Thread Joshua Landau
On 30 June 2013 20:58, Robert Kern robert.k...@gmail.com wrote: On 2013-06-30 18:24, Νίκος wrote: Στις 29/6/2013 8:00 μμ, ο/η Mark Lawrence έγραψε: Why this when the approach to Nick the Incompetant Greek has been to roll out the red carpet? Your mother is incompetent who raised a brat

Re: python adds an extra half space when reading from a string or list

2013-06-29 Thread Joshua Landau
On 29 June 2013 03:07, charles benoit feather.duster.kung...@gmail.com wrote: STUFF 1) You haven't asked a question. 2) You posted your code twice. That makes it look a lot harder and longer than it really is. 3) Give us a *minimal* reproducible test case. I currently just get: %~ python2

Re: Closures in leu of pointers?

2013-06-29 Thread Joshua Landau
On 29 June 2013 20:42, Tim Chase t...@thechases.com wrote: On 2013-06-29 19:19, Steven D'Aprano wrote: Nobody ever asks why Python doesn't let you sort an int, or take the square of a list... just to be ornery, you can sort an int: i = 314159265 ''.join(sorted(str(i))) '112345569' To be

Re: python adds an extra half space when reading from a string or list

2013-06-29 Thread Joshua Landau
On 29 June 2013 18:00, Mark Lawrence breamore...@yahoo.co.uk wrote: On 29/06/2013 17:05, Joshua Landau wrote: asks for clarification Why this when the approach to Nick the Incompetant Greek has been to roll out the red carpet? I am my own person, and should not be judged by the actions

Rough sketch of a PEP for issue2292

2013-06-29 Thread Joshua Landau
liable to change. PEP: XXX Title: Additional Unpacking Generalizations Version: $Revision$ Last-Modified: $Date$ Author: Joshua Landau jos...@landau.ws Discussions-To: python-id...@python.org Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 29-Jun-2013 Python-Version: 3.4 Post

Re: ? get negative from prod(x) when x is positive integers

2013-06-28 Thread Joshua Landau
On 28 June 2013 15:38, Vincent Davis vinc...@vincentdavis.net wrote: I have a list of a list of integers. The lists are long so i cant really show an actual example of on of the lists, but I know that they contain only the integers 1,2,3,4. so for example. s2 =

Re: FACTS: WHY THE PYTHON LANGUAGE FAILS.

2013-06-28 Thread Joshua Landau
On 28 June 2013 19:52, Wayne Werner wa...@waynewerner.com wrote: On Fri, 28 Jun 2013, 8 Dihedral wrote: KIND OF BORING TO SHOW HOW THE LISP PROGRAMMING WAS ASSIMULATED BY THE PYTHON COMMUNITY. OF COURSE PYTHON IS A GOOD LANGUAGE FOR DEVELOPING ARTIFICIAL INTELEGENT ROBOT PROGRAMS NOT SO

Re: FACTS: WHY THE PYTHON LANGUAGE FAILS.

2013-06-28 Thread Joshua Landau
On 28 June 2013 20:35, Joel Goldstick joel.goldst...@gmail.com wrote: On Fri, Jun 28, 2013 at 3:22 PM, Joshua Landau joshua.landau...@gmail.com wrote: On 28 June 2013 19:52, Wayne Werner wa...@waynewerner.com wrote: On Fri, 28 Jun 2013, 8 Dihedral wrote: KIND OF BORING TO SHOW HOW

Re: Limit Lines of Output

2013-06-27 Thread Joshua Landau
On 27 June 2013 00:57, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Wed, 26 Jun 2013 10:09:13 -0700, rusi wrote: On Wednesday, June 26, 2013 8:54:56 PM UTC+5:30, Joshua Landau wrote: On 25 June 2013 22:48, Gene Heskett wrote: On Tuesday 25 June 2013 17:47:22 Joshua Landau

Re: Why is the argparse module so inflexible?

2013-06-27 Thread Joshua Landau
On 27 June 2013 13:54, Andrew Berg robotsondr...@gmail.com wrote: I've begun writing a program with an interactive prompt, and it needs to parse input from the user. I thought the argparse module would be great for this, but unfortunately it insists on calling sys.exit() at any sign of

Re: class factory question

2013-06-27 Thread Joshua Landau
On 26 June 2013 14:09, Tim jtim.arn...@gmail.com wrote: I am extending a parser and need to create many classes that are all subclassed from the same object (defined in an external library). When my module is loaded I need all the classes to be created with a particular name but the

<    1   2   3   4   5   >