Re: Why do I always get an exception raised in this __init__()?

2023-09-03 Thread Chris Green via Python-list
Alan Gauld wrote: > On 31/08/2023 22:15, Chris Green via Python-list wrote: > > > class Gpiopin: > > > > def __init__(self, pin): > > # > > # > > # scan through the GPIO chips to find the line/pin we want > > # > > for

Re: Why do I always get an exception raised in this __init__()?

2023-09-01 Thread Alan Gauld via Python-list
On 31/08/2023 22:15, Chris Green via Python-list wrote: > class Gpiopin: > > def __init__(self, pin): > # > # > # scan through the GPIO chips to find the line/pin we want > # > for c in ['gpiochip0', 'gpiochip1',

Re: Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Larry Martell via Python-list
On Thu, Aug 31, 2023 at 3:19 PM Chris Green via Python-list wrote: > > I'm obviously doing something very silly here but at the moment I > can't see what. > > Here's the code:- > > #!/usr/bin/python3 > # > # > # GPIO > # > import gpiod > # > # > # Simple

Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Chris Green via Python-list
I'm obviously doing something very silly here but at the moment I can't see what. Here's the code:- #!/usr/bin/python3 # # # GPIO # import gpiod # # # Simple wrapper class for gpiod to make set and clearing outputs easier # class Gpiopin:

Re: Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Chris Green via Python-list
Chris Green wrote: [snip code and question] Sorry folks, it was a caching problem, I wasn't running the code I thought I was running! When I made sure I had cleared everything out and tried again it all worked as I expected. -- Chris Green · --

Re: Why do I see digest replies to posts I never saw in a digest?

2022-07-23 Thread Peter J. Holzer
On 2022-07-23 14:01:09 -0400, pjfarl...@earthlink.net wrote: > OT to the original subject, but can anyone explain to me why in the > forum digest emails I receive I often see a reply to a post that I > never saw the original of in any prior digest? I think in most cases this is because both

Why do I see digest replies to posts I never saw in a digest? [was: RE: Why I fail so bad to check for memory leak with this code?]

2022-07-23 Thread pjfarley3
OT to the original subject, but can anyone explain to me why in the forum digest emails I receive I often see a reply to a post that I never saw the original of in any prior digest? Peter > -Original Message- > From: Marco Sulla > Sent: Friday, July 22, 2022 3:41 PM > To: Barry > Cc:

[issue46422] Why do we need `dis.Positions`?

2022-01-24 Thread Nikita Sobolev
Change by Nikita Sobolev : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue46422] Why do we need `dis.Positions`?

2022-01-24 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: New changeset 58f3d980989c7346ad792d464c1d749dcec6af63 by Nikita Sobolev in branch 'main': bpo-46422: use `dis.Positions` in `dis.Instruction` (GH-30716) https://github.com/python/cpython/commit/58f3d980989c7346ad792d464c1d749dcec6af63 --

[issue46422] Why do we need `dis.Positions`?

2022-01-19 Thread Nikita Sobolev
Change by Nikita Sobolev : -- keywords: +patch pull_requests: +28908 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30716 ___ Python tracker ___

[issue46422] Why do we need `dis.Positions`?

2022-01-19 Thread Nikita Sobolev
Nikita Sobolev added the comment: Ok then, I will send my option `2` proposal to fix this later today. -- ___ Python tracker ___

[issue46422] Why do we need `dis.Positions`?

2022-01-19 Thread Batuhan Taskaya
Batuhan Taskaya added the comment: The initial aim of the dis.Positions was to provide an interface like AST nodes. So you could do for instr in dis.Bytecode(source): print("located in: ", instr.positions.lineno) instead of for instr in dis.Bytecode(source): if instr.positions:

[issue46422] Why do we need `dis.Positions`?

2022-01-18 Thread Nikita Sobolev
n it after a final decision is made :) -- components: Library (Lib) messages: 410855 nosy: BTaskaya, pablogsal, sobolevn priority: normal severity: normal status: open title: Why do we need `dis.Positions`? type: behavior versions: Python 3.11 ___ Pyth

Re: Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2021-01-01 Thread Barry Scott
> On 1 Jan 2021, at 16:42, Chris Angelico wrote: > > On Sat, Jan 2, 2021 at 3:36 AM Barry Scott > wrote: >> >> FYI this is what I have installed (lspy is a personal script): >> >> $ lspy >> /bin/python: 3.9.1 final 0 >> /bin/python2: 2.7.18 final 0 >>

