I wrote some stuff and had a future procedure referenced. It worked
great. Wasn't it up to very recently that Python procedures had to be
defined before use, not following?
Blaine <cactus_DAC@yahoo.com> writes:
I wrote some stuff and had a future procedure referenced. It worked
great. Wasn't it up to very recently that Python procedures had to be
defined before use, not following?
You can have forward references at compile time, but the target
procedure has to be defined before you can execute it. That is,
def a():
b()
def b():
print('hi')
a()
works fine. Python is interpreted and "def" is an executable statement, actually a type of assignment statement. So by the time you call a(),
the "def b():" has actually run, so you can call b.
def a():
b()
def b():
print('hi')
a()
def b(): ...Is that what you mean?
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 53:29:25 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,430 |