Merge branch 'm7thon-python23-octal-arguments'
This commit is contained in:
commit
ad7dcb2c87
4 changed files with 133 additions and 105 deletions
|
|
@ -19,14 +19,20 @@
|
|||
#include <string>
|
||||
|
||||
// All kinds of numbers: hex, octal (which pose special problems to Python), negative...
|
||||
void trickyvalue1(int first, int pos = -1) {}
|
||||
void trickyvalue2(int first, unsigned rgb = 0xabcdef) {}
|
||||
void trickyvalue3(int first, int mode = 0644) {}
|
||||
|
||||
class TrickyInPython {
|
||||
public:
|
||||
int value_m1(int first, int pos = -1) { return pos; }
|
||||
unsigned value_0xabcdef(int first, unsigned rgb = 0xabcdef) { return rgb; }
|
||||
int value_0644(int first, int mode = 0644) { return mode; }
|
||||
int value_perm(int first, int mode = 0640 | 0004) { return mode; }
|
||||
int value_m01(int first, int val = -01) { return val; }
|
||||
bool booltest2(bool x = 0 | 1) { return x; }
|
||||
};
|
||||
|
||||
void doublevalue1(int first, double num = 0.0e-1) {}
|
||||
void doublevalue2(int first, double num = -0.0E2) {}
|
||||
|
||||
// Long long arguments are not handled at Python level currently but still work.
|
||||
void seek(long long offset = 0LL) {}
|
||||
void seek2(unsigned long long offset = 0ULL) {}
|
||||
void seek3(long offset = 0L) {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue