Contrary to what was stated in my tutorial, python data members should not be initialized outside of the __init__ function. Therefore, for example, instead of having:
You would actually have:
The 'self' making the variable a a data member of the class. Otherwise, there are times where you will get incorrect output of data members, etc, as was pointed out by a very wise redditor.
Sorry if I misled anyone!
Peace,
~Bodom
class MyClass: a = 0 def __init__(self, _a): self.a = _a
You would actually have:
class MyClass: def __init__(self, _a): self.a = _a
The 'self' making the variable a a data member of the class. Otherwise, there are times where you will get incorrect output of data members, etc, as was pointed out by a very wise redditor.
Sorry if I misled anyone!
Peace,
~Bodom
0 Comments On This Entry
← January 2022 →
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 |
Tags
- Adminsitration
- Apple
- assembly
- atmel
- AVR
- avr-libc
- Bada
- beginner
- Blackberry
- boot
- C
- C#, .NET, and XNA
- C++
- ccleaner
- code
- defragmentation
- Desktop
- dynamic
- embedded
- FooBada
- foobar
- foobar2000
- Gnome
- high
- interrupts
- Java
- level
- Linux
- Math
- Matricies
- Matrix
- microcontroller
- nasm
- New
- Open Source
- Operating System
- Oracle
- oscilloscope
- Programming
- Python
- Random Computer Stuff
- Random Rants
- Repair
- Samsung
- sector
- serial
- speed
- Square
- static
- timer
- UART
- Ubuntu
- unix
- USART
- virtualbox
- Visual
- VOIP
- Windows
- Windows 7
- x86
My Blog Links
Recent Entries
-
-
-
-
-
My thoughts on Bada as an Operating System and as a Development Platformon Sep 05 2010 10:43 AM
Recent Comments
Search My Blog
9 user(s) viewing
9 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)



Leave Comment









|