Re: Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2021-01-01 Thread Chris Angelico
On Sat, Jan 2, 2021 at 3:36 AM Barry Scott wrote: > > FYI this is what I have installed (lspy is a personal script): > > $ lspy > /bin/python: 3.9.1 final 0 > /bin/python2: 2.7.18 final 0 > /bin/python2.7: 2.7.18 final 0 > /bin/python3: 3.9.1 final 0 > /bin/python3.10: 3.10.0 alpha 3 >

Re: Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2021-01-01 Thread Barry Scott
> On 29 Dec 2020, at 15:10, Chris Green wrote: > > Why are there both /usr/lib/python3 and /usr/lib/python3.8 on my > x[ubuntu] system? > > /usr/lib/python3 has just the dist-packages directory in it, > /usr/lib/python3.8 has lots of individual python files in it as well > as quite a number

Re: Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2021-01-01 Thread john steve
On Wednesday, December 30, 2020 at 9:03:28 AM UTC-8, Chris Green wrote: > Anssi Saari wrote: > > Chris Green writes: > > > > > Why are there both /usr/lib/python3 and /usr/lib/python3.8 on my > > > x[ubuntu] system? > > > > While it's more of an Ubuntu (or Debian) question better asked in

Re: Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2020-12-30 Thread Chris Green
Anssi Saari wrote: > Chris Green writes: > > > Why are there both /usr/lib/python3 and /usr/lib/python3.8 on my > > x[ubuntu] system? > > While it's more of an Ubuntu (or Debian) question better asked in some > relevant Linux forum, in the end it's because some package managers > decided to do

Re: Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2020-12-30 Thread Anssi Saari
Chris Green writes: > Why are there both /usr/lib/python3 and /usr/lib/python3.8 on my > x[ubuntu] system? While it's more of an Ubuntu (or Debian) question better asked in some relevant Linux forum, in the end it's because some package managers decided to do that. You can use commands like

Why do I have both /usr/lib/python3 and /usr/lib/python3.8?

2020-12-29 Thread Chris Green
Why are there both /usr/lib/python3 and /usr/lib/python3.8 on my x[ubuntu] system? /usr/lib/python3 has just the dist-packages directory in it, /usr/lib/python3.8 has lots of individual python files in it as well as quite a number of directories. There's also a /usr/lib/python3.9 directory

Re: __instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-05 Thread Pieter van Oostrum
Chris Angelico writes: > On Tue, Nov 5, 2019 at 5:43 PM dieter wrote: >> I suppose that "isinstance" (at least under Python 2) does not >> behave exactly as stated in PEP 3119. Instead, "isinstance" >> first directly checks for the instance to be an instance of the >> class *AND ONLY IF THIS

Re: __instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-05 Thread Rhodri James
On 04/11/2019 22:23, Peter J. Holzer wrote: On 2019-11-04 14:54:23 +, Rhodri James wrote: On 04/11/2019 14:33, Veek M wrote: __metaclass__ = whatever; # is python2.x syntax But not Python3: see PEP 3115 Doesn't "X is python2.x syntax" imply "X is not python3 syntax"? Not necessarily,

Re: __instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-04 Thread Chris Angelico
On Tue, Nov 5, 2019 at 5:43 PM dieter wrote: > I suppose that "isinstance" (at least under Python 2) does not > behave exactly as stated in PEP 3119. Instead, "isinstance" > first directly checks for the instance to be an instance of the > class *AND ONLY IF THIS FAILS* calls the class'

Re: __instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-04 Thread dieter
ence" and concrete derived classes "list" and "tuple". For this use case, it is okay when "isinstance(inst, cls)" returns "True" whenever "inst" is a "cls" object and that "cls.__instancecheck__" is used only to result

Re: __instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-04 Thread Peter J. Holzer
On 2019-11-04 14:54:23 +, Rhodri James wrote: > On 04/11/2019 14:33, Veek M wrote: > > __metaclass__ = whatever; # is python2.x syntax > > But not Python3: see PEP 3115 Doesn't "X is python2.x syntax" imply "X is not python3 syntax"? hp -- _ | Peter J. Holzer| Story must

Re: __instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-04 Thread Rhodri James
On 04/11/2019 14:33, Veek M wrote: Aha. You're trying to fix up the metaclass after the fact, which is not the right way to do it. If you change the class definitions to: __metaclass__ = whatever; # is python2.x syntax But not Python3: see PEP 3115 then you get the prints from

