RE: Question about learning Python

2022-09-07 Thread avi.e.gross
bject: Re: Question about learning Python On Thu, 8 Sept 2022 at 04:54, Grant Edwards wrote: > > On 2022-09-07, Chris Angelico wrote: > > On Thu, 8 Sept 2022 at 01:50, Maruful Islam wrote: > >> > >> I want to start learning python. I have a question about learn

RE: Question about learning Python

2022-09-07 Thread avi.e.gross
in C but can be done much nicer using Python costructs. -Original Message- From: Python-list On Behalf Of Meredith Montgomery Sent: Wednesday, September 7, 2022 3:35 PM To: python-list@python.org Subject: Re: Question about learning Python Maruful Islam writes: > I want to st

Re: Question about learning Python

2022-09-07 Thread Meredith Montgomery
Maruful Islam writes: > I want to start learning python. I have a question about learning python. > > Is learning C essential or not for learning python? Surely not necessary. There's a generous recent thread about books on Python. Have a look at it. -- https://mail.python.org/mailman/listin

Re: Question about learning Python

2022-09-07 Thread dn
On 08/09/2022 07.15, Chris Angelico wrote: > On Thu, 8 Sept 2022 at 05:09, Grant Edwards wrote: >> >> On 2022-09-07, Chris Angelico wrote: >>> On Thu, 8 Sept 2022 at 04:54, Grant Edwards >>> wrote: >>> If you're a beginning programmer, then IMO learning C first is probably detrimental

Re: Question about learning Python

2022-09-07 Thread Chris Angelico
On Thu, 8 Sept 2022 at 05:09, Grant Edwards wrote: > > On 2022-09-07, Chris Angelico wrote: > > On Thu, 8 Sept 2022 at 04:54, Grant Edwards > > wrote: > > > >> If you're a beginning programmer, then IMO learning C first is > >> probably detrimental. [...] > > > > Not as detrimental as starting

Re: Question about learning Python

2022-09-07 Thread Grant Edwards
On 2022-09-07, Chris Angelico wrote: > On Thu, 8 Sept 2022 at 04:54, Grant Edwards wrote: > >> If you're a beginning programmer, then IMO learning C first is >> probably detrimental. [...] > > Not as detrimental as starting with BASIC, and then moving on to x86 > assembly language, and trying to

Re: Question about learning Python

2022-09-07 Thread Chris Angelico
On Thu, 8 Sept 2022 at 04:54, Grant Edwards wrote: > > On 2022-09-07, Chris Angelico wrote: > > On Thu, 8 Sept 2022 at 01:50, Maruful Islam wrote: > >> > >> I want to start learning python. I have a question about learning python. > >> > >> Is learning C essential or not for learning python? > >

Re: Question about learning Python

2022-09-07 Thread Grant Edwards
On 2022-09-07, Chris Angelico wrote: > On Thu, 8 Sept 2022 at 01:50, Maruful Islam wrote: >> >> I want to start learning python. I have a question about learning python. >> >> Is learning C essential or not for learning python? > > Absolutely not essential. In fact, I would strongly recommend lea

Re: Question about learning Python

2022-09-07 Thread Chris Angelico
On Thu, 8 Sept 2022 at 01:50, Maruful Islam wrote: > > I want to start learning python. I have a question about learning python. > > Is learning C essential or not for learning python? Absolutely not essential. In fact, I would strongly recommend learning Python before ever picking up C, as it's

Re: Question about learning Python

2022-09-07 Thread Thomas Passin
On 9/7/2022 6:28 AM, Maruful Islam wrote: I want to start learning python. I have a question about learning python. Is learning C essential or not for learning python? Not at all. -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about learning Python

2022-09-07 Thread Lars Liedtke
Hello and welcome, the answer is a definitive "it depends" ;-) Generally you do not need knowledge in C for learning Python. But I'd say that it will not hurt to have some knowledge. Especially some packages use C-code to extend Python. But it seems to me that you are completely starting to l

Re: Question about learning Python

2022-09-07 Thread Sandro Volery
Hey Maruf > I want to start learning python. Good for you! Fun times ahead. > Is learning C essential or not for learning python? No, I would not say that learning C is essential for learning Python. However, C can serve as a great set of fundamentials in programming and understanding machines

Re: Question about building Python-3.9.12 on OpenBSD 7.1

2022-06-03 Thread Tim Brazil
Thanks for the response HTH. Your comment led me to think that perhaps a "ports" dependency failed to be generated correctly. They are patched on the fly. I went back to "scratch" on fresh installation with a clean Python build. This time it worked correctly. Go figure... thx! - Tim Dan Stromber

