Re: compile error building building Python-3.8.5 on Debian 8.11 (yes, old!)

2020-09-04 Thread Joshua J. Kugler
t what is in that old of a version of Debian. I don't see anything that calls out the C version required in the Python docs, but I doubt they have Debian 8 in their build farm any more. j -- Joshua J. Kugler - Fairbanks, Alaska - jos...@azariah.com Azariah Enterprises - Programming and

Can't use interpreter

2020-08-29 Thread Joshua Sharma
I have downloaded python 3.7.6, but I can't seem to use it in PyCharm. I have subscribed. -- https://mail.python.org/mailman/listinfo/python-list

Having trouble with Mock and exception side effects

2020-08-21 Thread Joshua J. Kugler
do neither when it has been replaced by a MagicMock object. Thanks for any tips, pointers, or "You're doing it wrong!" education. :) j -- Joshua J. Kugler - Fairbanks, Alaska - jos...@azariah.com Azariah Enterprises - Programming and Website Design PGP Key: http://pgp.mit.edu/ ID 0x68108cbb73b13b6a -- https://mail.python.org/mailman/listinfo/python-list

How to debug asyncio.exceptions.CancelledError?

2019-10-24 Thread Joshua Gardner
I'm using a library for Django Channels that I've somehow misconfigured and is causing asyncio.exceptions.CancelledError when trying to connect a websocket. Because of how the stack isn't particularly straightforward with asyncio I'm at a loss to debug this. Any tips to find out what's going on?

issue

2019-07-10 Thread joshua kay
i was made aware by the python installer about the support team, please tell me a solution for my issue thank you, Joshua kay -- https://mail.python.org/mailman/listinfo/python-list

Python 32 bit error

2015-10-26 Thread Joshua Star
m, some of the buttons are invisible. >From Joshua.-- https://mail.python.org/mailman/listinfo/python-list

Script To Remove Files Made Either By Python Or Git

2015-10-09 Thread Joshua Stokes
Hi Is there an available script to remove file created by either using the Python module or by using git? Thanks >From Joshua P Stokes -- https://mail.python.org/mailman/listinfo/python-list

Re: Symbolic Links

2015-08-12 Thread Joshua Stokes
Never Mind Thanks >From Joshua P Stokes > On 12 Aug 2015, at 9:25 PM, Joshua Stokes > wrote: > > Hi > > I need help deleting broken symbolic links made by Python and/or Python > modules > > Thanks > > From Joshua P Stokes -- https://mail.python.org/mailman/listinfo/python-list

Symbolic Links

2015-08-12 Thread Joshua Stokes
Hi I need help deleting broken symbolic links made by Python and/or Python modules Thanks >From Joshua P Stokes -- https://mail.python.org/mailman/listinfo/python-list

Re: Trees

2015-01-20 Thread Joshua Landau
On 20 January 2015 at 04:21, Dan Stromberg wrote: > On Mon, Jan 19, 2015 at 6:46 PM, Mark Lawrence > wrote: >> >> I don't know if you've seen this http://kmike.ru/python-data-structures/ but >> maybe of interest. > > I've seen it. It's a nice page. > > I attempted to get my treap port in there s

Re: jitpy - Library to embed PyPy into CPython

2014-12-09 Thread Joshua Landau
To: python-list On 7 December 2014 at 14:31, Albert-Jan Roskam wrote: > On Sun, Dec 7, 2014 11:06 AM CET Stefan Behnel wrote: >> >>I think this is trying to position PyPy more in the same corner as other >>JIT compilers for CPython, as opposed to keeping it a completely separate >>thing which su

Re: jitpy - Library to embed PyPy into CPython

2014-12-08 Thread Joshua Landau
On 7 December 2014 at 14:31, Albert-Jan Roskam wrote: > On Sun, Dec 7, 2014 11:06 AM CET Stefan Behnel wrote: >> >>I think this is trying to position PyPy more in the same corner as other >>JIT compilers for CPython, as opposed to keeping it a completely separate >>thing which suffers from being "

Re: Python, C++ interaction

2014-12-03 Thread Joshua Landau
On 3 December 2014 at 08:29, Michael Kreim wrote: > > What are you using to wrap C++ classes for Python? > Can you recommend swig? Should I give it another try? > Did I misunderstood ctypes? The PyPy guys would love it if you used CFFI. Cython is also a wonderful approach. There's a lot of suppor

Re: Python handles globals badly.

2014-12-03 Thread Joshua Landau
On 3 December 2014 at 04:32, Skybuck Flying wrote: > > I am still new at python and definetly don't feel comfortable with the > object feature, though I did use it for these variables which are actually > objects. If you are being serious, please take into consideration that there is no way you a