Re: __instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-04 Thread Veek M
> > Aha. You're trying to fix up the metaclass after the fact, which is not > the right way to do it. If you change the class definitions to: > __metaclass__ = whatever; # is python2.x syntax > then you get the prints from MyMeta.__instancecheck__(). The > isinstance() still returns True,

Re: __instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-04 Thread Rhodri James
On 04/11/2019 11:30, Veek M wrote: 1. Why do I get True whenever i tuple the isinstance(f, (Bar, Foo)) (and why don't the print's run) I'm not very familiar with metaclasses, but I can answer the second part of your question. The docs say that you can feed it a tuple and that the results

__instancecheck__ metaclasses, how do they work: why do I get True when I tuple, why doesn't print run?

2019-11-04 Thread Veek M
1. Why do I get True whenever i tuple the isinstance(f, (Bar, Foo)) (and why don't the print's run) The docs say that you can feed it a tuple and that the results are OR'd The form using a tuple, isinstance(x, (A, B, ...)), is a shortcut for isinstance(x, A) or isinstance(x, B) or ... (etc

Re: Why do I need to use pip3 but not pip

2019-03-30 Thread Peter J. Holzer
On 2019-03-30 15:57:55 +0530, Arup Rakshit wrote: > This is awesome. Now where should I put my source code? I see many folders > into it. You don't. In my opinion virtual environments should be expendable: You can destroy and recreate them at will. That leaves two possibilies: 1) Use a "central

Re: Why do I need to use pip3 but not pip

2019-03-30 Thread Arup Rakshit
Hi Peter, This is awesome. Now where should I put my source code? I see many folders into it. Thanks, Arup Rakshit a...@zeit.io > On 30-Mar-2019, at 3:26 PM, Peter Otten <__pete...@web.de> wrote: > > Arup Rakshit wrote: > >> Hello All, >> >> Thanks I got it now. >> >> One related

Re: Why do I need to use pip3 but not pip

2019-03-30 Thread Peter Otten
Arup Rakshit wrote: > Hello All, > > Thanks I got it now. > > One related question: Can I use pip3 for example to install packages > project specific, but not globally? So that when I delete the project, all > of them gone also from my disk. For that you can create a "virtual environment": $

Re: Why do I need to use pip3 but not pip

2019-03-30 Thread Arup Rakshit
Hello All, Thanks I got it now. One related question: Can I use pip3 for example to install packages project specific, but not globally? So that when I delete the project, all of them gone also from my disk. Thanks, Arup Rakshit a...@zeit.io > On 30-Mar-2019, at 2:05 PM, Cameron Simpson

Re: Why do I need to use pip3 but not pip

2019-03-30 Thread Nagy László Zsolt
  Hello, It depends on the operating system. For example on Ubuntu, the default python version is still 2.7. When you install both python2.7 and python3 on a system, then usually the "pip" will be a symlink to pip version 2 or 3. The default python interpreter can be different on different

Re: Why do I need to use pip3 but not pip

2019-03-30 Thread Cameron Simpson
On 30Mar2019 13:50, Arup Rakshit wrote: When I read this https://pip.pypa.io/en/stable/installing/ it says I have the pip installed when I installed the python from official doc. But when I run the `pip` command from shell, I get error, but pip3 works. ~/python_playground ▶ pip --version

Why do I need to use pip3 but not pip

2019-03-30 Thread Arup Rakshit
Hi, When I read this https://pip.pypa.io/en/stable/installing/ it says I have the pip installed when I installed the python from official doc. But when I run the `pip` command from shell, I get error, but pip3 works. ~/python_playground

Re: Why do data descriptors (e.g. properties) take priority over instance attributes?

2018-12-27 Thread Peter J. Holzer
On 2018-12-17 21:57:22 +1100, Paul Baker wrote: > class C: > def __init__(self): > self.__dict__['a'] = 1 > > @property > def a(self): > return 2 > > o = C() > print(o.a) # Prints 2 What version of Python is this? I get a different

Re: Why do data descriptors (e.g. properties) take priority over instance attributes?

2018-12-27 Thread Peter J. Holzer
On 2018-12-27 14:17:34 +0100, Peter J. Holzer wrote: > On 2018-12-17 21:57:22 +1100, Paul Baker wrote: > > class C: > > def __init__(self): > > self.__dict__['a'] = 1 > > > > @property > > def a(self): > > return 2 > > > > o = C() > >

