Solution Manuals and Testbanks 2017-2018

2017-10-02 Thread ranasaad935
Do u have testbanks for ??? THE LAW OF WORK: INDUSTRIAL RELATIONS AND COLLECTIVE BARGAINING Author(s): David J. Doorey ISBN: 978-1-77255-166-2 Publisher:Emond Publishing -- https://mail.python.org/mailman/listinfo/python-list

Re: newb question about @property

2017-10-02 Thread Bill
Bill wrote: Chris Angelico wrote: Decorators are fairly straight-forward if you understand higher-order functions. ChrisA I was just minding my own business, and thought to write my first decorator for a simple *recursive* function f. The decorator WORKS if f does not make a call to its

Re: INSTRUCTOR SOLUTIONS MANUAL Linear Systems And Signals 2nd ED by B P Lathi

2017-10-02 Thread Steve D'Aprano
On Tue, 3 Oct 2017 12:54 pm, mosama221...@gmail.com wrote: > i need instructor of second edition of linear system and signals by lathi Don't reply to spammers and don't reply to them. They are the scum of the earth. They are literally criminals, they use computer viruses and malware to hijack pe

Re: newb question about @property

2017-10-02 Thread Chris Angelico
On Tue, Oct 3, 2017 at 2:39 PM, Bill wrote: > Chris Angelico wrote: >> >> Decorators are fairly straight-forward if you understand higher-order >> functions. >> >> ChrisA > > > > I was just minding my own business, and thought to write my first decorator > for a simple *recursive* function f. T

Re: newb question about @property

2017-10-02 Thread Bill
Chris Angelico wrote: Decorators are fairly straight-forward if you understand higher-order functions. ChrisA I was just minding my own business, and thought to write my first decorator for a simple *recursive* function f. The decorator WORKS if f does not make a call to itself.Other

Re: INSTRUCTOR SOLUTIONS MANUAL Linear Systems And Signals 2nd ED by B P Lathi

2017-10-02 Thread mosama221122
i need instructor of second edition of linear system and signals by lathi -- https://mail.python.org/mailman/listinfo/python-list

Re: newb question about @property

2017-10-02 Thread Bill
Steve D'Aprano wrote: There's no need to set the radius and the diameter, as one is completely derived from the other Good point; I'm glad I submitted my code for grading. Sort of a "trick question" to ask me to add diameter and then take off points because I used it! ; ) Bill

Re: newb question about @property

2017-10-02 Thread Steve D'Aprano
On Tue, 3 Oct 2017 06:32 am, Bill wrote: > Steve D'Aprano wrote: >> Circle didn't use any setters, but I could have let you set the >> diameter, which in >> turn would set the radius: >> >> circle.radius = 2 >> assert circle.diameter == 4 >> circle.diameter == 2 # requires a setter >> assert circ

Re: newb question about @property

2017-10-02 Thread Ian Kelly
On Mon, Oct 2, 2017 at 1:32 PM, Bill wrote: > @property def circumference(self): > return 2 * math.pi *self.radius Of course the *proper* formula here is just math.tau * self.radius. -- https://mail.python.org/mailman/listinfo/python-list

Re: newb question about @property

2017-10-02 Thread Chris Angelico
On Tue, Oct 3, 2017 at 6:51 AM, Bill wrote: > Can you inspire me with a good decorator problem (standard homework > exercise-level will be fine)? Otherwise I will go create one which will > prints a row of asterisks before and after the call to the original function > (which I think I should do)

Re: newb question about @property

2017-10-02 Thread Bill
Chris Angelico wrote: On Tue, Oct 3, 2017 at 6:23 AM, Larry Hudson via Python-list wrote: On 10/01/2017 03:52 PM, Bill wrote: Steve D'Aprano wrote: The definitive explanation of descriptors is here: https://docs.python.org/3/howto/descriptor.html Thank you! It is next on my list. Then I'

Re: newb question about @property

2017-10-02 Thread Bill
Steve D'Aprano wrote: Circle didn't use any setters, but I could have let you set the diameter, which in turn would set the radius: circle.radius = 2 assert circle.diameter == 4 circle.diameter == 2 # requires a setter assert circle.radius == 1 Getting that to work is left as an exercise :-)

Re: newb question about @property

2017-10-02 Thread Chris Angelico
On Tue, Oct 3, 2017 at 6:23 AM, Larry Hudson via Python-list wrote: > On 10/01/2017 03:52 PM, Bill wrote: >> >> Steve D'Aprano wrote: >>> >>> The definitive explanation of descriptors is here: >>> https://docs.python.org/3/howto/descriptor.html >> >> >> Thank you! It is next on my list. Then I'

Re: newb question about @property

2017-10-02 Thread Larry Hudson via Python-list
On 10/01/2017 03:52 PM, Bill wrote: Steve D'Aprano wrote: The definitive explanation of descriptors is here: https://docs.python.org/3/howto/descriptor.html Thank you!  It is next on my list.   Then I'll try that Circle problem you mentioned as an exercise last night!  I don't expect run into

Re: style: single and multiple lines

2017-10-02 Thread Rhodri James
On 02/10/17 17:00, Stefan Ram wrote: My copy of pep 8 (from 2016) says: Yes: def f(x): return 2*x . So this single-line style should not be that bad. However, I remember someone saying that the multiline style is more phytonic? So, is this better: def f(x): return 2*x

Re: on a very slow function

2017-10-02 Thread Daniel Bastos
Ben Bacarisse writes: > Daniel Bastos writes: > >> def make_sequence_non_recursive(N, x0 = 2, c = -1): >> "What's wrong with this function? It's very slow." >> last = x0 >> def sequence(): >> nonlocal last >> next = last >> last = last**2 + c >> return next % N >> return

Re: on a very slow function

2017-10-02 Thread Daniel Bastos
Chris Angelico writes: [...] > Maybe "linear_congruential" would be a good name for the function? I > don't know. Sounds good to me --- in absence of a smaller name. > Anyhow, the basic memoization technique should help you some. It did! Thanks so much to you and to everyone who contributed

Re: on a very slow function

2017-10-02 Thread Daniel Bastos
r...@zedat.fu-berlin.de (Stefan Ram) writes: > Daniel Bastos writes: >> That function produces a function which yields the values of the >> sequence x^2 - 1 mod N > > Thats a term with two free variables. > I am not sure what the sequence is. > > And if that's > > ( x^2 - 1 )mod N That's c

Re: on a very slow function

2017-10-02 Thread Ian Kelly
On Sun, Oct 1, 2017 at 8:14 PM, Steve D'Aprano wrote: > > On Mon, 2 Oct 2017 12:00 pm, Ben Bacarisse wrote: > > > >> Better: > >> > >> last = (pow(last, 2, N) + (2 % N)) % N > > > > You meant c rather than 2, I think. > > Oops, yes, that was a typo. > > > > And I'm not convinced all the %Ns > > ar

Re: style: single and multiple lines

2017-10-02 Thread Steve D'Aprano
On Tue, 3 Oct 2017 03:00 am, Stefan Ram wrote: > My copy of pep 8 (from 2016) says: Why don't you look at the current version, which is conveniently available to anyone on the internet, for free? https://www.python.org/dev/peps/pep-0008/‎ (Last commit to the PEP was Jul 12, 2017.) > Yes:

Re: style: single and multiple lines

2017-10-02 Thread Marko Rauhamaa
r...@zedat.fu-berlin.de (Stefan Ram): > def f(x): return 2*x > > . So this single-line style should not be that bad. I very rarely allow myself to write single-line complex statements. It is usually when defining exceptions: class SyntaxError(Exception): pass if even then. > def f(x): >

Re: on a very slow function

2017-10-02 Thread bartc
On 02/10/2017 14:54, Peter Otten wrote: bartc wrote: On 02/10/2017 08:41, Peter Otten wrote: Daniel Bastos wrote: def make_sequence_non_recursive(N, x0 = 2, c = -1): "What's wrong with this function? It's very slow." last = x0 def sequence(): nonlocal last next = las

Re: Distributing multiple packages with on setup.py

2017-10-02 Thread Jimmy Thrasibule
I think I will head this direction. And with `setup.cfg `_, it is quite easy to keep the package's metadata in a standard way and feed this to setup(). Regards, Jimmy -- https://mail.python.org/ma

Re: on a very slow function

2017-10-02 Thread Peter Otten
bartc wrote: > On 02/10/2017 08:41, Peter Otten wrote: >> Daniel Bastos wrote: >> >>> def make_sequence_non_recursive(N, x0 = 2, c = -1): >>>"What's wrong with this function? It's very slow." >>>last = x0 >>>def sequence(): >>> nonlocal last >>> next = last >>> last =

Re: Distributing multiple packages with on setup.py

2017-10-02 Thread Jimmy Thrasibule
> I do this with my stuff, but instead of keeping a common setup.py I have an > elaborate and clumsy system that rolls a package or module distro on the > fly, writing a setup.py file in the process. > > So each package/module I publish has a dict names "DISTINFO" in the top > level file, looking l

Re: on a very slow function

2017-10-02 Thread Chris Angelico
On Mon, Oct 2, 2017 at 10:24 PM, bartc wrote: > On 02/10/2017 08:41, Peter Otten wrote: >> >> Daniel Bastos wrote: >> >>> def make_sequence_non_recursive(N, x0 = 2, c = -1): >>>"What's wrong with this function? It's very slow." >>>last = x0 >>>def sequence(): >>> nonlocal last >>

Re: on a very slow function

2017-10-02 Thread bartc
On 02/10/2017 08:41, Peter Otten wrote: Daniel Bastos wrote: def make_sequence_non_recursive(N, x0 = 2, c = -1): "What's wrong with this function? It's very slow." last = x0 def sequence(): nonlocal last next = last last = last**2 + c return next % N return sequ

Re: on a very slow function

2017-10-02 Thread Ben Bacarisse
Steve D'Aprano writes: > On Mon, 2 Oct 2017 12:00 pm, Ben Bacarisse wrote: > > >>> Better: >>> >>> last = (pow(last, 2, N) + (2 % N)) % N >> >> You meant c rather than 2, I think. > > Oops, yes, that was a typo. > > >> And I'm not convinced all the %Ns >> are worth while. > > They are all neces

Re: newb question about @property

2017-10-02 Thread Steve D'Aprano
On Mon, 2 Oct 2017 07:51 pm, Marko Rauhamaa wrote: > Chris Angelico : > >> On Mon, Oct 2, 2017 at 5:34 PM, Marko Rauhamaa wrote: >>> I have *seen* a semi-useful decorator in code once >>> (@contextlib.contextmanager) but still would prefer explicit dunder >>> methods. >> >> [...] I'm not sure wh

Re: on a very slow function

2017-10-02 Thread Steve D'Aprano
On Mon, 2 Oct 2017 06:41 pm, Peter Otten wrote: x = get_last() > > I'd rather not show the actual number, but > x.bit_length() > 12534884 Which is approximately 3773408 decimal digits. Using the American system of large numbers, that's approximately a duotrigintillion-duotrigintilli

Re: newb question about @property

2017-10-02 Thread Thomas Jollans
On 2017-10-02 10:51, Marko Rauhamaa wrote: > Chris Angelico : > >> On Mon, Oct 2, 2017 at 5:34 PM, Marko Rauhamaa wrote: >>> I have *seen* a semi-useful decorator in code once >>> (@contextlib.contextmanager) but still would prefer explicit dunder >>> methods. >> >> [...] I'm not sure where dunde

Re: newb question about @property

2017-10-02 Thread Marko Rauhamaa
Chris Angelico : > On Mon, Oct 2, 2017 at 5:34 PM, Marko Rauhamaa wrote: >> I have *seen* a semi-useful decorator in code once >> (@contextlib.contextmanager) but still would prefer explicit dunder >> methods. > > [...] I'm not sure where dunder methods come into this, though, as > they're comple

Re: newb question about @property

2017-10-02 Thread Steve D'Aprano
On Mon, 2 Oct 2017 05:34 pm, Marko Rauhamaa wrote: > I must say, though, I have yet to run into a need for descriptors. You've never called a method? -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.python.org/mailm

Re: on a very slow function

2017-10-02 Thread Peter Otten
Daniel Bastos wrote: > def make_sequence_non_recursive(N, x0 = 2, c = -1): > "What's wrong with this function? It's very slow." > last = x0 > def sequence(): > nonlocal last > next = last > last = last**2 + c > return next % N > return sequence > > It crawls pretty soon.

Re: newb question about @property

2017-10-02 Thread Chris Angelico
On Mon, Oct 2, 2017 at 5:34 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> Yes, that's correct. The *descriptor* protocol is what allows >> "foo.bar" to cause a function to be executed > > That mechanism allows you to expose data fields in the API. If the > implementation later changes, you can