Re: Question about building Python-3.9.12 on OpenBSD 7.1

2022-06-02 Thread Dan Stromberg
It's been my understanding that there is a fundamental difference between the *BSD's and the Linuxes. The *BSD's have their ports system, that collects deltas against third-party packages to build them on a *BSD. These deltas become part of the ports system. The Linuxes port an application, and

Re: Question again

2021-09-18 Thread Michael F. Stemper
On 16/09/2021 19.11, Alan Gauld wrote: On 16/09/2021 06:50, af kh wrote: Hello, I was doing some coding on a website called replit I have no idea what that is but... after answering 'no' or 'yes' after the last sentence I wrote, the Python window shut off, That's what you told it to do in

Re: Question again

2021-09-16 Thread dn via Python-list
y that they are done and then no more messages! > -Original Message- > From: Python-list On > Behalf Of Alan Gauld via Python-list > Sent: Thursday, September 16, 2021 8:11 PM > To: python-list@python.org > Subject: Re: Question again > > On 16/09/2021 06:50, af kh

RE: Question again

2021-09-16 Thread Avi Gross via Python-list
- From: Python-list On Behalf Of Alan Gauld via Python-list Sent: Thursday, September 16, 2021 8:11 PM To: python-list@python.org Subject: Re: Question again On 16/09/2021 06:50, af kh wrote: > Hello, > I was doing some coding on a website called replit I have no idea what that

Re: Question again

2021-09-16 Thread Alan Gauld via Python-list
On 16/09/2021 06:50, af kh wrote: > Hello, > I was doing some coding on a website called replit I have no idea what that is but... > after answering 'no' or 'yes' after the last sentence I wrote, > the Python window shut off, That's what you told it to do in the code. Regardless of which answe

Re: Question again

2021-09-16 Thread DFS
On 9/16/2021 1:50 AM, af kh wrote: Hello, I was doing some coding on a website called replit then I extracted the file, and opened it in Python. For some reason, after answering 'no' or 'yes' after the last sentence I wrote, the Python window shut off, in replit I added one more sentence, but

Re: question on trax

2021-08-18 Thread Greg Ewing
On 19/08/21 3:59 am, joseph pareti wrote: Another question is on this line: z = add((x, y)) If I code: z = add(x, y) Then the following exception occurs : *Expected input to be a tuple or list; instead got .* What exactly is your question? Does add((x, y)) not do what you want? If not, you'll

Re: question on trax

2021-08-18 Thread Dennis Lee Bieber
On Tue, 17 Aug 2021 17:50:59 +0200, joseph pareti declaimed the following: >In the following code, where does tl.Fn come from? i see it nowhere in the >documents, i.e I was looking for trax.layers.Fn : "layers" imports a whole slew of sub modules using from xxx import * i

Re: question on trax

2021-08-18 Thread joseph pareti
yes, but I do not see Fn anywhere. Another question is on this line: z = add((x, y)) If I code: z = add(x, y) Then the following exception occurs : *Expected input to be a tuple or list; instead got .* Am Di., 17. Aug. 2021 um 19:21 Uhr schrieb MRAB : > On 2021-08-17 16:50, joseph pareti wrote

Re: question on trax

2021-08-17 Thread MRAB
On 2021-08-17 16:50, joseph pareti wrote: In the following code, where does tl.Fn come from? i see it nowhere in the documents, i.e I was looking for trax.layers.Fn : import numpy as np *from trax import layers as tl* from trax import shapes from trax import fastmath # def Addition(): layer

RE: Question for potential python development contributions on Windows

2021-05-24 Thread pjfarley3
> -Original Message- > From: Terry Reedy > Sent: Sunday, May 23, 2021 10:05 PM > To: python-list@python.org > Subject: Re: Question for potential python development contributions on > Windows > I am pretty sure that VS2019 output is binary compatible with with out

Re: Question for potential python development contributions on Windows

2021-05-24 Thread Terry Reedy
On 5/23/2021 10:05 PM, Terry Reedy wrote: On 5/23/2021 12:20 PM, pjfarl...@earthlink.net wrote: I asked this question on python-dev last week but did not get an answer.  If anyone here know the answer I would appreciate it. The Python Developers Guide specifically states to get VS2017 for dev

Re: Question for potential python development contributions on Windows

2021-05-23 Thread Terry Reedy
On 5/23/2021 12:20 PM, pjfarl...@earthlink.net wrote: I asked this question on python-dev last week but did not get an answer. If anyone here know the answer I would appreciate it. The Python Developers Guide specifically states to get VS2017 for developing or enhancing python on a Windows syst

Re: question about basics of creating a PROXY to MONITOR network activity

