Unix/Linux Go Back    

Programming Post questions about C, C++, Java, SQL, and other programming languages here.

Is this a Python 3.x.x bug?


Thread Tools Search this Thread Display Modes
Old Unix and Linux 06-08-2017   -   Original Discussion by wisecracker
RudiC's Unix or Linux Image
RudiC RudiC is offline Forum Staff  
Join Date: Jul 2012
Last Activity: 20 June 2018, 6:12 AM EDT
Location: Aachen, Germany
Posts: 12,908
Thanks: 429
Thanked 3,966 Times in 3,647 Posts
Originally Posted by wisecracker View Post
Hi RudiC...

So one is allowed to execute code AFTER exit has been called even if it is an ASCII string inside a variable, from awk AND Python and I thought Python was strict, what about Perl and others?
You don't "execute code AFTER exit" - you add one (or more) routines to the sequence of tasks the programme has to perform before giving control back to the caller, e.g. closing files, releasing locks, freeing allocated memory. If it is a write, you'd mayhap do it before stdout is closed, if it is just a number, you reference it just on exiting.

Awk's exit is a statement and Python's is a function.
Both - whatever they are - start quitting the programme.

Maybe it is just me but this should never be allowed to happen if the RC is not an integer.
Pascal wouldn't allow non-integers, C mayhap would - python might be somewhere in between.
The Following User Says Thank You to RudiC For This Useful Post:
wisecracker (06-08-2017)
Sponsored Links
Old Unix and Linux 06-12-2017   -   Original Discussion by wisecracker
Corona688's Unix or Linux Image
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
Join Date: Aug 2005
Last Activity: 13 June 2018, 6:37 PM EDT
Location: Saskatchewan
Posts: 22,696
Thanks: 1,183
Thanked 4,334 Times in 3,995 Posts
Originally Posted by wisecracker View Post
Hi Corona688...
It was this, it always needs a redirection to a file for it to work however, so nothing like the other two and technically MUCH safer:-
Huh? That program is nonsense... Safer than what? And how?
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
**python** unable to read the background color in python giridhar276 Shell Programming and Scripting 1 08-05-2014 02:53 AM
"ssh suse-server 'python -V' > python-version.out" not redirecting Druonysus SuSE 3 02-13-2013 08:59 PM
Python: bash-shell-like less functionality in the python shell Narnie Programming 0 06-25-2010 02:11 PM
what is python? kprescod4158 Shell Programming and Scripting 1 11-20-2007 07:58 PM

All times are GMT -4. The time now is 01:19 PM.