Real small bug or not?

While going through the enhancement notebook, I got the following error:

Traceback (most recent call last):

  File "/usr/local/lib/python3.5/dist-packages/IPython/core/", line 2963, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-2-4845daa72c0e>", line 1, in <module>
    from fastai.conv_learner import *

  File "/home/ranakhalil/fastai/courses/dl2/fastai/", line 56
    def name(self): return f'{self.f.__name__}_{self.xtra_cut}'
SyntaxError: invalid syntax

Traced it to the following line:

    def name(self): return f'{self.f.__name__}_{self.xtra_cut}'

I fixed it simply to:

    def name(self): 
        return '{self.f.__name__}_{self.xtra_cut}'

I can’t tell though if this is a real bug, or perhaps am missing something in my env? It does look like a bug to me, just confirming!


My bad, I think this is intending to use f-strings!! I am trying to see if 3.5 supports that!

It’s not a bug, it’s just that you don’t have python 3.6 and f’{}_{self.xtra_cut}’ is a python 3.6 syntax for string formatting :wink:

1 Like

yeah that makes sense! I didn’t want to use conda :stuck_out_tongue: I guess i might need to now to manage multi python envs.

Thanks :slight_smile: