Terry,
> Not really. The resulting global objects do not normally take enough
> space to worry about on normal modern desktops.
For some reason I still aim to keep my (running) programs as small as
possible - even though the ammount of memory has grown more than a
thousandfold since I started
DL,
> Some of this you will know. (Hopefully) some will be 'new':
Some of it is known to me, and indeed I do hope that there will be new stuff
in there too. Its why I took up Python. :-)
Thanks for the explanation (including the aliassing I wasn't aware of) and
the links.
Regards,
Rudy Wiese
Greg,
>>> Are you sure there's a difference between classes and functions here?
>>
>> Yes, quite sure.
>
> And we're even more sure that there isn't. :-)
As it turned out "we're" are right, and I was thrown off by the error
message. :-p
The problem is that I had no idea why I got that (rather e
On 9/12/19 9:15 pm, R.Wieser wrote:
To be honest, I was not aware/did not assume that I could delete a class
definition that way (I even find it a bit weird, but as I'm a newbie in
regard to Python that does not say much).
Python is very dynamic. The class statement is actually an executable
st
On 12/9/2019 2:36 AM, R.Wieser wrote:
Terry,
Standard for in-file test is
[snip]
Any reason to put the testcode in a procedure instead of just have it
directly follow the "if __name__ == '__main__' " test ?
One can, for instance, interactively do
>>> import mod
>>> mod.test()
and explore t
Python,
> Child *depends* on Parent.
I'm sorry, but without any kind of underbuilding statements like that are of
no value to me I'm afraid.
Also: if I can just copy-and-paste the class into the file which origionally
included it and have the whole program run without a problem than that
depe
Greg,
> There's nothing stopping you from subsequently rebinding that name to some
> other object, or deleting it altogether.
Which is something I did not expect. But running into is what makes doing
something new interesting. :-)
And I just realized something else: I just assumed that the "d
Hi, I have got a problem.
I wrote a code for prefix to infix. It works, but I need improve it
so on input there will be only necessary parentheses. Can u help me?
Here is the code:
import re
a = input()
class Calculator:
def __init__ (self):
self.stack = []
def push (self, p):
Hello,
I have a function with a long if/elif chain that sets a couple of
variables according to a bunch of test expressions, similar to function
branch1() below. I never liked that approach much because it is clumsy
and repetetive, and pylint thinks so as well. I've come up with two
alternati
On Mon, Dec 9, 2019 at 10:36 PM Musbur wrote:
>
> Hello,
>
> I have a function with a long if/elif chain that sets a couple of
> variables according to a bunch of test expressions, similar to function
> branch1() below. I never liked that approach much because it is clumsy
> and repetetive, and py
Musbur wrote:
> Hello,
>
> I have a function with a long if/elif chain that sets a couple of
> variables according to a bunch of test expressions, similar to function
> branch1() below. I never liked that approach much because it is clumsy
> and repetetive, and pylint thinks so as well. I've come
On 08/12/2019 18:08, alok singh wrote:
Sir,
My system is windows 7 SP1 32-bit . after installing python in my
system,when i try to launch it using command prompt then a message is
shown. I am attaching a screenshot of the following.
kindly look seriously into my problem and tell me the solution.
On 2019-12-09 12:27, Musbur wrote:
> def branch1(a, b, z):
> """Inelegant, unwieldy, and pylint complains
> about too many branches"""
> if a > 4 and b == 0:
> result = "first"
> elif len(z) < 2:
> result = "second"
> elif b + a == 10:
> result =
Le 09/12/2019 à 09:15, R.Wieser a écrit :
...
You'll find that *any* form of import executes all the top-level code.
Thats certainly something I did not expect.
How could it be otherwise? Consider a module defining two
classes: Parent and Child, Child inheriting from Parent.
if you do "from
Greg Ewing wrote:
> On 8/12/19 9:30 pm, songbird wrote:
>>wouldn't it make more sense to just go back and fix the
>> converter program than to have to manually convert all this
>> python2 code?
>
> Anything that isn't already fixed by 2to3 is probably
> somewhere between very difficult and impo
jf...@ms4.hinet.net wrote:
...
> Even string is hard to be handled by the AI:-)
>
> Quoted from https://portingguide.readthedocs.io/en/latest/strings.html
> " ... This means that you need to go through the entire codebase, and decide
> which value is what type. Unfortunately, this process generall
On Tue, Dec 10, 2019 at 5:05 AM songbird wrote:
>
> jf...@ms4.hinet.net wrote:
> ...
> > Even string is hard to be handled by the AI:-)
> >
> > Quoted from https://portingguide.readthedocs.io/en/latest/strings.html
> > " ... This means that you need to go through the entire codebase, and
> > deci
On 12/9/19 9:55 AM, songbird wrote:
jf...@ms4.hinet.net wrote:
...
Even string is hard to be handled by the AI:-)
Quoted from https://portingguide.readthedocs.io/en/latest/strings.html
" ... This means that you need to go through the entire codebase, and decide which
value is what type. Unfort
Dennis,
> "del instance" only deletes the NAME.
[snip]
Yep, I already assumed that that would happen. Just wanted to keep it
simple.
> "instance" xyz does not shadow "class" xyz... instead, the name "xyz"
> only exists in the binding to the instance.
That is what I tried to say: the name-bind
On 12/9/2019 6:21 AM, jezka...@gmail.com wrote:
Hi, I have got a problem.
Is this homework?
I wrote a code for prefix to infix. It works, but I need improve it
so on input there will be only necessary parentheses.
Define 'necessary'; give multiple input/output examples.
Put them in a test f
On 10/12/19 8:40 AM, Terry Reedy wrote:
On 12/9/2019 6:21 AM, jezka...@gmail.com wrote:
Hi, I have got a problem.
Is this homework?
Same question - that way we know that our task is to help you learn to
code in Python, cf a problem with Python itself...
Similarly, you may like to know th
It might be becoming 'long', but this discussion contains much of profit
to many people!
Us 'silver surfers' do need to periodically question those beliefs we
hold as 'tenets' of ComSc. Amongst them is RAM (or "core"!)
conservation. It remains a virtue somewhat, but at the same time,
storage
Rob Gaddi wrote:
...
> And how exactly do you propose to determine whether the constant I've
> enclosed
> in quotation marks in Python2 represents "text" or "binary data"? Not all
> text
> is words; think of SQL queries. And some words are binary data, think SCPI
> commands being sent to a s
I ran across a kind of fun problem today that I wanted to run past you Gentle
Geniuses (tm):
- Imagine an environment in which there may be multiple instances of a given
microservice written in Python.
- Each of these services needs to produce a string of ten digits guaranteed to
be unique
Chris Angelico wrote:
...
>
> Here's an example piece of code.
>
> sock = socket.socket(...)
> name = input("Enter your username: ")
> code = input("Enter the base64 code: ")
> code = base64.b64decode(code)
> sock.write("""GET /foo HTTP/1.0
> Authentication: Demo %s/%s
>
> """ % (name, code))
> mat
On Tue, Dec 10, 2019 at 12:11 PM songbird wrote:
>
> Rob Gaddi wrote:
> ...
> > And how exactly do you propose to determine whether the constant I've
> > enclosed
> > in quotation marks in Python2 represents "text" or "binary data"? Not all
> > text
> > is words; think of SQL queries. And some
On Tue, Dec 10, 2019 at 12:15 PM songbird wrote:
>
> Chris Angelico wrote:
> ...
> >
> > Here's an example piece of code.
> >
> > sock = socket.socket(...)
> > name = input("Enter your username: ")
> > code = input("Enter the base64 code: ")
> > code = base64.b64decode(code)
> > sock.write("""GET
I agree with you, so I'm going to ignore def branch2(a, b, z): and def
branch3(a, b, z) because they appear too contrived - and I guess that's
fair, in that you've contrived to satisfy pylint.
Question: are there other people/factors who/which should be regarded as
more important than the lint
I'm a novice packager, trying to test a package I built and
uploaded to TestPyPI. It has dependencies and I want to make
sure my setup.py works before uploading to the real PyPI.
https://packaging.python.org/guides/using-testpypi/
says that if a package has dependencies, to use this command to get
On Tue, 10 Dec 2019 at 12:12, Tim Daneliuk wrote:
> - Each of these services needs to produce a string of ten digits
> guaranteed to be unique
> on a per service instance basis AND to not collide for - oh, let's say -
> forever :)s
>
> Can anyone suggest a randomization method that might achiev
On 12/9/19 8:50 PM, Paul Rubin wrote:
> Tim Daneliuk writes:
>> - Imagine an environment in which there may be multiple instances of a given
>> microservice written in Python.
>
> Decide the maximum number of microservice instances, say 1000. Chop up
> the 10 digit range into 1000 pieces, so 0
On 12/9/19 8:54 PM, Dennis Lee Bieber wrote:
> On Mon, 9 Dec 2019 18:52:11 -0600, Tim Daneliuk
> declaimed the following:
>
>>
>> - Each of these services needs to produce a string of ten digits guaranteed
>> to be unique
>> on a per service instance basis AND to not collide for - oh, let's say
Chris Angelico wrote:
...
> What if neither works, because there are assumptions that don't work?
then you get stuck doing it by hand, but you would have
been stuck doing it before for sure by hand so if you can
write something which might get some of the easy cases
done then at least you're sav
On Tue, Dec 10, 2019 at 4:41 PM songbird wrote:
>
> Chris Angelico wrote:
> ...
> > What if neither works, because there are assumptions that don't work?
>
> then you get stuck doing it by hand, but you would have
> been stuck doing it before for sure by hand so if you can
> write something whic
34 matches
Mail list logo