2021-04-10 Thread Paul Bryan
Cloudflare operates as a reverse proxy in front of your service(s); clients of your services access them through an endpoint that Cloudflare stands up. DNS records point to Cloudflare, and TLS certificates must be provisioned in Cloudflare to match. For all intents and purposes, you would be outsou

Re: question about basics of creating a PROXY to MONITOR network activity

2021-04-10 Thread Christian Seberino
> > > a) your reverse proxy must be colocated with the service it fronts on the > same machine; > b) your network infrastructure transparently encrypts traffic between your > proxy and the service; or > c) your proxy must negotiate its own TLS connection(s) with the service. > Paul Thanks. I'm cu

Re: question about basics of creating a PROXY to MONITOR network activity

2021-04-10 Thread Michael Torrie
On 4/10/21 8:52 AM, cseb...@gmail.com wrote: > >> Is it even possible to be secure in that way? This is, by definition, >> a MITM, and in order to be useful, it *will* have to decrypt >> everything. So if someone compromises the monitor, they get >> everything. > > Chris > > I hear all your

Re: question about basics of creating a PROXY to MONITOR network activity

2021-04-10 Thread Paul Bryan
There is absolutely nothing wrong with building your own reverse proxy in front of your own service, as long as you control both. This constitutes a tiered network/application architecture, and it's a common practice. There's no man in the middle; there's no imposter; its all "you".  If your proxy

Re: question about basics of creating a PROXY to MONITOR network activity

2021-04-10 Thread cseb...@gmail.com
> Is it even possible to be secure in that way? This is, by definition, > a MITM, and in order to be useful, it *will* have to decrypt > everything. So if someone compromises the monitor, they get > everything. Chris I hear all your security concerns and I'm aware of them. I *really* don't

Re: question about basics of creating a PROXY to MONITOR network activity

2021-04-08 Thread Chris Angelico
On Fri, Apr 9, 2021 at 12:42 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2021-04-09 at 00:17:59 +1000, > Chris Angelico wrote: > > > Also, you'd better be really REALLY sure that your monitoring is > > legal, ethical, and not deceptive. > > Not to mention *secure*. Your monitor increase

Re: question about basics of creating a PROXY to MONITOR network activity

2021-04-08 Thread 2QdxY4RzWzUUiLuE
On 2021-04-09 at 00:17:59 +1000, Chris Angelico wrote: > Also, you'd better be really REALLY sure that your monitoring is > legal, ethical, and not deceptive. Not to mention *secure*. Your monitor increases the attack surface of the system as a whole. If I break into your monitor, can I recove

Re: question about basics of creating a PROXY to MONITOR network activity

2021-04-08 Thread Chris Angelico
On Fri, Apr 9, 2021 at 12:11 AM cseb...@gmail.com wrote: > > I'm trying to create an application that stands in between all > connections to a remote server to monitor behavior for > security and compliance reasons. > > I'm guessing I'll have all users log into this middle man proxy > application

Re: Question about generators

