oded.dev

Oded Lazar

I code during the day, and think about the bugs I created at night.

Israel ABOUT
100 posts
47 tags

overriding builtins

2015-02-01
programming
python

I fired up python and wrote following code:

sum(range(5))  
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'int' object is not callable

why did this happen? Well, I accidentally overwritten the sum builtin:

sum = 0  

The fix is quite trivial: reload the builtin :)

from __builtin__ import sum  
Share
Newer
forgot to sudo? use 'fuck'
Older
get first item in iterable

recent

  • Working from Home + Corporate VPN

    2021-02-22

  • hacking

    AX3600 - Post #1

    2020-11-30

  • hacking

    AX3600 - Post #0

    2020-10-23

  • devops

    Getting an Accurate Weather Forecast using Wi-Fi Position System

    2018-01-12

  • thoughtsprogramming

    You're not a Java Developer

    2017-11-28

tag cloud

.netcore algorithm assembly awk ax3600 bash byobu c c++ concurrency cybereason data-structures databases debian devops digitalocean direnv docker fingerprint ghost gici gnome golang h.264 hackathon hexo idiom language-server-protocol linux lsp math neovim networking ocr optimization pgp productivity project python regex screen tmux tor vim vscode web-scraping xiaomi

categories

  • announcement5
    • blog3
    • general2
  • devops26
    • programming1
  • general6
    • book1
  • hacking2
  • new-years-resolution1
  • programming50
    • infosec1
  • thoughts9
    • devops1
    • general1
    • infosec4
    • programming1
Copyright © 2021 Oded Lazar. All Right Reserved.