Paste number 80153: dirname

Index of paste annotations: 1 | 2

Paste number 80153: dirname
Pasted by: nslater
When:3 years, 3 days ago
Share:Tweet this! | http://paste.lisp.org/+1PUH
Channel:#swhack
Paste contents:
Raw Source | XML | Display As
from os import path

def dirname(filename):
    return path.dirname(filename)

Annotations for this paste:

Annotation number 1: global statement
Pasted by: sbp
When:3 years, 3 days ago
Share:Tweet this! | http://paste.lisp.org/+1PUH/1
Paste contents:
Raw Source | Display As
from os import path

def dirname(filename):
   global path
   return path.dirname(filename)

Annotation number 2: import inside function scope
Pasted by: nslater
When:3 years, 3 days ago
Share:Tweet this! | http://paste.lisp.org/+1PUH/2
Paste contents:
Raw Source | Display As
def dirname(filename):
   from os import path
   return path.dirname(filename)

Colorize as:
Show Line Numbers
Index of paste annotations: 1 | 2

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.