Re: Why do data descriptors (e.g. properties) take priority over instance attributes?

2018-12-18 Thread Ian Kelly
On Mon, Dec 17, 2018, 12:09 PM Paul Baker When Python looks up an attribute on an object (i.e. when it executes > `o.a`), it uses an interesting priority order [1]. It looks for: > > 1. A class attribute that is a data-descriptor (most commonly a property) > 2. An instance attribute > 3. Any

Re: Why do data descriptors (e.g. properties) take priority over instance attributes?

2018-12-18 Thread dieter
Paul Baker writes: > When Python looks up an attribute on an object (i.e. when it executes > `o.a`), it uses an interesting priority order [1]. It looks for: > > 1. A class attribute that is a data-descriptor (most commonly a property) > 2. An instance attribute > 3. Any other class attribute

Why do data descriptors (e.g. properties) take priority over instance attributes?

2018-12-17 Thread Paul Baker
When Python looks up an attribute on an object (i.e. when it executes `o.a`), it uses an interesting priority order [1]. It looks for: 1. A class attribute that is a data-descriptor (most commonly a property) 2. An instance attribute 3. Any other class attribute We can confirm this using the

Re: Why do integers compare equal to booleans?

2018-11-16 Thread Santiago Basulto
/11/18 14:51, Steve Keller wrote: > > Why do the integers 0 and 1 compare equal to the boolean values False > > and True and all other integers to neither of them? > > > > $ python3 > > Python 3.5.2 (default, Nov 12 2018, 13:43:14) > > [GCC 5

RE: Why do integers compare equal to booleans?

2018-11-16 Thread David Raymond
/datamodel.html#the-standard-type-hierarchy -Original Message- From: Python-list [mailto:python-list-bounces+david.raymond=tomtom@python.org] On Behalf Of Steve Keller Sent: Friday, November 16, 2018 9:51 AM To: python-list@python.org Subject: Why do integers compare equal to booleans

Re: Why do integers compare equal to booleans?

2018-11-16 Thread duncan smith
On 16/11/18 14:51, Steve Keller wrote: > Why do the integers 0 and 1 compare equal to the boolean values False > and True and all other integers to neither of them? > > $ python3 > Python 3.5.2 (default, Nov 12 2018, 13:43:14) > [GCC 5.4.0 20160609] on linu

Re: Why do integers compare equal to booleans?

2018-11-16 Thread Jon Ribbens
On 2018-11-16, Steve Keller wrote: > Why do the integers 0 and 1 compare equal to the boolean values False > and True and all other integers to neither of them? Because Python used not to have a boolean type and used the integers 0 and 1 instead, so when the boolean type was introduce

Why do integers compare equal to booleans?

2018-11-16 Thread Steve Keller
Why do the integers 0 and 1 compare equal to the boolean values False and True and all other integers to neither of them? $ python3 Python 3.5.2 (default, Nov 12 2018, 13:43:14) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or

Re: why do I get syntax error on if : break

2018-05-26 Thread Grant Edwards
On 2018-05-25, asa32s...@gmail.com wrote: > here is the code, i keep getting an error, "break outside loop". You get the "break outside loop" error because you're using the break statement when you are not inside a loop. > if it is false just exit function You use the

Re: why do I get syntax error on if : break

2018-05-25 Thread Dan Stromberg
On Thu, May 24, 2018 at 7:12 PM, wrote: > here is the code, i keep getting an error, "break outside loop". if it is > false just exit function > > > def d(idx): > if type(idx) != int: > break > > d('k') Not what you asked, but I believe pylint recommends using

Re: why do I get syntax error on if : break

2018-05-25 Thread bartc
On 25/05/2018 11:08, asa32s...@gmail.com wrote: On Thursday, May 24, 2018 at 10:12:46 PM UTC-4, asa3...@gmail.com wrote: here is the code, i keep getting an error, "break outside loop". if it is false just exit function def d(idx): if type(idx) != int: break d('k') thanks...

Re: why do I get syntax error on if : break

2018-05-25 Thread asa32sd23
On Thursday, May 24, 2018 at 10:12:46 PM UTC-4, asa3...@gmail.com wrote: > here is the code, i keep getting an error, "break outside loop". if it is > false just exit function > > > def d(idx): > if type(idx) != int: > break > > d('k') thanks... I believe the compiler. So how do I

Re: why do I get syntax error on if : break

2018-05-24 Thread Steven D'Aprano
On Thu, 24 May 2018 19:12:33 -0700, asa32sd23 wrote: > here is the code, i keep getting an error, "break outside loop". if it > is false just exit function break doesn't exit the function, it exits the loop. There is no loop to exit, so it is an error. Believe the compiler when it tells you

Re: why do I get syntax error on if : break

2018-05-24 Thread boB Stepp
On Thu, May 24, 2018 at 9:12 PM, wrote: > here is the code, i keep getting an error, "break outside loop". if it is > false just exit function > > > def d(idx): > if type(idx) != int: > break > > d('k') "break" (and "continue") are only meaningful inside for or

why do I get syntax error on if : break

2018-05-24 Thread asa32sd23
here is the code, i keep getting an error, "break outside loop". if it is false just exit function def d(idx): if type(idx) != int: break d('k') -- https://mail.python.org/mailman/listinfo/python-list

Re: Why do we nned both - __init__() and __new__()

2017-09-08 Thread dieter
Andrej Viktorovich writes: > For my understanding both - __init__() and __new__() works like constructors. > And __new__() looks is closer to constructor. __init__() is more for variable > initialization. Why I can't just initialize in __init__() ? > > class

Re: Why do we nned both - __init__() and __new__()

2017-09-07 Thread Ben Finney
Andrej Viktorovich writes: > For my understanding both - __init__() and __new__() works like > constructors. Not true, they work quite differently and have very different jobs. > And __new__() looks is closer to constructor. __init__() is more for > variable

Re: Why do we nned both - __init__() and __new__()

2017-09-07 Thread Rustom Mody
On Thursday, September 7, 2017 at 4:27:48 PM UTC+5:30, Andrej Viktorovich wrote: > Hello > > For my understanding both - __init__() and __new__() works like constructors. > And __new__() looks is closer to constructor. __init__() is more for variable > initialization. Why I can't just

[issue30023] Example code becomes invalid for "Why do lambdas defined in a loop with different values all return the same result?"

2017-04-09 Thread Eric V. Smith
Changes by Eric V. Smith : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker ___

[issue30023] Example code becomes invalid for "Why do lambdas defined in a loop with different values all return the same result?"

2017-04-09 Thread Eric V. Smith
Eric V. Smith added the comment: That's consistent with the example: it's showing you how to create a list of functions, that when called, return squares. "This gives you a list that contains 5 lambdas that calculate x**2" Maybe "squares" isn't the most awesome name, but I think if you read

[issue30023] Example code becomes invalid for "Why do lambdas defined in a loop with different values all return the same result?"

2017-04-09 Thread Philip Lee
New submission from Philip Lee: There example code here becomes invalid https://docs.python.org/3/faq/programming.html#why-do-lambdas-defined-in-a-loop-with-different-values-all-return-the-same-result >>> squares = [] >>> for x in range(5): squares.a

Re: Why do these statements evaluate the way they do?

2016-05-07 Thread Steven D'Aprano
On Sat, 7 May 2016 04:36 pm, Anthony Papillion wrote: > I'm trying to figure out why the following statements evaluate the way > they do and I'm not grasping it for some reason. I'm hoping someone can > help me. > > 40+2 is 42 #evaluates to True > But > 2**32 is 2**32 #evaluates to False That

Re: Why do these statements evaluate the way they do?

2016-05-07 Thread Chris Angelico
On Sat, May 7, 2016 at 5:49 PM, Stephen Hansen wrote: > The long and short of it is: you should almost never use 'is' for > comparing integers (or strings). It doesn't mean what you think it does > and isn't useful to you. Compare equality. > > In general, the only things you

Re: Why do these statements evaluate the way they do?

2016-05-07 Thread Stephen Hansen
On Fri, May 6, 2016, at 11:36 PM, Anthony Papillion wrote: > I'm trying to figure out why the following statements evaluate the way > they do and I'm not grasping it for some reason. I'm hoping someone can > help me. > > 40+2 is 42 #evaluates to True > But > 2**32 is 2**32 #evaluates to False >

Re: Why do these statements evaluate the way they do?

2016-05-07 Thread Kev Dwyer
Anthony Papillion wrote: > I'm trying to figure out why the following statements evaluate the way > they do and I'm not grasping it for some reason. I'm hoping someone can > help me. > > 40+2 is 42 #evaluates to True > But > 2**32 is 2**32 #evaluates to False > > This is an example taken from a

Re: Why do these statements evaluate the way they do?

2016-05-07 Thread Chris Angelico
On Sat, May 7, 2016 at 4:36 PM, Anthony Papillion wrote: > I'm trying to figure out why the following statements evaluate the way they > do and I'm not grasping it for some reason. I'm hoping someone can help me. > > 40+2 is 42 #evaluates to True > But > 2**32 is 2**32

Why do these statements evaluate the way they do?

2016-05-07 Thread Anthony Papillion
I'm trying to figure out why the following statements evaluate the way they do and I'm not grasping it for some reason. I'm hoping someone can help me. 40+2 is 42 #evaluates to True But 2**32 is 2**32 #evaluates to False This is an example taken from a Microsoft blog on the topic. They say the

Re: Why do you use python?

2016-03-21 Thread Larry Martell
On Mon, Mar 21, 2016 at 4:26 PM, wrote: > On Monday, 21 March 2016 04:13:45 UTC, Chris Angelico wrote: >> On Mon, Mar 21, 2016 at 2:59 PM, wrote: >> > instead, to be efficient, it is best to combine tools to solve problems >> > that contain

Re: Why do you use python?

2016-03-21 Thread mbg1708
On Monday, 21 March 2016 04:13:45 UTC, Chris Angelico wrote: > On Mon, Mar 21, 2016 at 2:59 PM, wrote: > > instead, to be efficient, it is best to combine tools to solve problems > > that contain complexities where there is nothing available off the shelve > > that does

Re: Why do you use python?

2016-03-21 Thread sohcahtoa82
On Saturday, October 31, 2009 at 12:11:02 AM UTC-7, sk wrote: > What would be your answer if this question is asked to you in an > interview? > > a modified version might be: > "Where would you use python over C/C++/Java?" > > (because my resume says I know C/C++/Java)? I use Python when speed

Re: Why do you use python?

2016-03-20 Thread Ben Finney
Chris Angelico writes: > True. I'm not saying you should never use more than one tool, but that > every additional tool used costs exponentially in complexity. And > people who claim they should use any tool whatsoever usually use "I > know this tool" as the most important

Re: Why do you use python?

2016-03-20 Thread Chris Angelico
On Mon, Mar 21, 2016 at 3:49 PM, Dan Sommers wrote: >> So instead of treating programming like a plumber at a hardware store, >> treat it like an artist with a canvas. You wouldn't normally see a >> portrait done partly in watercolor and partly in oils - or if it is, >>

Re: Why do you use python?

2016-03-20 Thread Mark Lawrence
On 21/03/2016 03:59, rhardin...@gmail.com wrote: On Saturday, October 31, 2009 at 3:22:20 AM UTC-6, Martin P. Hellwig wrote: sk wrote: What would be your answer if this question is asked to you in an interview? a modified version might be: "Where would you use python over C/C++/Java?"

Re: Why do you use python?

2016-03-20 Thread Dan Sommers
On Mon, 21 Mar 2016 15:13:22 +1100, Chris Angelico wrote: > On Mon, Mar 21, 2016 at 2:59 PM, wrote: >> instead, to be efficient, it is best to combine tools to solve >> problems that contain complexities where there is nothing available >> off the shelve that does the

Re: Why do you use python?

2016-03-20 Thread Chris Angelico
On Mon, Mar 21, 2016 at 2:59 PM, wrote: > instead, to be efficient, it is best to combine tools to solve problems that > contain complexities where there is nothing available off the shelve that > does the job. c# is free, free VS studio, i can run ironpython there, i can

Re: Why do you use python?

2016-03-20 Thread rharding64
On Saturday, October 31, 2009 at 3:22:20 AM UTC-6, Martin P. Hellwig wrote: > sk wrote: > > What would be your answer if this question is asked to you in an > > interview? > > > > a modified version might be: > > "Where would you use python over C/C++/Java?" > > > > (because my resume says I

Why do I get SyntaxError: invalid syntax

2015-05-04 Thread Cecil Westerhof
While copying pasting code to test, the following works: from itertools import islice from os import rename from os.pathimport expanduser, split from tempfile import NamedTemporaryFile real_file = (expanduser('~/Twitter/testing.txt')) (filepath, file)

Re: Why do I get SyntaxError: invalid syntax

2015-05-04 Thread Chris Angelico
On Mon, May 4, 2015 at 9:31 PM, Cecil Westerhof ce...@decebal.nl wrote: While copying pasting code to test, the following works: [chomp] But first I used: with NamedTemporaryFile(mode = 'w', prefix = file + '_', dir = filepath, delete = False) as tf: tempfile = tf.name

Re: Why do I get SyntaxError: invalid syntax

2015-05-04 Thread Cecil Westerhof
Op Monday 4 May 2015 14:07 CEST schreef Chris Angelico: On Mon, May 4, 2015 at 9:31 PM, Cecil Westerhof ce...@decebal.nl wrote: While copying pasting code to test, the following works: [chomp] But first I used: with NamedTemporaryFile(mode = 'w', prefix = file + '_', dir = filepath, delete =

Re: Why do the URLs of posts here change?

2015-01-17 Thread Albert van der Horst
In article mailman.17551.1420862015.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Sat, Jan 10, 2015 at 2:21 PM, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Skip Montanaro wrote: The way this is done, is that the message is removed from the underlying mbox file,

Re: Why do the URLs of posts here change?

2015-01-17 Thread Gregory Ewing
Albert van der Horst wrote: Knowing that the source is an mbox file, I don't need to follow that link to conclude that one is not very inventive. It suffices to replace the content of the message by a repetition of '\n'. Editing the mbox file isn't the problem. From what I gather, telling

Re: Why do the URLs of posts here change?

2015-01-10 Thread Terry Reedy
On 1/9/2015 7:04 AM, Skip Montanaro wrote: Posts on this newsgroup/mailing list are archived on the web, but the URLs seem to change, which leaves dead links if you search for things. Steven, It's a known issue, but one which appears to be somewhat unavoidable, at least in Mailman 2.x. The

Re: Why do the URLs of posts here change?

2015-01-10 Thread Skip Montanaro
On Sat, Jan 10, 2015 at 3:41 AM, Terry Reedy tjre...@udel.edu wrote: The post could be replaced by a placeholder This message deleted' and the archive regenerated. That changes the counter for every message after A placeholder should avoid that. I suspect (though don't know for certain)

Re: Why do the URLs of posts here change?

2015-01-09 Thread Chris Angelico
On Sat, Jan 10, 2015 at 2:21 PM, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: Skip Montanaro wrote: The way this is done, is that the message is removed from the underlying mbox file, and the archive regenerated. That changes the counter for every message after that point Would it

Re: Why do the URLs of posts here change?

2015-01-09 Thread Gregory Ewing
Skip Montanaro wrote: The way this is done, is that the message is removed from the underlying mbox file, and the archive regenerated. That changes the counter for every message after that point Would it help to replace the message with a stub instead of deleting it altogether? -- Greg --

Re: Why do the URLs of posts here change?

2015-01-09 Thread Chris Angelico
On Sat, Jan 10, 2015 at 3:52 AM, Rustom Mody rustompm...@gmail.com wrote: Is it? Ok lets test that. This is posted from google-groups. After posting I shall remove it Remove it from GG, maybe, but I doubt very much it'll be removed from the python.org archive. It's virtually impossible to

Re: Why do the URLs of posts here change?

2015-01-09 Thread Rustom Mody
On Friday, January 9, 2015 at 7:46:42 PM UTC+5:30, Skip Montanaro wrote: On Fri, Jan 9, 2015 at 8:09 AM, Rustom Mody wrote: Theres a new app/service that should solve your problem: Its from google... and called groups wink It solves one problem (moving archive URLs) by, I think, ignoring

Re: Why do the URLs of posts here change?

2015-01-09 Thread Rustom Mody
On Friday, January 9, 2015 at 10:27:53 PM UTC+5:30, Chris Angelico wrote: On Sat, Jan 10, 2015 at 3:52 AM, Rustom Mody wrote: Is it? Ok lets test that. This is posted from google-groups. After posting I shall remove it Remove it from GG, maybe, but I doubt very much it'll be removed

Re: Why do the URLs of posts here change?

2015-01-09 Thread Skip Montanaro
Posts on this newsgroup/mailing list are archived on the web, but the URLs seem to change, which leaves dead links if you search for things. Steven, It's a known issue, but one which appears to be somewhat unavoidable, at least in Mailman 2.x. The problem is that every now and then,

Re: Why do the URLs of posts here change?

2015-01-09 Thread Peter Otten
Steven D'Aprano wrote: I have come across this in the past, but today it annoyed me enough that I'm asking for an explanation. Posts on this newsgroup/mailing list are archived on the web, but the URLs seem to change, which leaves dead links if you search for things. For example, today I

Re: Why do the URLs of posts here change?

2015-01-09 Thread Steven D'Aprano
Skip Montanaro wrote: Posts on this newsgroup/mailing list are archived on the web, but the URLs seem to change, which leaves dead links if you search for things. [...] That all said, I don't know if Mailman 3 (or some other archiver than pipermail) will improve on this problem. I suggest a

Re: Why do the URLs of posts here change?

2015-01-09 Thread Rustom Mody
On Friday, January 9, 2015 at 4:26:58 PM UTC+5:30, Steven D'Aprano wrote: I have come across this in the past, but today it annoyed me enough that I'm asking for an explanation. Posts on this newsgroup/mailing list are archived on the web, but the URLs seem to change, which leaves dead links

Re: Why do the URLs of posts here change?

2015-01-09 Thread Skip Montanaro
On Fri, Jan 9, 2015 at 8:09 AM, Rustom Mody rustompm...@gmail.com wrote: Theres a new app/service that should solve your problem: Its from google... and called groups wink It solves one problem (moving archive URLs) by, I think, ignoring the other (archive posts which should really be

Why do the URLs of posts here change?

2015-01-09 Thread Steven D'Aprano
I have come across this in the past, but today it annoyed me enough that I'm asking for an explanation. Posts on this newsgroup/mailing list are archived on the web, but the URLs seem to change, which leaves dead links if you search for things. For example, today I searched for a quote about

Why do I keep getting emails from Dennis?

2014-11-23 Thread Sayth Renshaw
I keep receiving emails from Dennis and it appears Dennis only on this list, I am signed up to comp.lang.python and am unsure why I keep getting Dennis' s emails. Sayth -- https://mail.python.org/mailman/listinfo/python-list

Re: Why do I keep getting emails from Dennis?

2014-11-23 Thread Michael Torrie
On 11/23/2014 08:21 PM, Sayth Renshaw wrote: I keep receiving emails from Dennis and it appears Dennis only on this list, I am signed up to comp.lang.python and am unsure why I keep getting Dennis' s emails. If you post to the newsgroup, using your e-mail address as the from address, when

Why do only callable objects get a __name__?

2013-11-18 Thread John Ladasky
in the object's type. I found that the type, rather than the object itself, had the __name__ I was seeking. I then read the Python docs concerning __name__ and found that this attribute is restricted to callable objects. This leads me to ask two questions: 1. WHY do only callable objects

Re: Why do only callable objects get a __name__?

2013-11-18 Thread John Ladasky
On Monday, November 18, 2013 12:13:42 PM UTC-8, I wrote: 2. If I created a superclass of namedtuple which exposed type(namedtuple).__name__ in the namespace of the namedtuple itself, would I be doing anything harmful? Sigh. Of course, that should read subclass, not superclass. Because I

Re: Why do only callable objects get a __name__?

2013-11-18 Thread Ian Kelly
is restricted to callable objects. This leads me to ask two questions: 1. WHY do only callable objects get a __name__? A __name__ would seem to be a useful feature for other types. Clearly, whoever implemented namedtuple thought it was useful to retain and display that information as a part

Re: Why do only callable objects get a __name__?

2013-11-18 Thread John Ladasky
On Monday, November 18, 2013 12:43:28 PM UTC-8, Ian wrote: Classes and functions are frequently kept in module namespaces, where they are known by a specific name. The intent is that the __name__ attribute should match that name by which it is commonly referred. Specific instances are

Re: Why do only callable objects get a __name__?

2013-11-18 Thread Terry Reedy
. The main module has the name (__name__) '__main__'. (A file named '__main__.py' also has special meaning. If one does 'python -m package' on a command line and 'package' is a directory with '__init__.py', 'package/__main__.py' is executed as the main module '__main__'. 1. WHY do only

Re: Why do only callable objects get a __name__?

2013-11-18 Thread John Ladasky
. This true statement invalidates your subject line ;-). All modules have a __name__. Yes, I thought about this before I posted. I figured that, if I investigated further I would discover that there was a __main__ function that was being called. 1. WHY do only callable objects get a __name__

  1   2   3   4   >