2021-03-05 Thread Frank Millman
On 2021-03-06 8:21 AM, Frank Millman wrote: Hi all This is purely academic, but I would like to understand the following - >>> >>> a = [('x', 'y')] >>> >>> s = [] >>> for b, c in a: ...   s.append((b, c)) ... >>> s [('x', 'y')] This is what I expected. >>> >>> s = [] >>> s.append(((

Re: Question about generators

2021-03-05 Thread Ming
On Sat, Mar 06, 2021 at 08:21:47AM +0200, Frank Millman wrote: > [...] > I understand the concept that a generator does not return a value until you > call next() on it, but I have not grasped the essential difference between > the above two constructions. > > TIA for any insights. > > Frank Mill

Re: Question about generators

2021-03-05 Thread Alan Bawden
>>> >>> s = [] >>> s.append(((b, c) for b, c in a)) >>> s [ at 0x019FC3F863C0>] >>> TIA for any insights. Replace "append" above with "extend" and observe the results. Then ponder the difference between append and extend. I suspect that the heart of your confusion actua

Re: Question - problem downloading Python

2021-01-14 Thread Barry Scott
> On 14 Jan 2021, at 06:52, christine tiscareno wrote: > > I installed in my lap-top your latest version of Python (3.9.1), yet when I > go to cmd.exe to check, I get that I have Python 22.7.17 ??? > > Why? What should I do to get the latest version? > > I tried going back to fix problem

Re: Question - problem downloading Python

2021-01-14 Thread vincent . vandevyvre
On 14/01/21 07:52, Christine Tiscareno wrote: >I installed in my lap-top your latest version of Python (3.9.1), yet when I >go to cmd.exe to check, I get that I have Python 22.7.17 ??? > >Why? What should I do to get the latest version? > I tried going back to fix problems and it does not fix

Re: Question on ABC classes

2020-10-29 Thread Chris Angelico
On Fri, Oct 30, 2020 at 5:16 PM Julio Di Egidio wrote: > Not to mention, from the point of view of formal verification, > this is the corresponding annotated version, and it is in fact > worse than useless: > > def abs(x: Any) -> Any: > ...some code here... > Useless because, in the absence of

Re: Question on ABC classes

2020-10-29 Thread Julio Di Egidio
On Friday, 30 October 2020 05:09:34 UTC+1, Chris Angelico wrote: > On Fri, Oct 30, 2020 at 1:06 PM Julio Di Egidio wrote: > > On Sunday, 25 October 2020 20:55:26 UTC+1, Peter J. Holzer wrote: > > > I think you are trying to use Python in a way contrary to its nature. > > > Python is a dynamicall

Re: Question on ABC classes

2020-10-29 Thread Chris Angelico
On Fri, Oct 30, 2020 at 1:06 PM Julio Di Egidio wrote: > > On Sunday, 25 October 2020 20:55:26 UTC+1, Peter J. Holzer wrote: > > I think you are trying to use Python in a way contrary to its nature. > > Python is a dynamically typed language. Its variables don't have types, > > only its objects.

Re: Question on ABC classes

2020-10-29 Thread Julio Di Egidio
On Sunday, 25 October 2020 20:55:26 UTC+1, Peter J. Holzer wrote: > On 2020-10-22 23:35:21 -0700, Julio Di Egidio wrote: > > On Friday, 23 October 2020 07:36:39 UTC+2, Greg Ewing wrote: > > > On 23/10/20 2:13 pm, Julio Di Egidio wrote: > > > > I am now thinking whether I could achieve the "standa

Re: Question on ABC classes

2020-10-26 Thread Dieter Maurer
Peter J. Holzer wrote at 2020-10-25 20:48 +0100: >On 2020-10-22 23:35:21 -0700, Julio Di Egidio wrote: > ... >> and the whole lot, indeed why even subclass ABC? You often have the case that a base class can implement a lot of functionality based on a few methods defined by derived classes. An exa

Re: Question on ABC classes

2020-10-25 Thread Peter J. Holzer
On 2020-10-22 23:35:21 -0700, Julio Di Egidio wrote: > On Friday, 23 October 2020 07:36:39 UTC+2, Greg Ewing wrote: > > On 23/10/20 2:13 pm, Julio Di Egidio wrote: > > > I am now thinking whether I could achieve the "standard" > > > behaviour via another approach, say with decorators, somehow > >

RE: Question on ABC classes

2020-10-23 Thread Schachner, Joseph
I'm a C++ programmer and Python programmer as well. Python classes are not exactly like C++ classes. If you define a class where every method has an implementation, then it really isn't abstract. It can be instantiated. You can force it to be abstract by doing from abc import ABCMeta and dec

Re: Question on ABC classes

2020-10-22 Thread Julio Di Egidio
On Friday, 23 October 2020 07:36:39 UTC+2, Greg Ewing wrote: > On 23/10/20 2:13 pm, Julio Di Egidio wrote: > > I am now thinking whether I could achieve the "standard" > > behaviour via another approach, say with decorators, somehow > > intercepting calls to __new__... maybe. > > I'm inclined to

Re: Question on ABC classes

2020-10-22 Thread Greg Ewing
On 23/10/20 2:13 pm, Julio Di Egidio wrote: I am now thinking whether I could achieve the "standard" behaviour via another approach, say with decorators, somehow intercepting calls to __new__... maybe. I'm inclined to step back and ask -- why do you care about this? Would it actually do any ha

Re: Question on ABC classes

2020-10-22 Thread Julio Di Egidio
On Thursday, 22 October 2020 23:04:25 UTC+2, Ethan Furman wrote: > On 10/22/20 9:25 AM, Julio Di Egidio wrote: > > > Now, I do read in the docs that that is as intended, > > but I am not understanding the rationale of it: why > > only if there are abstract methods defined in an ABC > > class is i

Re: Question on ABC classes

2020-10-22 Thread Ethan Furman
On 10/22/20 9:25 AM, Julio Di Egidio wrote: Now, I do read in the docs that that is as intended, but I am not understanding the rationale of it: why only if there are abstract methods defined in an ABC class is instantiation disallowed? IOW, why isn't subclassing from ABC enough? Let's say yo

Re: Question on ABC classes

2020-10-22 Thread Marco Sulla
On Thu, 22 Oct 2020 at 22:09, Marco Sulla wrote: > Not sure because I never tried or needed, but if no @abstractsomething in > A is defined and your B class is a subclass of A, B should be an abstract > class, not a concrete class. > Now I'm sure: >>> from abc import ABC, abstractmethod >>> cla

Re: Question on ABC classes

2020-10-22 Thread Marco Sulla
On Thu, 22 Oct 2020 at 18:31, Julio Di Egidio wrote: > why > only if there are abstract methods defined in an ABC > class is instantiation disallowed? > Not sure because I never tried or needed, but if no @abstractsomething in A is defined and your B class is a subclass of A, B should be an abst

Re: Question from a "java background" developer

2020-09-22 Thread David Lowry-Duda
On Tue, Sep 22, 2020 at 11:13:50AM +0200, Agnese Camellini wrote: > I mean do i have a keyword to obtain all the methods and the > attributes of > a class in python? In addition to the `dir()` that others have mentioned, I'll add that developing interactively is very common, especially in ipytho

Re: Question from a "java background" developer

2020-09-22 Thread Dieter Maurer
Chris Angelico wrote at 2020-9-22 19:25 +1000: >On Tue, Sep 22, 2020 at 7:15 PM Agnese Camellini > wrote: >> >> Hello to everyone, I have a question. I come from a Java background and I >> would like to develop in python but i'm wondering: is there anything, in >> python, like Java "reflection"? >>

Re: Question from a "java background" developer

2020-09-22 Thread Mats Wichmann
On 9/22/20 3:25 AM, Chris Angelico wrote: > On Tue, Sep 22, 2020 at 7:15 PM Agnese Camellini > wrote: >> >> Hello to everyone, I have a question. I come from a Java background and I >> would like to develop in python but i'm wondering: is there anything, in >> python, like Java "reflection"? >> I

Re: Question from a "java background" developer

2020-09-22 Thread Chris Angelico
On Tue, Sep 22, 2020 at 7:15 PM Agnese Camellini wrote: > > Hello to everyone, I have a question. I come from a Java background and I > would like to develop in python but i'm wondering: is there anything, in > python, like Java "reflection"? > I mean do i have a keyword to obtain all the methods

Re: question about making an App for Android

2019-10-15 Thread Cousin Stanley
Cousin Stanley wrote: > There is also a useful python package > called sunset which I fouund a reference to > on stackoverflow Maybe I'll wake up some time today :-) The python package is called suntime not sunset # pip3 show suntime -- Stanley C. Kitching Human Being Ph

Re: question about making an App for Android

2019-10-15 Thread Cousin Stanley
Cousin Stanley wrote: > > d_sse = sse_sunset - sse_sunrise # seconds of daylight > I think it might be required to convert utc time to local time for the difference in sunrise and sunset times to make sense in local time -- Stanley C. Kitching Human Being Phoenix, A

Re: question about making an App for Android

2019-10-15 Thread Cousin Stanley
Chris Angelico wrote: > Or maybe it's really simple, because there's an HTTP API >that > gives you the information. > > There's an API for everything these days. > > A quick web search showed up this: > > https://sunrise-sunset.org/api > There is also a useful python package c

Re: question about making an App for Android

2019-10-12 Thread pyotr filipivich
Dennis Lee Bieber on Sat, 12 Oct 2019 12:26:43 -0400 typed in comp.lang.python the following: >On Fri, 11 Oct 2019 20:41:47 -0700, pyotr filipivich >declaimed the following: > > >> I've been hacking around with what needs to be computed. As in >>"okay,the orbits have different speed at dif

Re: question about making an App for Android

2019-10-11 Thread pyotr filipivich
Dennis Lee Bieber on Fri, 11 Oct 2019 20:05:03 -0400 typed in comp.lang.python the following: > >* To support my practically unused 8" SCT {especially in cloudy Michigan}{I >also need to find some sort of battery holders that will fit the fork arms >-- the originals have cracked at the ends and d

Re: question about making an App for Android

2019-10-11 Thread Eli the Bearded
In comp.lang.python, Dennis Lee Bieber wrote: > pyotr filipivich declaimed the following: >> "A simple program" to divide the amount of "today's" daylight into 12 >> even '"hours", so that Dawn begins the First hour, the third hour is >> mid-morning, noon is the middle of the day, the ninth hour

Re: question about making an App for Android

2019-10-11 Thread Akkana Peck
> pyotr filipivich > >"A simple program" to divide the amount of "today's" daylight into 12 > >even '"hours", so that Dawn begins the First hour, the third hour is > >mid-morning, noon is the middle of the day, the ninth hour mid after > >noon, and the twelfth hour ends at sunset. Is simple, no?

Re: question about making an App for Android

2019-10-11 Thread pyotr filipivich
Chris Angelico on Fri, 11 Oct 2019 10:43:53 +1100 typed in comp.lang.python the following: >On Fri, Oct 11, 2019 at 10:40 AM pyotr filipivich wrote: >> Chris Angelico on Fri, 11 Oct 2019 09:49:03 +1100 >> typed in comp.lang.python the following: >> >On Fri, Oct 11, 2019 at 9:41 AM Dennis Lee B

Re: question about making an App for Android

2019-10-10 Thread Chris Angelico
On Fri, Oct 11, 2019 at 10:40 AM pyotr filipivich wrote: > > Chris Angelico on Fri, 11 Oct 2019 09:49:03 +1100 > typed in comp.lang.python the following: > >On Fri, Oct 11, 2019 at 9:41 AM Dennis Lee Bieber > >wrote: > >> > >> On Thu, 10 Oct 2019 08:47:07 -0700, pyotr filipivich > >> declaime

Re: question about making an App for Android

2019-10-10 Thread pyotr filipivich
Chris Angelico on Fri, 11 Oct 2019 09:49:03 +1100 typed in comp.lang.python the following: >On Fri, Oct 11, 2019 at 9:41 AM Dennis Lee Bieber >wrote: >> >> On Thu, 10 Oct 2019 08:47:07 -0700, pyotr filipivich >> declaimed the following: >> >"A simple program" to divide the amount of "today's"

Re: question about making an App for Android

2019-10-10 Thread pyotr filipivich
Dennis Lee Bieber on Thu, 10 Oct 2019 18:39:55 -0400 typed in comp.lang.python the following: >On Thu, 10 Oct 2019 08:47:07 -0700, pyotr filipivich >declaimed the following: > > >>"A simple program" to divide the amount of "today's" daylight into 12 >>even '"hours", so that Dawn begins the First

Re: question about making an App for Android

2019-10-10 Thread Chris Angelico
On Fri, Oct 11, 2019 at 9:41 AM Dennis Lee Bieber wrote: > > On Thu, 10 Oct 2019 08:47:07 -0700, pyotr filipivich > declaimed the following: > > > >"A simple program" to divide the amount of "today's" daylight into 12 > >even '"hours", so that Dawn begins the First hour, the third hour is > >mid-

Re: question about making an App for Android

2019-10-10 Thread Michael Torrie
On 10/10/19 9:47 AM, pyotr filipivich wrote: > What I want is a "simple" program to calculate and display the > "natural time", and do so on my phone. > > "A simple program" to divide the amount of "today's" daylight into 12 > even '"hours", so that Dawn begins the First hour, the third hour is >

Re: question about making an App for Android

2019-10-10 Thread Terry Reedy
On 10/10/2019 11:47 AM, pyotr filipivich wrote: What I want is a "simple" program to calculate and display the "natural time", and do so on my phone. "A simple program" to divide the amount of "today's" daylight into 12 even '"hours", so that Dawn begins the First hour, the third hour is mid-mor

Re: Question :)

2019-05-13 Thread dieter
Milos Vujcic writes: > I am new into Python and Django thing and I am having big problem with cmd > and virtualenv command. For many users, "virtualenv" solves an important problem: it gives them a (virtual) Python installation under their control. There, they can install their own (Python) pac

Re: Question :)

2019-05-13 Thread אורי
You can also subscribe to django-us...@googlegroups.com and ask there. I recommend using Python 3 and at least 3.6 or later. Django, you can start with the current version (2.2). אורי u...@speedy.net On Mon, May 13, 2019 at 3:33 PM Milos Vujcic wrote: > Hi, > I’m new into Python and Django thi

Re: Question :)

