New answers tagged

2

According to the Classes section of the Python docs: “Private” instance variables that cannot be accessed except from inside an object don’t exist in Python. However, there is a convention that is followed by most Python code: a name prefixed with an underscore (e.g. _spam) should be treated as a non-public part of the API (whether it is a function, a ...


0

Here's an example that I'm doing to Fake the Id property of my entity. A.CallTo(() => _fakeRepository.FindAll()).Returns((new List<HighSchoolType>()).AsQueryable()); Guid fakePublicHighSchoolId = Guid.NewGuid(); var fakePublicHighSchool = A.Fake<HighSchoolType>(); A.CallTo(() => fakePublicHighSchool.Id)....


3

Why nested classes ? Bjarne Stroustrup explains in "The design and evolution of C++", the origin and rationale behind nested classes: original C++ in 1984 had a single name space (page 5 and 102). the use of nested classes was a compromise between the the concept of a class as a scope and the need of compatibility with C (page 102) it was further ...



Top 50 recent answers are included