Re: What for -- for? (was A bug?)

2014-10-30 Thread Joshua Landau
On 29 October 2014 03:22, Rustom Mody wrote: > Yesterday I was trying to introduce python to some senior computer scientists. > > Tried showing a comprehension-based dir-walker vs a for-loop based one: > > def dw(p): >if isfile(p): > return [p] >else: > return [p] + [c for f in

Re: A bug?

2014-10-27 Thread Joshua Landau
On 28 October 2014 00:36, Denis McMahon wrote: > > d = [[list(range(1,13))[i*3+j] for j in range(3)] for i in range(4)] A quick note. Ranges (even 2.7's xrange) are all indexable. The cast to a list isn't needed. -- https://mail.python.org/mailman/listinfo/python-list

Re: (test) ? a:b

2014-10-26 Thread Joshua Landau
On 27 October 2014 02:28, Ben Finney wrote: > Joshua Landau writes: > >> Guido van Rossum answered Jul 28 '11 at 21:20, >> http://stackoverflow.com/questions/3174392/is-it-pythonic-to-use-bools-as-ints >> > False==0 and True==1, and there's nothing wrong wi

Re: (test) ? a:b

2014-10-26 Thread Joshua Landau
On 26 October 2014 01:03, Ben Finney wrote: > Steven D'Aprano writes: > >> I suspect that Guido and the core developers disagree with you, since >> they had the opportunity to fix that in Python 3 and didn't. > > That doesn't follow; there are numerous warts in Python 2 that were not > fixed in P

Re: id == vs is

2014-10-26 Thread Joshua Landau
On 27 October 2014 00:12, Dan Stromberg wrote: > Are the following two expressions the same? > > x is y > > Id(x) == id(y) Much of the time, but not all the time. The obvious exception is if "id" is redefined, but that one's kind of boring. The real thing to watch out for is if the object that "x

Re: Perl Template Toolkit: Now in spicy new Python flavor

2014-10-07 Thread joshua . higgins . pcv
Sorry, is anyone else having trouble opening the README.txt? On Monday, January 14, 2008 6:00:52 PM UTC-5, eef...@gmail.com wrote: > I'd like to inform the Python community that the powerful and popular > Template Toolkit system, previously available only in its original > Perl implementation, is

Re: How do I check if a string is a prefix of any possible other string that matches a given regex.

2014-10-07 Thread Joshua Landau
On 7 October 2014 17:15, wrote: > Probably I'm turning the use of regular expressions upside down with this > question. I don't want to write a regex that matches prefixes of other > strings, I know how to do that. I want to generate a regex -- given another > regex --, that matches all possib

Re: "We made from water every living thing"...

2014-09-08 Thread Joshua Landau
On 8 September 2014 12:54, David H. Lipman wrote: > From: "Ned Batchelder" >> On 9/7/14 5:41 PM, Tony the Tiger wrote: >> >>> Now, kindly get the fuck outta here, you fucking retard! >>> >> That was unnecessary, ineffective, and totally outside the bounds of this >> community's norms: http://www.

Re: How to turn a string into a list of integers?

2014-09-04 Thread Joshua Landau
On 3 September 2014 15:48, wrote: > Peter Otten <__pete...@web.de> wrote: >> >>> [ord(c) for c in "This is a string"] >> [84, 104, 105, 115, 32, 105, 115, 32, 97, 32, 115, 116, 114, 105, 110, 103] >> >> There are other ways, but you have to describe the use case and your Python >> version for us

Re: Working with decimals

2014-08-24 Thread Joshua Landau
On 24 August 2014 20:40, Ian Kelly wrote: > That's the same check I posted, just using the in operator instead of a > straight lookup and raising an error. I think I need to take a break from the internet. This is the second time in as many threads that I've responded with what I'm commenting on.

Re: Working with decimals

2014-08-24 Thread Joshua Landau
On 24 August 2014 20:25, Joshua Landau wrote: > On 24 August 2014 20:19, Ian Kelly wrote: >> On Sun, Aug 24, 2014 at 1:17 PM, Ian Kelly wrote: >>> On Sun, Aug 24, 2014 at 1:12 PM, Joshua Landau wrote: >>> > Is math not already imported by start-up? > > I

Re: Working with decimals

2014-08-24 Thread Joshua Landau
On 24 August 2014 20:19, Ian Kelly wrote: > On Sun, Aug 24, 2014 at 1:17 PM, Ian Kelly wrote: >> >> On Sun, Aug 24, 2014 at 1:12 PM, Joshua Landau wrote: >> > Is math not already imported by start-up? >> >> Why would it be? > > It's easy to check,

Re: Global indent

2014-08-24 Thread Joshua Landau
On 23 August 2014 22:55, Rustom Mody wrote: > On Sunday, August 24, 2014 2:27:56 AM UTC+5:30, Joshua Landau wrote: > >> Ay, so is any editor with an API. I use Sublime mostly because it's >> pretty, fast and has a Python-based API. The only actual feature it >>

Re: Working with decimals

2014-08-24 Thread Joshua Landau
On 23 August 2014 23:53, Chris Angelico wrote: > On Sun, Aug 24, 2014 at 8:47 AM, Joshua Landau wrote: >> On 23 August 2014 23:31, Chris Angelico wrote: >>> I'd say "never" is too strong (there are times when it's right to put >>> an import insi

Re: Working with decimals

2014-08-23 Thread Joshua Landau
On 23 August 2014 23:31, Chris Angelico wrote: > On Sun, Aug 24, 2014 at 7:47 AM, Joshua Landau wrote: >> So for one "import math" should never go inside a function; you should >> hoist it to the top of the file with all the other imports. > > I'd say "n

Re: Working with decimals

2014-08-23 Thread Joshua Landau
On 23 August 2014 22:13, Seymore4Head wrote: > def make_it_money(number): > import math > return ' > + str(format(math.floor(number * 100) / 100, ',.2f')) So for one "import math" should never go inside a function; you should hoist it to the top of the file with all the other imports. Yo

Re: Working with decimals

2014-08-23 Thread Joshua Landau
On 23 August 2014 18:47, Seymore4Head wrote: > Anyone care to suggest what method to use to fix the decimal format? It sounds like you want a primer on floating point. The documentation of the decimal module is actually a good read, although I don't doubt there are even better resources somewhere

Re: Global indent

2014-08-23 Thread Joshua Landau
On 23 August 2014 17:17, Christian Gollwitzer wrote: > Am 23.08.14 16:19, schrieb Joshua Landau: >> >> On 23 August 2014 10:41, Christian Gollwitzer wrote: >>> >>> Sometimes I impress my colleagues with what they call "magic", i.e. >>> cre

Re: Global indent

2014-08-23 Thread Joshua Landau
(Since this is already an editor war...) On 23 August 2014 10:41, Christian Gollwitzer wrote: > Sometimes I impress my colleagues with what they call "magic", i.e. creating > special repeated lists of numbers by a few keystrokes in gvim, and that has > triggered the request from them to learn a b

Re: Python 3 is killing Python

2014-07-15 Thread Joshua Landau
On 15 July 2014 23:40, Abhiram R wrote: > On Wed, Jul 16, 2014 at 4:00 AM, Kevin Walzer wrote: >> >> ...but Unix/newsgroup ettiquette says that it's gauche to [top post], >> because it presents an unacceptable cognitive burden to the user trying to >> catch the context of the thread by forcing t

Re: OT: This Swift thing

2014-06-14 Thread Joshua Landau
On 12 June 2014 03:08, Steven D'Aprano wrote: > We know *much more* about generating energy from E = mc^2 than we know > about optimally flipping bits: our nuclear reactions convert something of > the order of 0.1% of their fuel to energy, that is, to get a certain > yield, we "merely" have to sup

Re: try/except/finally

2014-06-08 Thread Joshua Landau
On 6 June 2014 18:39, Roy Smith wrote: > > The only way I can think of to bypass a finally block would be to call > os._exit(), or send yourself a kill signal. If you're willing to use implementation details... --- # BreakN.py import sys # Turn tracing on if it is off if sys.gettrace() is Non

Re: try/except/finally

2014-06-08 Thread Joshua Landau
On 8 June 2014 08:12, Marko Rauhamaa wrote: > > Does anyone have an example motivating a return from finally? It seems > to me it would always be a bad idea as it silently clears all unexpected > exceptions. In a general sense: try: something_that_can_break() return foo() # b

Re: Unicode and Python - how often do you index strings?

2014-06-05 Thread Joshua Landau
On 4 June 2014 15:50, Michael Torrie wrote: > On 06/04/2014 12:50 AM, wxjmfa...@gmail.com wrote: >> [Things] > > [Reply to things] Please. Just don't. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python Internet Database

2014-05-19 Thread Joshua Landau
On 9 May 2014 22:06, Chris Angelico wrote: > On Sat, May 10, 2014 at 6:45 AM, wrote: >> 2 - Jit compiler for using from a web server. I mean, one has a web server >> running under Apache in a hosting service like Hostgator, Daddy Host or >> another inexpensive service. I decide to run a few ap

Joining centos 6.5 member Domain Controller to an existing Windows Domain

2014-05-05 Thread Joshua Knights
Here is my Issue and I think it may be a python path bug? This is my Error: /root/samba-master/bin/samba-tool domain join AAF.ECPI DC -Uadministrator --realm=AAF.ECPI I get the following Error: Traceback (most recent call last): File "/root/samba-master/bin/samba-tool", line 33, in from samba.ne

Inconsistent viewkeys behaviour

2014-04-27 Thread Joshua Landau
Is there any reference for this strange behaviour on Python 2: >>> set() < dict().viewkeys() Traceback (most recent call last): File "", line 1, in TypeError: can only compare to a set >>> dict().viewkeys() > set() False ? -- https://mail.python.org/mailman/listinfo/py

Re: symple programming task

2014-04-21 Thread Joshua Landau
On 20 April 2014 20:27, Ivan Ivanivich wrote: > thanks, i found the bag G'day. This [https://xkcd.com/979/] applies to threads ending in "nvm, solved it" too. I know the problem in your case isn't likely to be widely useful, but there are other benefits of pointing out what you've done. For exam

Re: Martijn Faassen: The Call of Python 2.8

2014-04-15 Thread Joshua Landau
On 16 April 2014 01:42, Devin Jeanpierre wrote: > Yes. Software included in Arch, and programs installed via distutils, > will both work correctly under Arch. [...] > > I don't like how Arch > created a situation where it was impossible to support Arch and Debian > at the same time with standalone

Re: Martijn Faassen: The Call of Python 2.8

2014-04-15 Thread Joshua Landau
On 15 April 2014 23:18, Ned Batchelder wrote: > On 4/15/14 5:34 PM, Joshua Landau wrote: >> Arch is on 3.4 *default*. >> >> $> python >> Python 3.4.0 (default, Mar 17 2014, 23:20:09) >> [...] >> > Yeah, that's the wrong way to d

Re: Martijn Faassen: The Call of Python 2.8

2014-04-15 Thread Joshua Landau
On 15 April 2014 06:03, Marko Rauhamaa wrote: > Terry Reedy : > >> Any decent system should have 3.4 available now. > > Really, now? Which system is that? Arch is on 3.4 *default*. $> python Python 3.4.0 (default, Mar 17 2014, 23:20:09) [...] -- https://mail.python.org/mailman/listi

Re: python obfuscate

2014-04-11 Thread Joshua Landau
On 11 April 2014 10:17, Sturla Molden wrote: > Joshua Landau wrote: > >> However, if this really is your major blocker to using Python, I >> suggest compiling with Cython. > > Cython restains all the code as text, e.g. to readable generate exceptions. > Users can als

Re: python obfuscate

2014-04-10 Thread Joshua Landau
On 11 April 2014 02:29, Wesley wrote: > Does python has any good obfuscate? Most other people on the list will point out why such a thing is mostly pointless and you don't really need it. However, if this really is your major blocker to using Python, I suggest compiling with Cython. There are

Re: Balanced trees

2014-03-18 Thread Joshua Landau
On 18 March 2014 01:01, Daniel Stutzbach wrote: > I would love to have include macro-benchmarks. I keep waiting for the PyPy > benchmark suite to get ported to Python 3... *grins* >> "Delete a slice" is fudged from its inclusion of multiplication, which >> is far faster on blists. I admit that

Re: Balanced trees

2014-03-17 Thread Joshua Landau
On 17 March 2014 21:16, Daniel Stutzbach wrote: > On Fri, Mar 14, 2014 at 6:13 PM, Joshua Landau wrote: >> >> Now, I understand there are downsides to blist. Particularly, I've >> looked through the "benchmarks" and they seem untruthful. > > I worke

Re: Balanced trees

2014-03-14 Thread Joshua Landau
On 8 March 2014 20:37, Mark Lawrence wrote: > I've found this link useful http://kmike.ru/python-data-structures/ > > I also don't want all sorts of data structures added to the Python library. > I believe that there are advantages to leaving specialist data structures on > pypi or other sites, pl

Re: Tuples and immutability

2014-03-09 Thread Joshua Landau
On 9 March 2014 18:13, Chris Angelico wrote: > I think I see what you're saying here. But ignore "top-level"; this > should just be a part of the exception message, no matter what. I don't think I was clear, but yes. That. > What you're saying is that this should notice that it's doing an > augm

Re: Tuples and immutability

2014-03-09 Thread Joshua Landau
On 28 February 2014 14:43, Chris Angelico wrote: > On Sat, Mar 1, 2014 at 1:41 AM, Joshua Landau wrote: >> Would it be better to add a check here, such that if this gets raised >> to the top-level it includes a warning ("Addition was inplace; >> variable probably

Re: Tuples and immutability

2014-02-28 Thread Joshua Landau
On 27 February 2014 16:14, Chris Angelico wrote: > On Fri, Feb 28, 2014 at 3:01 AM, Eric Jacoboni > wrote: >> > a_tuple = ("spam", [10, 30], "eggs") > a_tuple[1] += [20] >> Traceback (most recent call last): >> File "", line 1, in >> TypeError: 'tuple' object does not support item ass

Re: Explanation of list reference

2014-02-15 Thread Joshua Landau
On 15 February 2014 14:20, Ben Finney wrote: > Joshua Landau writes: > >> Here, I give you a pdf. Hopefully this isn't anti >> mailing-list-etiquette. > > This forum is read in many different contexts, and attachments aren't > appropriate. You should s

Re: Calculator Problem

2014-02-05 Thread Joshua Landau
On 5 February 2014 02:22, Dan Sommers wrote: > On Tue, 04 Feb 2014 19:53:52 -0500, Roy Smith wrote: > > > In article , > > David Hutto wrote: > > > >> Can anyone point out how using an int as a var is possible > > > > one = 42 > > > > (ducking and running) > > int = 42 > > (ducking lower and ru

Re: 1 > 0 == True -> False

2014-01-30 Thread Joshua Landau
On 31 January 2014 00:10, Rotwang wrote: > > On a vaguely-related note, does anyone know why iterable unpacking in calls > was removed in Python 3? I mean things like > > def f(x, (y, z)): > return (x, y), z > > I don't have a use case in mind, I was just wondering. http://www.python.org/dev/

Re: 1 > 0 == True -> False

2014-01-30 Thread Joshua Landau
On 30 January 2014 20:38, Chris Angelico wrote: > > Why is tuple unpacking limited to the last argument? Is it just for > the parallel with the function definition, where anything following it > is keyword-only? You're not the first person to ask that: http://www.python.org/dev/peps/pep-0448/ If

Re: Need help vectorizing code

2014-01-18 Thread Joshua Landau
On 18 January 2014 20:51, Kevin K wrote: > def foo(X, y, mylambda, N, D, epsilon): > ... > for j in xrange(D): > aj = 0 > cj = 0 > for i in xrange(N): > aj += 2 * (X[i,j] ** 2) > cj += 2 * (X[i,j] * (y[i] - w.transpose()*X

Re: Is it possible to protect python source code by compiling it to .pyc or .pyo?

2014-01-17 Thread Joshua Landau
On 17 January 2014 00:58, Sam wrote: > I would like to protect my python source code. It need not be foolproof as > long as it adds inconvenience to pirates. > > Is it possible to protect python source code by compiling it to .pyc or .pyo? > Does .pyo offer better protection? If you're worried

Re: Please stop the trolling

2013-12-26 Thread Joshua Landau
On 23 December 2013 20:53, Terry Reedy wrote: > On 12/23/2013 2:05 PM, wxjmfa...@gmail.com wrote: > >> Le lundi 23 décembre 2013 18:59:41 UTC+1, Wolfgang Keller a écrit : >>> >>> [me] I'll note that Python core developers do care about memory leaks. >>> >>> And that's a really good thing

Re: Is It Bug?

2013-12-07 Thread Joshua Gardner
If I'm having to deal with incessant backslashes in a string I'll often use the r'\' (raw string literal) syntax. Simplifies things quite a bit. -- https://mail.python.org/mailman/listinfo/python-list

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

2013-11-11 Thread Joshua Landau
On 11 November 2013 22:21, Chris Angelico wrote: > On Tue, Nov 12, 2013 at 7:50 AM, Joshua Landau wrote: >> The obvious way to me is a binary search: > > Which makes an O(log n) search where I have an O(1) lookup. The > startup cost of denormalization doesn't scale, so

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

2013-11-11 Thread Joshua Landau
On 11 November 2013 10:39, Chris Angelico wrote: > On Mon, Nov 11, 2013 at 9:09 PM, wrote: >> Regarding the "select" statement, I think the most "Pythonic" approach is >> using dictionaries rather than nested ifs. >> Supposing we want to decode abbreviated day names ("mon") to full names >> ("

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

2013-11-09 Thread Joshua Landau
On 9 November 2013 13:08, John von Horn wrote: > I'm Mr. Noobie here, I've just started easing into Python (2.7.4) and am > enjoying working along to some youtube tutorials. I've done a little > programming in the past. > > I've just got a few thoughts I'd like to share and ask about: > > * Why no

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

2013-11-03 Thread Joshua Landau
On 3 November 2013 15:34, Joshua Landau wrote: >I can genuinely compress > the whole structure by N log2 Y items. By which I mean 2N items. -- https://mail.python.org/mailman/listinfo/python-list

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

2013-11-03 Thread Joshua Landau
On 3 November 2013 03:17, Steven D'Aprano wrote: > On Sat, 02 Nov 2013 14:31:09 -0700, Tim Roberts wrote: > >> jonas.thornv...@gmail.com wrote: >>> >>>Well then i have news for you. >> >> Well, then, why don't you share it? >> >> Let me try to get you to understand WHY what you say is impossible.

Re: Possibly better loop construct, also labels+goto important and on the fly compiler idea.

2013-11-02 Thread Joshua Landau
On 1 November 2013 05:41, Steven D'Aprano wrote: > On Thu, 31 Oct 2013 21:41:32 -0700, rurpy wrote: > >> On 10/31/2013 02:41 AM, Steven D'Aprano wrote: >>> On Wed, 30 Oct 2013 19:48:55 -0700, rurpy wrote: On 10/30/2013 04:22 AM, Steven D'Aprano wrote: > Skybuck's experience at programming

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

2013-10-30 Thread Joshua Landau
On 30 October 2013 19:18, Mark Lawrence wrote: > On 30/10/2013 19:01, jonas.thornv...@gmail.com wrote: >> >> And your still a stupid monkey i dare you to go test your IQ. > > It's you're as in you are and not your as in belongs to me. > > I have no intention of getting my IQ tested, but I do know

Re: Obfuscated factorial

2013-10-26 Thread Joshua Landau
On 26 October 2013 12:55, Steven D'Aprano wrote: > Just for fun: ... > for i in range(16): > print(i, FactorialBuilder(i).build().calculate()) Python already supports the factorial operator, -ⵘ. You just have to import it. # Import statement ⵘ = type("",(),{"__rsub__":lambda s,n:(lambda f,n:

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-17 Thread Joshua Landau
On 17 October 2013 22:14, Joshua Landau wrote: > It's not our job to do anything. We can't "clean" the internet, so > there's no point trying. Personally I think the common digressions > into attacks on intellect and professionalism are much more socially >

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-17 Thread Joshua Landau
On 17 October 2013 04:13, Owen Jacobson wrote: > Last week, Elad Maidar wrote a fairly short but readable opinion piece[0] > illustrating some long-standing social problems in the Ruby community, > ending with a very specific call to action around naming conventions for > Ruby projects and gems. T

Re: basic maze problem with turtle

2013-10-14 Thread Joshua Landau
On 13 October 2013 23:18, wrote: > import turtle > userTurtle = turtle.Turtle() > draw = turtle.Turtle() > scr = turtle.Screen() > > def drawMaze(): > draw.pencolor("gold") [lots of lines] > print(userTurtle.pos()) > > scr.onkeypress(m1, "Up") > scr.onkeypress(m2, "Left") > scr.onkeypress

Re: datetime.timedelta.replace?

2013-10-11 Thread Joshua Landau
On 9 October 2013 16:15, Skip Montanaro wrote: > Datetime objects have a replace method, but timedelta objects don't. > If I take the diff of two datetimes and want to zero out the > microseconds field, is there some way to do it more cleanly than this? > > delta = dt1 - dt2 > zero_delta = datetim

Re: I am never going to complain about Python again

2013-10-11 Thread Joshua Landau
On 11 October 2013 10:11, Steven D'Aprano wrote: > On Fri, 11 Oct 2013 09:17:37 +0100, Joshua Landau wrote: > >> On 11 October 2013 03:08, Steven D'Aprano >> wrote: >>> >>> Given: >>> >>> x ∈ ℝ, x = 2 (reals) >>> y ∈ ℕ, y

Re: I am never going to complain about Python again

2013-10-11 Thread Joshua Landau
On 11 October 2013 03:08, Steven D'Aprano wrote: > Your mistake here seems to be that you're assuming that if two numbers > are equal, they must be in the same domain, but that's not the case. > (Perhaps you think that 0.0 == 0+0j should return False?) It's certainly > not the case when it comes t

Re: iterating over a file with two pointers

2013-09-19 Thread Joshua Landau
Although "tee" is most certainly preferable because IO is far slower than the small amounts of memory "tee" will use, you do have this option: def iterate_file_lines(file): """ Iterate over lines in a file, unlike normal iteration this allows seeking. """

Re: Having both if() and for() statements in one liner

2013-09-17 Thread Joshua Landau
On 18 September 2013 03:10, Steven D'Aprano wrote: > On Tue, 17 Sep 2013 18:54:51 +, Dave Angel wrote: > >> for times in range(0, 5 if person=="George" else 0): > > > Oh that is evil. Truly evil. > > Thank you, I will treasure that piece of code forever. range(person == "simon" and 5) -- htt

Re: better and user friendly IDE recommended?

2013-09-15 Thread Joshua Landau
On 12 September 2013 16:47, Paul Rudin wrote: > Joshua Landau writes: > >> If the time learning a set of tools is enough to make the choice >> between tools, I suggest avoiding, say, Vim. > > That's a big if. > > If you expect to spend a lot of time editing t

Re: better and user friendly IDE recommended?

2013-09-12 Thread Joshua Landau
On 12 September 2013 09:04, Ben Finney wrote: > Joshua Landau writes: > >> On 12 September 2013 00:44, Ben Finney wrote: >> > mnish1...@gmail.com writes: >> > >> > My main advice: Avoid non-free (that is, proprietary) software for your >> > develo

Re: better and user friendly IDE recommended?

2013-09-12 Thread Joshua Landau
On 12 September 2013 00:44, Ben Finney wrote: > mnish1...@gmail.com writes: > > My main advice: Avoid non-free (that is, proprietary) software for your > development tools. Learning a set of development tools is a significant > investment, and you should not tie that investment to a single vendor;

Re: Language design

2013-09-11 Thread Joshua Landau
On 11 September 2013 11:38, Burak Arslan wrote: > On 09/10/13 09:09, Steven D'Aprano wrote: >> What design mistakes, traps or gotchas do you think Python has? > > My favourite gotcha is this: > > elt, = elts > > It's a nice and compact way to do both: > > assert len(elts) == 0 > elt =

Re: Interface and duck typing woes

2013-08-31 Thread Joshua Landau
On 31 August 2013 01:13, Steven D'Aprano wrote: > On Fri, 30 Aug 2013 06:35:47 -0400, Roy Smith wrote: > >> In article <52200699$0$6599$c3e8da3$54964...@news.astraweb.com>, >> Steven D'Aprano wrote: >> >>> These days, it would be relatively simple to implement pre- and post- >>> condition checki

Re: print function and unwanted trailing space

2013-08-31 Thread Joshua Landau
On 31 August 2013 23:08, Chris Angelico wrote: > On Sun, Sep 1, 2013 at 1:43 AM, Oscar Benjamin > wrote: >> On 31 August 2013 16:30, Chris Angelico wrote: but doesn't solve all the cases (imagine a string or an iterator). >>> >>> Similar but maybe simpler, and copes with more arbitrary

Re: Checking homogeneity of Array using List in Python

2013-08-26 Thread Joshua Landau
On 26 August 2013 14:49, Neil Cerutti wrote: > On 2013-08-25, sahil301...@gmail.com wrote: >> >> eg. my input is ['1', ' ', 'asdasd231231', '1213asasd', '43242'] >> I want it to be interpreted as: >> [1, [None], [None], [None], 43242] >> >> NOTE: NO INBUILT FUNCTION BE USED. > > Impossible. I thi

Re: Encapsulation unpythonic?

2013-08-18 Thread Joshua Landau
On 17 August 2013 17:17, Steven D'Aprano wrote: > On Sat, 17 Aug 2013 05:26:32 -0700, fsaldan1 wrote: >> how do I >> deal with the fact that other programmers can easily alter the values of >> members of my classes? > ... > If they insist on messing with your private single-underscore > _attribute

Re: Check for the type of arguments

2013-08-17 Thread Joshua Landau
On 17 August 2013 13:34, Fernando Saldanha wrote: > I am new to Python, with some experience in Java, C++ and R. > > Writing in other languages I usually check the type and values of function > arguments. In the Python code examples I have seen this is rarely done. > > Questions: > > 1) Is this b

Re: .split() Qeustion

2013-08-15 Thread Joshua Landau
On 15 August 2013 19:28, Chris Angelico wrote: > On Thu, Aug 15, 2013 at 5:54 PM, Joshua Landau wrote: >> On 15 August 2013 16:43, Chris Angelico wrote: >>> A mole is as much a number (6e23) as the light year is a number (9.5e15). >> >> A mole is a number. A light

Re: .split() Qeustion

2013-08-15 Thread Joshua Landau
On 15 August 2013 16:43, Chris Angelico wrote: > A mole is as much a number (6e23) as the light year is a number (9.5e15). A mole is a number. A light year is a unit. -- http://mail.python.org/mailman/listinfo/python-list

Re: Am I not seeing the Error?

2013-08-14 Thread Joshua Landau
On 14 August 2013 13:07, Chris Angelico wrote: > On Wed, Aug 14, 2013 at 7:59 AM, Joshua Landau wrote: >> >> What's wrong with cat? Sure it's superfluous but what makes it *bad*? >> Personally I often prefer the pipe "cat x | y" form to "x < y&quo

Re: .split() Qeustion

2013-08-14 Thread Joshua Landau
On 14 August 2013 12:45, Peter Otten <__pete...@web.de> wrote: > Joshua Landau wrote: >> On 14 August 2013 09:30, Alister wrote: >>> I would agree with the last statement. >>> Please write list definitions as lists rather than taking a short-cut to >>>

Re: .split() Qeustion

2013-08-14 Thread Joshua Landau
On 14 August 2013 09:30, Alister wrote: > On Tue, 13 Aug 2013 22:12:56 -0700, Gary Herron wrote: > >> On 08/13/2013 09:51 PM, eschneide...@comcast.net wrote: >>> How can I use the '.split()' method (am I right in calling it a >>> method?) without instead of writing each comma between words in the

Re: Am I not seeing the Error?

2013-08-14 Thread Joshua Landau
On 14 August 2013 02:20, Gregory Ewing wrote: > Ned Batchelder wrote: >> >> Everyone: this program seems to be a direct and misguided transliteration >> from a bash script. > > Not a particularly well-written bash script, either -- > it's full of superfluous uses of 'cat'. What's wrong with cat?

Re: Could you verify this, Oh Great Unicode Experts of the Python-List?

2013-08-13 Thread Joshua Landau
On 11 August 2013 12:14, Steven D'Aprano wrote: > On Sun, 11 Aug 2013 10:44:40 +0100, Joshua Landau wrote: >>>> "café" will be in your Copy-Paste buffer, and you can paste it in to >>>> the tweet-box. It takes 5 characters. So much for testing ;

Re: Am I not seeing the Error?

2013-08-13 Thread Joshua Landau
On 12 August 2013 16:47, Roy Smith wrote: > I can't quite sort out the multiple quoting levels, but somebody said: > Programming like that is called trolling. A programmer that uses trolling is called a troll. A troll can also refer to such a line of code itself. My scripts contain

Re: Could you verify this, Oh Great Unicode Experts of the Python-List?

2013-08-11 Thread Joshua Landau
On 11 August 2013 13:51, wrote: > Le dimanche 11 août 2013 11:09:44 UTC+2, Steven D'Aprano a écrit : >> On Sun, 11 Aug 2013 07:17:42 +0100, Joshua Landau wrote: >> >> The reason some accented letters have single code point forms is to >> support legacy char

Re: Could you verify this, Oh Great Unicode Experts of the Python-List?

2013-08-11 Thread Joshua Landau
On 11 August 2013 12:14, Steven D'Aprano wrote: > On Sun, 11 Aug 2013 10:44:40 +0100, Joshua Landau wrote: > >> On 11 August 2013 10:09, Steven D'Aprano >> wrote: >>> The reason some accented letters have single code point forms is to >>> support

Re: Am I not seeing the Error?

2013-08-11 Thread Joshua Landau
On 11 August 2013 09:28, Steven D'Aprano wrote: > into more lines. Why is all that in a >> single line? > > The only good excuse for writing multiple statements on a single line > separated by semi-colons is if the Enter key on your keyboard is broken. That's not a good excuse. It *is* a good ex

Re: Paramiko Help. Execute command to Interactive Shell which is opened by SSHClient()

2013-08-11 Thread Joshua Landau
On 11 August 2013 09:57, Chris Angelico wrote: > On Thu, Aug 8, 2013 at 8:20 AM, sagar varule wrote: >> stdin, stdout, stderr = client.exec_command(bv_cmd) >> for line in stderr.readlines(): >> print line >> for line in stdout.readlines(): >>

Re: Could you verify this, Oh Great Unicode Experts of the Python-List?

2013-08-11 Thread Joshua Landau
On 11 August 2013 07:24, Chris Angelico wrote: > On Sun, Aug 11, 2013 at 7:17 AM, Joshua Landau wrote: >> Given tweet = b"caf\x65\xCC\x81".decode(): >> >> >>> tweet >> 'café' >> >> But: >> >> >

Re: Could you verify this, Oh Great Unicode Experts of the Python-List?

2013-08-11 Thread Joshua Landau
se the linked post did it. I'm not sure why either ;). > On Sun, 11 Aug 2013 07:17:42 +0100, Joshua Landau wrote: >> >> So the solution is: >> >> >>> import unicodedata >> >>> len(unicodedata.normalize("NFC", tweet)) >>

  1   2   3   4   5   6   7   >