2019-05-13 Thread Joel Goldstick
On Mon, May 13, 2019 at 8:33 AM Milos Vujcic wrote: > > Hi, > I’m new into Python and Django thing and I’m having big problem with cmd and > virtualenv command. Do I really need to use virtual environment for making > Django/Python web apps because my cmd just won’t accept it. Can I skip > vi

Re: Question regarding the __kwdefaults__ output being None

2019-04-19 Thread Arup Rakshit
Hi Peter, Thanks for explaining it. Beautiful. Thanks, Arup Rakshit a...@zeit.io > On 19-Apr-2019, at 5:53 PM, Peter Otten <__pete...@web.de> wrote: > > Arup Rakshit wrote: > >> I have a very basic function. >> >> def greet(name, msg = "Good morning!"): >> """ >> This function greets

Re: Question regarding the __kwdefaults__ output being None

2019-04-19 Thread Peter Otten
Arup Rakshit wrote: > I have a very basic function. > > def greet(name, msg = "Good morning!"): >""" >This function greets to >the person with the >provided message. > >If message is not provided, >it defaults to "Good >morning!" >""" > >print("Hello",name +

Re: Question about the @staticmethod decorator

2019-03-18 Thread Terry Reedy
On 3/17/2019 2:15 PM, Arup Rakshit wrote: I am reading a book where the author says that: In principle, it would also be possible to implement any @staticmethod completely outside of the class at module scope without any loss of functionality — so you may want to consider carefully whether a p

Re: Question about the @staticmethod decorator

2019-03-17 Thread Cameron Simpson
On 17Mar2019 20:24, Paul Moore wrote: On Sun, 17 Mar 2019 at 18:18, Arup Rakshit wrote: I am reading a book where the author says that: In principle, it would also be possible to implement any @staticmethod completely outside of the class at module scope without any loss of functionality —

Re: Question about the @staticmethod decorator

2019-03-17 Thread Paul Moore
On Sun, 17 Mar 2019 at 18:18, Arup Rakshit wrote: > > I am reading a book where the author says that: > > In principle, it would also be possible to implement any @staticmethod > completely outside of the class at module scope without any loss of > functionality — so you may want to consider car

Re: Question regarding the local function object

2019-03-16 Thread Gregory Ewing
Terry Reedy wrote: I believe that CPython function objects must currently all have the same size or at least the same max size and conclude that CPython currently allocates them from a block of memory that is some multiple of that size. I wouldn't be surprised if there is a free list for func

Re: Question regarding the local function object

2019-03-15 Thread Terry Reedy
On 3/15/2019 8:47 AM, Arup Rakshit wrote: Hi, I am reading a book where it says that: Just like module-level function definitions, the definition of a local function happens at run time when the def keyword is executed. Interestingly, this means that each call to sort_by_last_letter results i

Re: Question regarding the local function object

2019-03-15 Thread Arup Rakshit
Nice explanation. Thank you very much. Thanks, Arup Rakshit a...@zeit.io > On 15-Mar-2019, at 6:24 PM, Calvin Spealman wrote: > > This is actually part of a not entirely uncommon misconception that can arise > by comparing objects only by their > repr() outputs (the string representatio

Re: Question regarding the local function object

2019-03-15 Thread Calvin Spealman
This is actually part of a not entirely uncommon misconception that can arise by comparing objects only by their repr() outputs (the string representation created when you pass them to print). You're comparing the ID or memory address of the objects and determining they must be the same object. In

Re: Question about slight deviations when using integer division with large integers.

2018-12-31 Thread Christian Seberino
Thanks to all who helped. As was previously pointed out, many other languages use truncation rather than rounding for // division. Getting the behavior you want may be as easy as replacing // with the int() function >>> x = 9 ; y = 2 >>> x // y, -x // y, (-x) // y (4, -5, -5) >>> int(x /

Re: Question about slight deviations when using integer division with large integers.

2018-12-31 Thread Paul Moore
On Mon, 31 Dec 2018 at 09:00, Christian Seberino wrote: > > Thanks. I didn’t post new code. I was just referring back to original > post. I need to duplicate the exact behavior of Java’s BigIntegers. > > I’m guessing difference between Java and Python is that Java BigIntegers do > not switch to

Re: Question about slight deviations when using integer division with large integers.

2018-12-31 Thread Cameron Simpson
On 30Dec2018 23:33, Christian Seberino wrote: Thanks. I didn’t post new code. I was just referring back to original post. I think Ian looked up the first post on Google Groups, where your code was evident. The message was incomplete when it got here (the mailing list); I don't know why.

Re: Question about slight deviations when using integer division with large integers.

2018-12-31 Thread Christian Seberino
Thanks. I didn’t post new code. I was just referring back to original post. I need to duplicate the exact behavior of Java’s BigIntegers. I’m guessing difference between Java and Python is that Java BigIntegers do not switch to floor for negatives. Possible to tweak rounding of Python to be li

Re: Question about slight deviations when using integer division with large integers.

2018-12-30 Thread Ian Kelly
On Sun, Dec 30, 2018 at 10:18 PM Christian Seberino wrote: > > What is simplest way to make both those > prints give same values? Any slicker way > than an if statement? Stack Overflow has a few suggestions: https://stackoverflow.com/questions/19919387/in-python-what-is-a-good-way-to-round-towar

Re: Question about slight deviations when using integer division with large integers.

2018-12-30 Thread Chris Angelico
On Mon, Dec 31, 2018 at 6:36 PM Ian Kelly wrote: > > The Google group has an initial post in this thread that didn't make it > through to the mailing list for whatever reason. For posterity, here > it is: Thanks Ian. > > Why are the following two similar prints slightly different and how fix? >

Re: Question about slight deviations when using integer division with large integers.

2018-12-30 Thread Ian Kelly
On Sun, Dec 30, 2018 at 10:27 PM Cameron Simpson wrote: > > On 30Dec2018 21:14, Christian Seberino wrote: > >What is simplest way to make both those > >prints give same values? Any slicker way > >than an if statement? > > If your post had an attachment, be aware that the python-list list drops >

Re: Question about slight deviations when using integer division with large integers.

2018-12-30 Thread Cameron Simpson
On 30Dec2018 21:14, Christian Seberino wrote: What is simplest way to make both those prints give same values? Any slicker way than an if statement? If your post had an attachment, be aware that the python-list list drops all attachments - it is a text only list. Please paste your code dire

Re: Question about slight deviations when using integer division with large integers.

2018-12-30 Thread Christian Seberino
What is simplest way to make both those prints give same values? Any slicker way than an if statement? -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about slight deviations when using integer division with large integers.

2018-12-30 Thread Chris Angelico
On Mon, Dec 31, 2018 at 1:56 PM Christian Seberino wrote: > > Perhaps the "secret" is *not* do integer division with negative numbers? I have no idea what you're replying to, but integer division with negative numbers IS well defined. Python will floor - it will always round down. ChrisA -- htt

Re: Question about slight deviations when using integer division with large integers.

2018-12-30 Thread Christian Seberino
Perhaps the "secret" is *not* do integer division with negative numbers? -- https://mail.python.org/mailman/listinfo/python-list

Re: Question on difference between LambdaType and FunctionType

2018-11-27 Thread Iwo Herka
Ian Kelly wrote: > What about: > > __init__ = lambda self: setattr(self, 'foo', 'bar') That's an edge-case alright. Fortunately, I've decided to not skip lambdas. That's too problematic, it's easier to parse them as a special-case. Thanks for pointing this out. Sincerely, Iwo Herka -- https

Re: Question on difference between LambdaType and FunctionType

2018-11-26 Thread Ian Kelly
On Sun, Nov 25, 2018 at 2:00 PM Chris Angelico wrote: > > On Mon, Nov 26, 2018 at 7:55 AM Iwo Herka wrote: > > > > > class Foo: > > >def setup(self): ... > > >__init__ = lambda self: self.setup() > > > > Sorry, didn't address this. This is fine too, since I'm assuming that > > only method

Re: Question on difference between LambdaType and FunctionType

2018-11-25 Thread Iwo Herka
Chris Angelico wrote: > look for a STORE_ATTR opcode. If there aren't any, there can't > be any "self.foo = bar". (You can't be certain of the converse, as > "other_object.foo = bar" will also show up as STORE_ATTR.) This very useful, I will look into it, thanks. Sincerely, Iwo Herka -- https:/

Re: Question on difference between LambdaType and FunctionType

2018-11-25 Thread Chris Angelico
On Mon, Nov 26, 2018 at 7:56 AM Chris Angelico wrote: > > On Mon, Nov 26, 2018 at 7:55 AM Iwo Herka wrote: > > > > > class Foo: > > >def setup(self): ... > > >__init__ = lambda self: self.setup() > > > > Sorry, didn't address this. This is fine too, since I'm assuming that > > only method

Re: Question on difference between LambdaType and FunctionType

2018-11-25 Thread Chris Angelico
On Mon, Nov 26, 2018 at 7:52 AM Iwo Herka wrote: > > > Why are lambda functions not instrumented? > > Because, if I didn't forget about anything, assignment > in lambdas is invalid. That is, > > lambda self. self.x = 1 > > or > > lambda self: (self.x = 1) > > will throw SyntaxError. Ther

Re: Question on difference between LambdaType and FunctionType

2018-11-25 Thread Iwo Herka
> class Foo: >def setup(self): ... >__init__ = lambda self: self.setup() Sorry, didn't address this. This is fine too, since I'm assuming that only methods named __init__ are allowed to mutate the object. Because 'setup' is not '__init__' it's disqualified. Sincerely, Iwo Herka -- https:

Re: Question on difference between LambdaType and FunctionType

2018-11-25 Thread Chris Angelico
On Mon, Nov 26, 2018 at 7:55 AM Iwo Herka wrote: > > > class Foo: > >def setup(self): ... > >__init__ = lambda self: self.setup() > > Sorry, didn't address this. This is fine too, since I'm assuming that > only methods named __init__ are allowed to mutate the object. > Because 'setup' is n

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