sigmaquan / better-python-59-ways Goto Github PK
View Code? Open in Web Editor NEWCode Sample of Book "Effective Python: 59 Specific Ways to Write Better Pyton" by Brett Slatkin
Code Sample of Book "Effective Python: 59 Specific Ways to Write Better Pyton" by Brett Slatkin
This sample code is really fantastic !!!
item_32_use_getattr.py line 5: represent teh rows -> represent the rows
item_45_use_datetime.py line 9: probably fin yourself -> probably find yourself
item_56_unittest.py line 6: nothing int eh compiler -> nothing in the compiler
item_57_pdb.py line 42: function. YOu can import -> function. You can import
in the About blurb on the main repository frontpage:
Code Sample of Book "Effective Python: 59 Specific Ways to Write Better Pyton" by Brett Slatkin
Pyton Python
it contains the contents of item 15.
In item 22, I noticed there is a Grade here but didn't get what it is.
def report_grade(self, score, weight):
self._grades.append(Grade(score, weight))
Also, when i run the sample code, i got this error
self._grades.append(Grade(score, weight))
NameError: name 'Grade' is not defined
Someone can help explaining?
Shouldn't the output be "{5, 8, 7}"?
i guess we should clear to the readers that += in you specific example it is an atomic operation and if you run the code multiple times you will always the right answer Counter should be 500000, found 500000
, because in 3.X version of python they were consistently made to be atomic and so i guess the code is misleading especially for new readers ! i can suggest other senarios where we will have data races if you will
see title
Hi there! Firstly, great thanks for such big collection of useful tips for Python developers.
The problems is the following: the hyperlink for item 41 goes to 404. That's it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.